-
Notifications
You must be signed in to change notification settings - Fork 777
Refactors and rules for RHEL7 DISA STIG #7827
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
Closed
lenox-joseph
wants to merge
10
commits into
ComplianceAsCode:master
from
lenox-joseph:upstream-merge
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
835609b
Refactor display_login_attempts into a DISA-specific rule as DISA has…
lenox-joseph d20e18e
Rename remediation path to not conflict with delete rules.
lenox-joseph e23efcf
add newline at end of file.
lenox-joseph b760adc
Revise rhel7 to match DISA manual stig requirement.
lenox-joseph b8d4694
Revise templates to allow for wider configuration of privleged commands.
lenox-joseph 70ce09f
PEP compliance
lenox-joseph 646f6fa
Factor out the defaulting items during preprocess.
lenox-joseph 7df23cc
Implement Kubernetes remediation for RHEL7.
lenox-joseph 24c33e8
Implement PR requested change by @ggbecker; documenting new options `…
lenox-joseph e33667a
Consistently use ssg.utils explicitly instead of from x import y
lenox-joseph File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...uide/services/ssh/ssh_server/sshd_use_approved_ciphers_ordered_stig/tests/comment.fail.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| if grep -q "^Ciphers" /etc/ssh/sshd_config; then | ||
| sed -i "s/^Ciphers.*/# ciphers aes256-ctr,aes192-ctr,aes128-ctr/" /etc/ssh/sshd_config | ||
| sed -i "s/^Ciphers.*/# Ciphers aes256-ctr,aes192-ctr,aes128-ctr/" /etc/ssh/sshd_config | ||
| else | ||
| echo "# ciphers aes256-ctr,aes192-ctr,aes128-ctr" >> /etc/ssh/sshd_config | ||
| echo "# Ciphers aes256-ctr,aes192-ctr,aes128-ctr" >> /etc/ssh/sshd_config | ||
| fi |
4 changes: 2 additions & 2 deletions
4
...ervices/ssh/ssh_server/sshd_use_approved_ciphers_ordered_stig/tests/correct_value.pass.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| #!/bin/bash | ||
|
|
||
| if grep -q "^Ciphers" /etc/ssh/sshd_config; then | ||
| sed -i "s/^Ciphers.*/ciphers aes256-ctr,aes192-ctr,aes128-ctr/" /etc/ssh/sshd_config | ||
| sed -i "s/^Ciphers.*/Ciphers aes256-ctr,aes192-ctr,aes128-ctr/" /etc/ssh/sshd_config | ||
| else | ||
| echo 'ciphers aes256-ctr,aes192-ctr,aes128-ctr' >> /etc/ssh/sshd_config | ||
| echo 'Ciphers aes256-ctr,aes192-ctr,aes128-ctr' >> /etc/ssh/sshd_config | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...s/audit_kernel_module_loading/audit_rules_kernel_module_loading_create/ansible/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # platform = multi_platform_rhel,multi_platform_rhv,multi_platform_sle,multi_platform_ol | ||
| # reboot = false | ||
| # complexity = low | ||
| # disruption = low | ||
| # strategy = configure | ||
|
|
||
| # What architecture are we on? | ||
|
|
||
| - name: Set architecture for audit finit_module tasks | ||
| set_fact: | ||
| audit_arch: "b{{ ansible_architecture | regex_replace('.*(\\d\\d$)','\\1') }}" | ||
|
|
||
| - name: Perform remediation of Audit rules for finit_module for x86 platform | ||
| block: | ||
| {{{ ansible_audit_augenrules_add_syscall_rule( | ||
| action_arch_filters="-a always,exit -F arch=b32", | ||
| other_filters="", | ||
| auid_filters="", | ||
| syscalls=["create_module"], | ||
| key="module-change", | ||
| syscall_grouping=[], | ||
| )|indent(4) }}} | ||
| {{{ ansible_audit_auditctl_add_syscall_rule( | ||
| action_arch_filters="-a always,exit -F arch=b32", | ||
| other_filters="", | ||
| auid_filters="", | ||
| syscalls=["create_module"], | ||
| key="module-change", | ||
| syscall_grouping=[], | ||
| )|indent(4) }}} | ||
|
|
||
| - name: Perform remediation of Audit rules for finit_module for x86_64 platform | ||
| block: | ||
| {{{ ansible_audit_augenrules_add_syscall_rule( | ||
| action_arch_filters="-a always,exit -F arch=b64", | ||
| other_filters="", | ||
| auid_filters="", | ||
| syscalls=["create_module"], | ||
| key="module-change", | ||
| syscall_grouping=[], | ||
| )|indent(4) }}} | ||
| {{{ ansible_audit_auditctl_add_syscall_rule( | ||
| action_arch_filters="-a always,exit -F arch=b64", | ||
| other_filters="", | ||
| auid_filters="", | ||
| syscalls=["create_module"], | ||
| key="module-change", | ||
| syscall_grouping=[], | ||
| )|indent(4) }}} | ||
| when: audit_arch == "b64" | ||
|
|
23 changes: 23 additions & 0 deletions
23
...rules/audit_kernel_module_loading/audit_rules_kernel_module_loading_create/bash/shared.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # platform = multi_platform_all | ||
|
|
||
| # First perform the remediation of the syscall rule | ||
| # Retrieve hardware architecture of the underlying system | ||
| # Note: 32-bit and 64-bit kernel syscall numbers not always line up => | ||
| # it's required on a 64-bit system to check also for the presence | ||
| # of 32-bit's equivalent of the corresponding rule. | ||
| # (See `man 7 audit.rules` for details ) | ||
| [ "$(getconf LONG_BIT)" = "32" ] && RULE_ARCHS=("b32") || RULE_ARCHS=("b32" "b64") | ||
|
|
||
| for ARCH in "${RULE_ARCHS[@]}" | ||
| do | ||
| ACTION_ARCH_FILTERS="-a always,exit -F arch=$ARCH" | ||
| OTHER_FILTERS="" | ||
| AUID_FILTERS="" | ||
| SYSCALL="create_module" | ||
| KEY="module-change" | ||
| SYSCALL_GROUPING="" | ||
|
|
||
| # Perform the remediation for both possible tools: 'auditctl' and 'augenrules' | ||
| {{{ bash_fix_audit_syscall_rule("augenrules", "$ACTION_ARCH_FILTERS", "$OTHER_FILTERS", "$AUID_FILTERS", "$SYSCALL", "$SYSCALL_GROUPING", "$KEY") }}} | ||
| {{{ bash_fix_audit_syscall_rule("auditctl", "$ACTION_ARCH_FILTERS", "$OTHER_FILTERS", "$AUID_FILTERS", "$SYSCALL", "$SYSCALL_GROUPING", "$KEY") }}} | ||
| done |
15 changes: 15 additions & 0 deletions
15
...udit_kernel_module_loading/audit_rules_kernel_module_loading_create/kubernetes/shared.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| # platform = multi_platform_rhel,multi_platform_fedora,multi_platform_rhcos | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: MachineConfig | ||
| spec: | ||
| config: | ||
| ignition: | ||
| version: 3.1.0 | ||
| storage: | ||
| files: | ||
| - contents: | ||
| source: data:,-a%20always%2Cexit%20-F%20arch%3Db32%20-S%20create_module%20-k%20module-change%0A-a%20always%2Cexit%20-F%20arch%3Db64%20-S%20create_module%20-k%20module-change%0A | ||
| mode: 0600 | ||
| path: /etc/audit/rules.d/75-kernel-module-loading-create.rules | ||
| overwrite: true |
70 changes: 70 additions & 0 deletions
70
...ules/audit_kernel_module_loading/audit_rules_kernel_module_loading_create/oval/shared.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| <def-group> | ||
| <definition class="compliance" id="audit_rules_kernel_module_loading_create" version="1"> | ||
| {{{ oval_metadata("The audit rules should be configured to log information about kernel module loading and unloading.") }}} | ||
|
|
||
| <criteria operator="OR"> | ||
|
|
||
| <!-- Test the augenrules case --> | ||
| <criteria operator="AND"> | ||
| <extend_definition comment="audit augenrules" definition_ref="audit_rules_augenrules" /> | ||
| <criterion comment="audit augenrules 32-bit create_module" test_ref="test_32bit_ardm_create_module_augenrules" /> | ||
| <criteria operator="OR"> | ||
| <!-- System either isn't 64-bit => we just check presence of 32-bit version of create_module audit DAC rule --> | ||
| <extend_definition comment="64-bit system" definition_ref="system_info_architecture_64bit" negate="true" /> | ||
| <!-- Or system is 64-bit => in that case we also need to verify the presence of 64-bit version of create_module audit DAC rule --> | ||
| <criterion comment="audit augenrules 64-bit create_module" test_ref="test_64bit_ardm_create_module_augenrules" /> | ||
| </criteria> | ||
| </criteria> | ||
|
|
||
| <!-- OR test the auditctl case --> | ||
| <criteria operator="AND"> | ||
| <extend_definition comment="audit auditctl" definition_ref="audit_rules_auditctl" /> | ||
| <criterion comment="audit auditctl 32-bit create_module" test_ref="test_32bit_ardm_create_module_auditctl" /> | ||
| <criteria operator="OR"> | ||
| <!-- System either isn't 64-bit => we just check presence of 32-bit version of the create_module audit DAC rule --> | ||
| <extend_definition comment="64-bit system" definition_ref="system_info_architecture_64bit" negate="true" /> | ||
| <!-- Or system is 64-bit => in that case we also need to verify the presence of 64-bit version of create_module audit DAC rule --> | ||
| <criterion comment="audit auditctl 64-bit create_module" test_ref="test_64bit_ardm_create_module_auditctl" /> | ||
| </criteria> | ||
| </criteria> | ||
|
|
||
| </criteria> | ||
| </definition> | ||
|
|
||
| <ind:textfilecontent54_test check="all" comment="audit augenrules 32-bit create_module" id="test_32bit_ardm_create_module_augenrules" version="1"> | ||
| <ind:object object_ref="object_32bit_ardm_create_module_augenrules" /> | ||
| </ind:textfilecontent54_test> | ||
| <ind:textfilecontent54_object id="object_32bit_ardm_create_module_augenrules" version="1"> | ||
| <ind:filepath operation="pattern match">^/etc/audit/rules\.d/.*\.rules$</ind:filepath> | ||
| <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+create_module[\s]+|([\s]+|[,])create_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$</ind:pattern> | ||
| <ind:instance datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
|
|
||
| <ind:textfilecontent54_test check="all" comment="audit augenrules 64-bit create_module" id="test_64bit_ardm_create_module_augenrules" version="1"> | ||
| <ind:object object_ref="object_64bit_ardm_create_module_augenrules" /> | ||
| </ind:textfilecontent54_test> | ||
| <ind:textfilecontent54_object id="object_64bit_ardm_create_module_augenrules" version="1"> | ||
| <ind:filepath operation="pattern match">^/etc/audit/rules\.d/.*\.rules$</ind:filepath> | ||
| <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+create_module[\s]+|([\s]+|[,])create_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$</ind:pattern> | ||
| <ind:instance datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
|
|
||
| <ind:textfilecontent54_test check="all" comment="audit auditctl 32-bit create_module" id="test_32bit_ardm_create_module_auditctl" version="1"> | ||
| <ind:object object_ref="object_32bit_ardm_create_module_auditctl" /> | ||
| </ind:textfilecontent54_test> | ||
| <ind:textfilecontent54_object id="object_32bit_ardm_create_module_auditctl" version="1"> | ||
| <ind:filepath>/etc/audit/audit.rules</ind:filepath> | ||
| <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b32[\s]+)(?:.*(-S[\s]+create_module[\s]+|([\s]+|[,])create_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$</ind:pattern> | ||
| <ind:instance datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
|
|
||
| <ind:textfilecontent54_test check="all" comment="audit auditctl 64-bit create_module" id="test_64bit_ardm_create_module_auditctl" version="1"> | ||
| <ind:object object_ref="object_64bit_ardm_create_module_auditctl" /> | ||
| </ind:textfilecontent54_test> | ||
| <ind:textfilecontent54_object id="object_64bit_ardm_create_module_auditctl" version="1"> | ||
| <ind:filepath>/etc/audit/audit.rules</ind:filepath> | ||
| <ind:pattern operation="pattern match">^[\s]*-a[\s]+always,exit[\s]+(?:.*-F[\s]+arch=b64[\s]+)(?:.*(-S[\s]+create_module[\s]+|([\s]+|[,])create_module([\s]+|[,]))).*(-k[\s]+|-F[\s]+key=)[\S]+[\s]*$</ind:pattern> | ||
| <ind:instance datatype="int">1</ind:instance> | ||
| </ind:textfilecontent54_object> | ||
|
|
||
| </def-group> |
34 changes: 34 additions & 0 deletions
34
...igure_rules/audit_kernel_module_loading/audit_rules_kernel_module_loading_create/rule.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| documentation_complete: true | ||
|
|
||
| prodtype: rhel7 | ||
|
|
||
| title: 'Ensure auditd Collects Information on Kernel Module Unloading - create_module' | ||
|
|
||
| description: |- | ||
| To capture kernel module unloading events, use following line, setting ARCH to | ||
| either b32 for 32-bit system, or having two lines for both b32 and b64 in case your system is 64-bit: | ||
| <pre>-a always,exit -F arch=<i>ARCH</i> -S create_module -F key=module-change</pre> | ||
|
|
||
| Place to add the line depends on a way <tt>auditd</tt> daemon is configured. If it is configured | ||
| to use the <tt>augenrules</tt> program (the default), add the line to a file with suffix | ||
| <tt>.rules</tt> in the directory <tt>/etc/audit/rules.d</tt>. | ||
|
|
||
| If the <tt>auditd</tt> daemon is configured to use the <tt>auditctl</tt> utility, | ||
| add the line to file <tt>/etc/audit/audit.rules</tt>. | ||
|
|
||
| rationale: |- | ||
| The removal of kernel modules can be used to alter the behavior of | ||
| the kernel and potentially introduce malicious code into kernel space. It is important | ||
| to have an audit trail of modules that have been introduced into the kernel. | ||
|
|
||
| severity: medium | ||
|
|
||
| identifiers: | ||
| cce@rhel7: CCE-85911-6 | ||
|
|
||
| references: | ||
| disa: CCI-000172 | ||
| srg: SRG-OS-000471-GPOS-00216,SRG-OS-000477-GPOS-00222 | ||
| stigid@rhel7: RHEL-07-030819 | ||
|
|
||
| {{{ complete_ocil_entry_audit_syscall(syscall="create_module") }}} |
5 changes: 5 additions & 0 deletions
5
...udit_kernel_module_loading/audit_rules_kernel_module_loading_create/tests/default.fail.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/bash | ||
| # remediation = bash | ||
|
|
||
| rm -f /etc/audit/rules.d/* | ||
| > /etc/audit/audit.rules |
4 changes: 4 additions & 0 deletions
4
...s/audit_kernel_module_loading/audit_rules_kernel_module_loading_create/tests/ocp4/e2e.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| --- | ||
| default_result: FAIL | ||
| result_after_remediation: PASS | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| {{%- if product in ["rhel8"] %}} | ||
| {{%- set kmod_audit="-a always,exit -F path=/usr/bin/kmod -F perm=x -F auid>=1000 -F auid!=unset -F key=privileged" %}} | ||
| {{%- elif product in ["rhel7"] %}} | ||
| {{%- set kmod_audit="-w /usr/bin/kmod -p x -F auid!=unset -k module-change" %}} | ||
| {{%- elif product in ["ubuntu2004"] %}} | ||
| {{%- set kmod_audit="-w /bin/kmod -p x -k modules" %}} | ||
| {{%- elif product in ["ol7"] %}} | ||
|
|
@@ -10,7 +12,7 @@ | |
|
|
||
| documentation_complete: true | ||
|
|
||
| prodtype: ol7,ol8,rhel8,rhel9,sle12,sle15,ubuntu2004 | ||
| prodtype: ol7,ol8,rhel7,rhel8,rhel9,sle12,sle15,ubuntu2004 | ||
|
|
||
| title: 'Ensure auditd Collects Information on the Use of Privileged Commands - kmod' | ||
|
|
||
|
|
@@ -38,6 +40,7 @@ rationale: |- | |
| severity: medium | ||
|
|
||
| identifiers: | ||
| cce@rhel7: CCE-85895-1 | ||
| cce@rhel8: CCE-89455-0 | ||
| cce@rhel9: CCE-90262-7 | ||
| cce@sle12: CCE-83207-1 | ||
|
|
@@ -49,6 +52,7 @@ references: | |
| srg: SRG-OS-000037-GPOS-00015,SRG-OS-000042-GPOS-00020,SRG-OS-000062-GPOS-00031,SRG-OS-000392-GPOS-00172,SRG-OS-000462-GPOS-00206,SRG-OS-000471-GPOS-00215,SRG-OS-000471-GPOS-00216,SRG-OS-000477-GPOS-00222 | ||
| stigid@ol7: OL07-00-030840 | ||
| stigid@ol8: OL08-00-030580 | ||
| stigid@rhel7: RHEL-07-030840 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is the only addition to the reference list and its only use. |
||
| stigid@rhel8: RHEL-08-030580 | ||
| stigid@sle12: SLES-12-020360 | ||
| stigid@sle15: SLES-15-030410 | ||
|
|
@@ -63,3 +67,6 @@ template: | |
| vars: | ||
| path: /usr/bin/kmod | ||
| path@ubuntu2004: /bin/kmod | ||
| min_auid@rhel7: 0 | ||
| skip_action@rhel7: true | ||
| watch@rhel7: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| CCE-85891-0 | ||
| CCE-85892-8 | ||
| CCE-85893-6 | ||
| CCE-85895-1 | ||
| CCE-85898-5 | ||
| CCE-85901-7 | ||
| CCE-85905-8 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
while this seems correct for the rule description, unfortunately the template is not aligned with this. So the OVAL check, bash, ansible remediation will do something different for RHEL7. I don't know if it's worth to change the template just because of this rule that is not following the same pattern as other RHEL7 STIG audit rules. We may want to request DISA to update this and keep similar to other items in RHEL7 audit STIG items, but that can take a while and there is a risk they don't accept it. Or we can create a new specific rule just for RHEL7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll do an remediation test to be 100% sure, but I was looking over systems that AFAIK I have only run this template over and it passed the check.
Since we already have branches in the templates, we could just split it in the check + remediations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ggbecker I just looked it again and you're right re: remediation.
Looking over the template, I could also just add 3 variables (that default to existing behavior) to the template to set behavior accordingly. As a bonus, if we run into a similar situation (like a rule wants
-wor not having-a always,exit, we can account for it and we can set them per product (which I am working through now).Currently looking at:
min_auid- variable (defaults toauid) that represents the minimum auid value for an audit. This could be instead be a boolean switch, but this lets us vary a specific rule fromauid. If it's 0, the check is omitted.skip_action- boolean value (true/false; defaults tofalse) that suppresses the generation of-a always,exitwhen set totrue.watch- changes from-F path=xxxto-w xxxwhentrue(defaults to false).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's considered to be "too much", then we can stuff overrides into the same rule implementation for RHEL7.