Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New rule tftp_uses_secure_mode_systemd #12436

Merged
merged 2 commits into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions components/tftp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ rules:
- package_tftp_removed
- service_tftp_disabled
- tftpd_uses_secure_mode
- tftp_uses_secure_mode_systemd
3 changes: 1 addition & 2 deletions controls/srg_gpos/SRG-OS-000480-GPOS-00227.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,11 +239,10 @@ controls:
- enable_authselect
- no_host_based_files
- no_user_host_based_files
- tftpd_uses_secure_mode
- display_login_attempts
- installed_OS_is_vendor_supported
- selinux_all_devicefiles_labeled
- xwindows_remove_packages
- chrony_set_nts

- tftp_uses_secure_mode_systemd
status: automated
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
documentation_complete: true

title: 'Ensure tftp systemd Service Uses Secure Mode'

description: |-
If running the Trivial File Transfer Protocol (TFTP) service is necessary,
it should be configured to change its root directory at startup. To do so,
find the path for the <tt>tftp</tt> systemd service:
<pre>$ sudo systemctl show tftp | grep ExecStart=
ExecStart={ path=/usr/sbin/in.tftpd ; argv[]=/usr/sbin/in.tftpd -s /var/lib/tftpboot ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }e
</pre>

and ensure the <tt>ExecStart</tt> line on that file includes the <tt>-s</tt> option with a subdirectory:
<pre>ExecStart=/usr/sbin/in.tftpd -s {{{ xccdf_value("var_tftpd_secure_directory") }}}</pre>

rationale: |-
Using the <tt>-s</tt> option causes the TFTP service to only serve files from the
given directory. Serving files from an intentionally-specified directory
reduces the risk of sharing files which should remain private.

severity: medium

ocil: |-
Use <tt>udo systemctl show tftp</tt> to verify that tftp service is using secure mode.
<pre>$ sudo systemctl show tftp | grep ExecStart=
ExecStart={ path=/usr/sbin/in.tftpd ; argv[]=/usr/sbin/in.tftpd -s /var/lib/tftpboot ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }e
</pre>

and ensure the <tt>ExecStart</tt> line on that file includes the <tt>-s</tt> option with a subdirectory:
<pre>ExecStart=/usr/sbin/in.tftpd -s {{{ xccdf_value("var_tftpd_secure_directory") }}}</pre>


ocil_clause: 'the ExecStart property of tftp does not contain correctly set -s flag'

platform: package[tftp-server]

warnings:
- general: |-
An OVAL check is not currently available since <tt>ExecStart</tt> cannot be checked with OVAL since it is not exposed via dbus.
Currently, a remedation is not available for this rule.


identifiers:
cce@rhel10: CCE-86495-9
1 change: 0 additions & 1 deletion shared/references/cce-redhat-avail.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ CCE-86484-3
CCE-86492-6
CCE-86493-4
CCE-86494-2
CCE-86495-9
CCE-86496-7
CCE-86497-5
CCE-86498-3
Expand Down
Loading