|
|
fe0dde |
From f3837e672c45e341da3f0d4425627a96104a6983 Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
fe0dde |
Date: Tue, 8 Sep 2020 13:25:45 +0200
|
|
|
fe0dde |
Subject: [PATCH 1/6] introduce variable
|
|
|
fe0dde |
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../obsolete/tftp/tftpd_secure_directory.var | 14 ++++++++++++++
|
|
|
fe0dde |
.../obsolete/tftp/tftpd_uses_secure_mode/rule.yml | 7 +++----
|
|
|
fe0dde |
2 files changed, 17 insertions(+), 4 deletions(-)
|
|
|
fe0dde |
create mode 100644 linux_os/guide/services/obsolete/tftp/tftpd_secure_directory.var
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_secure_directory.var b/linux_os/guide/services/obsolete/tftp/tftpd_secure_directory.var
|
|
|
fe0dde |
new file mode 100644
|
|
|
fe0dde |
index 0000000000..6a5e29caa4
|
|
|
fe0dde |
--- /dev/null
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_secure_directory.var
|
|
|
fe0dde |
@@ -0,0 +1,14 @@
|
|
|
fe0dde |
+documentation_complete: true
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+title: 'TFTP server secure directory'
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+description: "Specify the directory which is used by TFTP server as a root directory when running in secure mode."
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+type: string
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+operator: equals
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+interactive: true
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+options:
|
|
|
fe0dde |
+ default: /var/lib/tftpboot
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml
|
|
|
fe0dde |
index ed64b15bef..10b8ab3a2b 100644
|
|
|
fe0dde |
--- a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml
|
|
|
fe0dde |
@@ -8,8 +8,8 @@ description: |-
|
|
|
fe0dde |
If running the <tt>tftp</tt> service is necessary, it should be configured
|
|
|
fe0dde |
to change its root directory at startup. To do so, ensure
|
|
|
fe0dde |
<tt>/etc/xinetd.d/tftp</tt> includes <tt>-s</tt> as a command line argument, as shown in
|
|
|
fe0dde |
- the following example (which is also the default):
|
|
|
fe0dde |
- server_args = -s /var/lib/tftpboot
|
|
|
fe0dde |
+ the following example:
|
|
|
fe0dde |
+ server_args = -s {{{ sub_var_value("tftpd_secure_directory") }}}
|
|
|
fe0dde |
|
|
|
fe0dde |
rationale: |-
|
|
|
fe0dde |
Using the <tt>-s</tt> option causes the TFTP service to only serve files from the
|
|
|
fe0dde |
@@ -33,7 +33,6 @@ references:
|
|
|
fe0dde |
srg@rhel6: SRG-OS-999999
|
|
|
fe0dde |
disa: CCI-000366
|
|
|
fe0dde |
nist: CM-6(b),AC-6,CM-7(a)
|
|
|
fe0dde |
-
|
|
|
fe0dde |
nist-csf: PR.AC-3,PR.AC-4,PR.DS-5,PR.IP-1,PR.PT-3,PR.PT-4
|
|
|
fe0dde |
srg: SRG-OS-000480-GPOS-00227
|
|
|
fe0dde |
stigid@rhel7: RHEL-07-040720
|
|
|
fe0dde |
@@ -56,4 +55,4 @@ ocil: |-
|
|
|
fe0dde |
The output should indicate the <tt>server_args</tt> variable is configured
|
|
|
fe0dde |
with the <tt>-s</tt> flag, matching the example below:
|
|
|
fe0dde |
$ grep "server_args" /etc/xinetd.d/tftp
|
|
|
fe0dde |
- server_args = -s /var/lib/tftpboot
|
|
|
fe0dde |
+ server_args = -s {{{ sub_var_value("tftpd_secure_directory") }}}
|
|
|
fe0dde |
|
|
|
fe0dde |
From bd3d3f90681f505ceff934e9d4c4d618bbc07474 Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
fe0dde |
Date: Tue, 8 Sep 2020 13:26:06 +0200
|
|
|
fe0dde |
Subject: [PATCH 2/6] update oval
|
|
|
fe0dde |
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../tftp/tftpd_uses_secure_mode/oval/shared.xml | 10 +++++++++-
|
|
|
fe0dde |
1 file changed, 9 insertions(+), 1 deletion(-)
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml
|
|
|
fe0dde |
index 363b499afa..9f42fcd043 100644
|
|
|
fe0dde |
--- a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml
|
|
|
fe0dde |
@@ -17,10 +17,18 @@
|
|
|
fe0dde |
</definition>
|
|
|
fe0dde |
<ind:textfilecontent54_test check="all" comment="tftpd secure mode" id="test_tftpd_uses_secure_mode" version="1">
|
|
|
fe0dde |
<ind:object object_ref="object_tftpd_uses_secure_mode" />
|
|
|
fe0dde |
+ <ind:state state_ref="state_tftpd_uses_secure_mode" />
|
|
|
fe0dde |
</ind:textfilecontent54_test>
|
|
|
fe0dde |
<ind:textfilecontent54_object id="object_tftpd_uses_secure_mode" version="1">
|
|
|
fe0dde |
<ind:filepath>/etc/xinetd.d/tftp</ind:filepath>
|
|
|
fe0dde |
- <ind:pattern operation="pattern match">^[\s]*server_args[\s]+=.*[\s]+\-s[\s]+.+$</ind:pattern>
|
|
|
fe0dde |
+ <ind:pattern operation="pattern match">^[\s]*server_args[\s]+=[\s]+.*?-s[\s]+([/\.\w]+).*$</ind:pattern>
|
|
|
fe0dde |
<ind:instance datatype="int">1</ind:instance>
|
|
|
fe0dde |
</ind:textfilecontent54_object>
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+ <ind:textfilecontent54_state id="state_tftpd_uses_secure_mode" version="1">
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+ var_ref="tftpd_secure_directory" />
|
|
|
fe0dde |
+ </ind:textfilecontent54_state>
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+ <external_variable comment="TFTP server secure directory" datatype="string" id="tftpd_secure_directory" version="1" />
|
|
|
fe0dde |
</def-group>
|
|
|
fe0dde |
|
|
|
fe0dde |
From 2a1e67365de4ea7b78ace2fb730b7192d9cb8a43 Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
fe0dde |
Date: Tue, 8 Sep 2020 13:26:26 +0200
|
|
|
fe0dde |
Subject: [PATCH 3/6] update bash remediation
|
|
|
fe0dde |
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../tftp/tftpd_uses_secure_mode/bash/shared.sh | 14 ++++++++++++++
|
|
|
fe0dde |
1 file changed, 14 insertions(+)
|
|
|
fe0dde |
create mode 100644 linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh
|
|
|
fe0dde |
new file mode 100644
|
|
|
fe0dde |
index 0000000000..491d8e90d6
|
|
|
fe0dde |
--- /dev/null
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh
|
|
|
fe0dde |
@@ -0,0 +1,14 @@
|
|
|
fe0dde |
+#!/bin/bash
|
|
|
fe0dde |
+# platform = Oracle Linux 7,Oracle Linux 8,Red Hat Enterprise Linux 6,Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,Red Hat Virtualization 4,WRLinux 1019
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+. /usr/share/scap-security-guide/remediation_functions
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+{{{ bash_instantiate_variables ("tftpd_secure_directory") }}}
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+if grep -q 'server_args' /etc/xinetd.d/tftp; then
|
|
|
fe0dde |
+ sed -i -E "s;^([[:blank:]]*server_args[[:blank:]]+=[[:blank:]]+.*?)(-s[[:blank:]]+[[:graph:]]+)*(.*)$;\1 -s $tftpd_secure_directory \3;" /etc/xinetd.d/tftp
|
|
|
fe0dde |
+else
|
|
|
fe0dde |
+ echo "server_args = -s $tftpd_secure_directory" >> /etc/xinetd.d/tftp
|
|
|
fe0dde |
+fi
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+
|
|
|
fe0dde |
|
|
|
fe0dde |
From 649880f746bd80cb3e6a9ae3908ce422e03c1690 Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
fe0dde |
Date: Tue, 8 Sep 2020 13:26:43 +0200
|
|
|
fe0dde |
Subject: [PATCH 4/6] add tests
|
|
|
fe0dde |
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../tftp/tftpd_uses_secure_mode/tests/correct.pass.sh | 9 +++++++++
|
|
|
fe0dde |
.../tftpd_uses_secure_mode/tests/line_missing.fail.sh | 7 +++++++
|
|
|
fe0dde |
.../tftp/tftpd_uses_secure_mode/tests/wrong.fail.sh | 9 +++++++++
|
|
|
fe0dde |
3 files changed, 25 insertions(+)
|
|
|
fe0dde |
create mode 100644 linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/correct.pass.sh
|
|
|
fe0dde |
create mode 100644 linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/line_missing.fail.sh
|
|
|
fe0dde |
create mode 100644 linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/wrong.fail.sh
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/correct.pass.sh b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/correct.pass.sh
|
|
|
fe0dde |
new file mode 100644
|
|
|
fe0dde |
index 0000000000..392e68740f
|
|
|
fe0dde |
--- /dev/null
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/correct.pass.sh
|
|
|
fe0dde |
@@ -0,0 +1,9 @@
|
|
|
fe0dde |
+#!/bin/bash
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+yum -y install tftp-server
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+if grep -q 'server_args' /etc/xinetd.d/tftp; then
|
|
|
fe0dde |
+ sed -i 's/.*server_args.*/server_args = -s \/var\/lib\/tftpboot/' /etc/xinetd.d/tftp
|
|
|
fe0dde |
+else
|
|
|
fe0dde |
+ echo "server_args = -s /var/lib/tftpboot" >> /etc/xinetd.d/tftp
|
|
|
fe0dde |
+fi
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/line_missing.fail.sh b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/line_missing.fail.sh
|
|
|
fe0dde |
new file mode 100644
|
|
|
fe0dde |
index 0000000000..a342248240
|
|
|
fe0dde |
--- /dev/null
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/line_missing.fail.sh
|
|
|
fe0dde |
@@ -0,0 +1,7 @@
|
|
|
fe0dde |
+#!/bin/bash
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+yum -y install tftp-server
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+if grep -q 'server_args' /etc/xinetd.d/tftp; then
|
|
|
fe0dde |
+ sed -i '/.*server_args.*/d' /etc/xinetd.d/tftp
|
|
|
fe0dde |
+fi
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/wrong.fail.sh b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/wrong.fail.sh
|
|
|
fe0dde |
new file mode 100644
|
|
|
fe0dde |
index 0000000000..d9a9b4b622
|
|
|
fe0dde |
--- /dev/null
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/tests/wrong.fail.sh
|
|
|
fe0dde |
@@ -0,0 +1,9 @@
|
|
|
fe0dde |
+#!/bin/bash
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+yum -y install tftp-server
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+if grep -q 'server_args' /etc/xinetd.d/tftp; then
|
|
|
fe0dde |
+ sed -i 's/.*server_args.*/server_args = --something/' /etc/xinetd.d/tftp
|
|
|
fe0dde |
+else
|
|
|
fe0dde |
+ echo "server_args = --something" >> /etc/xinetd.d/tftp
|
|
|
fe0dde |
+fi
|
|
|
fe0dde |
|
|
|
fe0dde |
From 57554f1ba9fb7464c808f00d4bd26475451243b9 Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
fe0dde |
Date: Tue, 8 Sep 2020 13:27:03 +0200
|
|
|
fe0dde |
Subject: [PATCH 5/6] add ansible remediation
|
|
|
fe0dde |
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../tftpd_uses_secure_mode/ansible/shared.yml | 31 +++++++++++++++++++
|
|
|
fe0dde |
1 file changed, 31 insertions(+)
|
|
|
fe0dde |
create mode 100644 linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml
|
|
|
fe0dde |
new file mode 100644
|
|
|
fe0dde |
index 0000000000..9f5bdea58e
|
|
|
fe0dde |
--- /dev/null
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml
|
|
|
fe0dde |
@@ -0,0 +1,31 @@
|
|
|
fe0dde |
+# platform = Oracle Linux 7,Oracle Linux 8,Red Hat Enterprise Linux 6,Red Hat Enterprise Linux 7,Red Hat Enterprise Linux 8,Red Hat Virtualization 4,WRLinux 1019
|
|
|
fe0dde |
+# reboot = false
|
|
|
fe0dde |
+# complexity = low
|
|
|
fe0dde |
+# strategy = configure
|
|
|
fe0dde |
+# disruption = low
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+{{{ ansible_instantiate_variables("tftpd_secure_directory") }}}
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+- name: "Find out if the file exists and contains the line configuring server arguments"
|
|
|
fe0dde |
+ find:
|
|
|
fe0dde |
+ path: "/etc/xinetd.d"
|
|
|
fe0dde |
+ patterns: "tftp"
|
|
|
fe0dde |
+ contains: '^[\s]+server_args.*$'
|
|
|
fe0dde |
+ register: tftpd_secure_config_line
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+- name: "Ensure that TFTP server is configured to start with secure directory"
|
|
|
fe0dde |
+ lineinfile:
|
|
|
fe0dde |
+ path: "/etc/xinetd.d/tftp"
|
|
|
fe0dde |
+ regexp: '^[\s]*(server_args[\s]+=[\s]+.*?)(-s[\s]+[/\.\w]+)*(.*)$'
|
|
|
fe0dde |
+ line: '\1 -s {{ tftpd_secure_directory }} \3'
|
|
|
fe0dde |
+ state: present
|
|
|
fe0dde |
+ backrefs: true
|
|
|
fe0dde |
+ when: tftpd_secure_config_line is defined and tftpd_secure_config_line.matched > 0
|
|
|
fe0dde |
+
|
|
|
fe0dde |
+- name: "Insert correct config line to start TFTP server with secure directory"
|
|
|
fe0dde |
+ lineinfile:
|
|
|
fe0dde |
+ path: "/etc/xinetd.d/tftp"
|
|
|
fe0dde |
+ line: "server_args = -s {{ tftpd_secure_directory }}"
|
|
|
fe0dde |
+ state: present
|
|
|
fe0dde |
+ create: true
|
|
|
fe0dde |
+ when: tftpd_secure_config_line is defined and tftpd_secure_config_line.matched == 0
|
|
|
fe0dde |
|
|
|
fe0dde |
From df97d24f0cfd1a182925d1ddf0d72a02caa943bf Mon Sep 17 00:00:00 2001
|
|
|
fe0dde |
From: Vojtech Polasek <vpolasek@redhat.com>
|
|
|
fe0dde |
Date: Wed, 9 Sep 2020 09:36:25 +0200
|
|
|
fe0dde |
Subject: [PATCH 6/6] rename variable
|
|
|
fe0dde |
|
|
|
fe0dde |
---
|
|
|
fe0dde |
.../obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml | 6 +++---
|
|
|
fe0dde |
.../obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh | 6 +++---
|
|
|
fe0dde |
.../obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml | 4 ++--
|
|
|
fe0dde |
.../services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml | 4 ++--
|
|
|
fe0dde |
..._secure_directory.var => var_tftpd_secure_directory.var} | 0
|
|
|
fe0dde |
5 files changed, 10 insertions(+), 10 deletions(-)
|
|
|
fe0dde |
rename linux_os/guide/services/obsolete/tftp/{tftpd_secure_directory.var => var_tftpd_secure_directory.var} (100%)
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml
|
|
|
fe0dde |
index 9f5bdea58e..604491357e 100644
|
|
|
fe0dde |
--- a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/ansible/shared.yml
|
|
|
fe0dde |
@@ -4,7 +4,7 @@
|
|
|
fe0dde |
# strategy = configure
|
|
|
fe0dde |
# disruption = low
|
|
|
fe0dde |
|
|
|
fe0dde |
-{{{ ansible_instantiate_variables("tftpd_secure_directory") }}}
|
|
|
fe0dde |
+{{{ ansible_instantiate_variables("var_tftpd_secure_directory") }}}
|
|
|
fe0dde |
|
|
|
fe0dde |
- name: "Find out if the file exists and contains the line configuring server arguments"
|
|
|
fe0dde |
find:
|
|
|
fe0dde |
@@ -17,7 +17,7 @@
|
|
|
fe0dde |
lineinfile:
|
|
|
fe0dde |
path: "/etc/xinetd.d/tftp"
|
|
|
fe0dde |
regexp: '^[\s]*(server_args[\s]+=[\s]+.*?)(-s[\s]+[/\.\w]+)*(.*)$'
|
|
|
fe0dde |
- line: '\1 -s {{ tftpd_secure_directory }} \3'
|
|
|
fe0dde |
+ line: '\1 -s {{ var_tftpd_secure_directory }} \3'
|
|
|
fe0dde |
state: present
|
|
|
fe0dde |
backrefs: true
|
|
|
fe0dde |
when: tftpd_secure_config_line is defined and tftpd_secure_config_line.matched > 0
|
|
|
fe0dde |
@@ -25,7 +25,7 @@
|
|
|
fe0dde |
- name: "Insert correct config line to start TFTP server with secure directory"
|
|
|
fe0dde |
lineinfile:
|
|
|
fe0dde |
path: "/etc/xinetd.d/tftp"
|
|
|
fe0dde |
- line: "server_args = -s {{ tftpd_secure_directory }}"
|
|
|
fe0dde |
+ line: "server_args = -s {{ var_tftpd_secure_directory }}"
|
|
|
fe0dde |
state: present
|
|
|
fe0dde |
create: true
|
|
|
fe0dde |
when: tftpd_secure_config_line is defined and tftpd_secure_config_line.matched == 0
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh
|
|
|
fe0dde |
index 491d8e90d6..3f0881a320 100644
|
|
|
fe0dde |
--- a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/bash/shared.sh
|
|
|
fe0dde |
@@ -3,12 +3,12 @@
|
|
|
fe0dde |
|
|
|
fe0dde |
. /usr/share/scap-security-guide/remediation_functions
|
|
|
fe0dde |
|
|
|
fe0dde |
-{{{ bash_instantiate_variables ("tftpd_secure_directory") }}}
|
|
|
fe0dde |
+{{{ bash_instantiate_variables ("var_tftpd_secure_directory") }}}
|
|
|
fe0dde |
|
|
|
fe0dde |
if grep -q 'server_args' /etc/xinetd.d/tftp; then
|
|
|
fe0dde |
- sed -i -E "s;^([[:blank:]]*server_args[[:blank:]]+=[[:blank:]]+.*?)(-s[[:blank:]]+[[:graph:]]+)*(.*)$;\1 -s $tftpd_secure_directory \3;" /etc/xinetd.d/tftp
|
|
|
fe0dde |
+ sed -i -E "s;^([[:blank:]]*server_args[[:blank:]]+=[[:blank:]]+.*?)(-s[[:blank:]]+[[:graph:]]+)*(.*)$;\1 -s $var_tftpd_secure_directory \3;" /etc/xinetd.d/tftp
|
|
|
fe0dde |
else
|
|
|
fe0dde |
- echo "server_args = -s $tftpd_secure_directory" >> /etc/xinetd.d/tftp
|
|
|
fe0dde |
+ echo "server_args = -s $var_tftpd_secure_directory" >> /etc/xinetd.d/tftp
|
|
|
fe0dde |
fi
|
|
|
fe0dde |
|
|
|
fe0dde |
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml
|
|
|
fe0dde |
index 9f42fcd043..2268a49467 100644
|
|
|
fe0dde |
--- a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/oval/shared.xml
|
|
|
fe0dde |
@@ -27,8 +27,8 @@
|
|
|
fe0dde |
|
|
|
fe0dde |
<ind:textfilecontent54_state id="state_tftpd_uses_secure_mode" version="1">
|
|
|
fe0dde |
|
|
|
fe0dde |
- var_ref="tftpd_secure_directory" />
|
|
|
fe0dde |
+ var_ref="var_tftpd_secure_directory" />
|
|
|
fe0dde |
</ind:textfilecontent54_state>
|
|
|
fe0dde |
|
|
|
fe0dde |
- <external_variable comment="TFTP server secure directory" datatype="string" id="tftpd_secure_directory" version="1" />
|
|
|
fe0dde |
+ <external_variable comment="TFTP server secure directory" datatype="string" id="var_tftpd_secure_directory" version="1" />
|
|
|
fe0dde |
</def-group>
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml
|
|
|
fe0dde |
index 10b8ab3a2b..002e78535e 100644
|
|
|
fe0dde |
--- a/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml
|
|
|
fe0dde |
+++ b/linux_os/guide/services/obsolete/tftp/tftpd_uses_secure_mode/rule.yml
|
|
|
fe0dde |
@@ -9,7 +9,7 @@ description: |-
|
|
|
fe0dde |
to change its root directory at startup. To do so, ensure
|
|
|
fe0dde |
<tt>/etc/xinetd.d/tftp</tt> includes <tt>-s</tt> as a command line argument, as shown in
|
|
|
fe0dde |
the following example:
|
|
|
fe0dde |
- server_args = -s {{{ sub_var_value("tftpd_secure_directory") }}}
|
|
|
fe0dde |
+ server_args = -s {{{ sub_var_value("var_tftpd_secure_directory") }}}
|
|
|
fe0dde |
|
|
|
fe0dde |
rationale: |-
|
|
|
fe0dde |
Using the <tt>-s</tt> option causes the TFTP service to only serve files from the
|
|
|
fe0dde |
@@ -55,4 +55,4 @@ ocil: |-
|
|
|
fe0dde |
The output should indicate the <tt>server_args</tt> variable is configured
|
|
|
fe0dde |
with the <tt>-s</tt> flag, matching the example below:
|
|
|
fe0dde |
$ grep "server_args" /etc/xinetd.d/tftp
|
|
|
fe0dde |
- server_args = -s {{{ sub_var_value("tftpd_secure_directory") }}}
|
|
|
fe0dde |
+ server_args = -s {{{ sub_var_value("var_tftpd_secure_directory") }}}
|
|
|
fe0dde |
diff --git a/linux_os/guide/services/obsolete/tftp/tftpd_secure_directory.var b/linux_os/guide/services/obsolete/tftp/var_tftpd_secure_directory.var
|
|
|
fe0dde |
similarity index 100%
|
|
|
fe0dde |
rename from linux_os/guide/services/obsolete/tftp/tftpd_secure_directory.var
|
|
|
fe0dde |
rename to linux_os/guide/services/obsolete/tftp/var_tftpd_secure_directory.var
|