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
accounts_umask_etc_bashrc: depend on bash being installed #10915
accounts_umask_etc_bashrc: depend on bash being installed #10915
Conversation
Hi @candrews. Thanks for your PR. I'm waiting for a ComplianceAsCode member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
This datastream diff is auto generated by the check Click here to see the full diffbash remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc' differs.
--- xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
+++ xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
@@ -1,3 +1,5 @@
+# Remediation is applicable only in certain platforms
+if rpm --quiet -q bash; then
var_accounts_user_umask=''
@@ -11,3 +13,7 @@
if ! [ $? -eq 0 ]; then
echo "umask $var_accounts_user_umask" >> /etc/bashrc
fi
+
+else
+ >&2 echo 'Remediation is not applicable, nothing was done'
+fi
ansible remediation for rule 'xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc' differs.
--- xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
+++ xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
@@ -1,3 +1,18 @@
+- name: Gather the package facts
+ package_facts:
+ manager: auto
+ tags:
+ - CCE-81036-6
+ - DISA-STIG-RHEL-08-020353
+ - NIST-800-53-AC-6(1)
+ - NIST-800-53-CM-6(a)
+ - PCI-DSSv4-8.6.1
+ - accounts_umask_etc_bashrc
+ - low_complexity
+ - low_disruption
+ - medium_severity
+ - no_reboot_needed
+ - restrict_strategy
- name: XCCDF Value var_accounts_user_umask # promote to variable
set_fact:
var_accounts_user_umask: !!str
@@ -12,6 +27,7 @@
check_mode: true
changed_when: false
register: umask_replace
+ when: '"bash" in ansible_facts.packages'
tags:
- CCE-81036-6
- DISA-STIG-RHEL-08-020353
@@ -30,7 +46,9 @@
path: /etc/bashrc
regexp: ^(\s*)umask(\s+).*
replace: \g<1>umask\g<2>{{ var_accounts_user_umask }}
- when: umask_replace.found > 0
+ when:
+ - '"bash" in ansible_facts.packages'
+ - umask_replace.found > 0
tags:
- CCE-81036-6
- DISA-STIG-RHEL-08-020353
@@ -49,7 +67,9 @@
create: true
path: /etc/bashrc
line: umask {{ var_accounts_user_umask }}
- when: umask_replace.found == 0
+ when:
+ - '"bash" in ansible_facts.packages'
+ - umask_replace.found == 0
tags:
- CCE-81036-6
- DISA-STIG-RHEL-08-020353
Platform has been changed for rule 'xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc'
--- xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
+++ xccdf_org.ssgproject.content_rule_accounts_umask_etc_bashrc
@@ -1 +1 @@
-
+oval:ssg-package_bash:def:1 |
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.
Thanks for the PR! Please take look at the CI failures as they do appear to be valid (at least the GitHub Actions, save Fedora rawhide). Let me know any help.
/etc/bashrc is only used if bash is installed. Signed-off-by: Craig Andrews <candrews@integralblue.com>
6330a77
to
25652b2
Compare
Code Climate has analyzed commit 25652b2 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 53.2% (0.0% change). View more on Code Climate. |
I believe I have addressed that problem. Thank you for pointing it out! |
/packit retest-failed |
3 similar comments
/packit retest-failed |
/packit retest-failed |
/packit retest-failed |
Description:
accounts_umask_etc_bashrc: depend on bash being installed
Rationale:
/etc/bashrc is only used if bash is installed.