-
Notifications
You must be signed in to change notification settings - Fork 706
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
Fix ansible remediation for audispd plugin UBTU-20-010216 #12293
Fix ansible remediation for audispd plugin UBTU-20-010216 #12293
Conversation
Hi @yunimoo. 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-sigs/prow repository. |
This datastream diff is auto generated by the check Click here to see the full diffansible remediation for rule 'xccdf_org.ssgproject.content_rule_auditd_audispd_configure_remote_server' differs.
--- xccdf_org.ssgproject.content_rule_auditd_audispd_configure_remote_server
+++ xccdf_org.ssgproject.content_rule_auditd_audispd_configure_remote_server
@@ -15,8 +15,9 @@
tags:
- always
-- name: Make sure that a remote server is configured for Audispd
- lineinfile:
+- name: Configure audispd Plugin To Send Logs To Remote Server - Make sure that a
+ remote server is configured for Audispd
+ ansible.builtin.lineinfile:
path: /etc/audit/audisp-remote.conf
line: remote_server = {{ var_audispd_remote_server }}
regexp: ^\s*remote_server\s*=.*$ |
🤖 A k8s content image for this PR is available at: Click here to see how to deploy itIf you alread have Compliance Operator deployed: Otherwise deploy the content and operator together by checking out ComplianceAsCode/compliance-operator and: |
- name: "{{{ rule_title }}} - Set active to true for offloading to remote server" | ||
ansible.builtin.lineinfile: | ||
path: "{{{ audisp_config_plugin_path }}}" | ||
regexp: ^(.*)(active\s*=)(?!.*yes) |
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.
The test scenarios for this rule, eg. ubuntu_correct.pass.sh
, use a capital A in Active
, however, this remediation and the rule description use small a in `active. The OVAL seems to correctly use a case-insensitive regex modifier. Could you investigate this discrepancy about the A case?
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.
Good catch! Thanks for the feedback, I will take a look at this
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.
Not sure how you would like to proceed since the STIG and man page seem to use active
over Active
. Though, I don't think this would matter as it is case insensitive. The bash remediation is also active
instead of capital A.
Not sure if this is helpful, but I found these related docs:
- https://linux.die.net/man/8/audispd
- https://manpages.debian.org/unstable/auditd/audispd.conf.5.en.html ("All option names and values are case insensitive.")
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 confirming that these options are case insensitive. Based on that, I think that:
- in the rule description we can use whatever we want, ie. it can stay lowercase
- in the OVAL we should use case-insentive check, which we already have
- the Ansible and Bash remediations should be able to set the correct option value regardless of the case used in the file (it can change it to lowercase during the remediation if that's convenient for us)
- the test scenarios should be testing multiple different letter cases.
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.
the bash remediation makes use of set_config_file
macro which has a insensitive
parameter. Perhaps ansible needs the same parameter, as ansible_set_config_file
doesn't have one.
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.
This is a good idea, I'll work on adding the insensitive capabilities for ansible_set_config_file
. Should this change be here or should I open up a new PR?
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.
@dodys excellent idea!
@yunimoo If the change of the macro would be large it would be better to have it as a separate PR.
83fe180
to
cee3639
Compare
This commit will add in ansible remediation for audispd plugin which also ensures that the plugin is enabled within au-remote.conf.
cee3639
to
293f09c
Compare
Code Climate has analyzed commit 293f09c 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 59.4% (0.0% change). View more on Code Climate. |
/packit build |
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.
lgtm, thanks!
@jan-cerny if you agree we can merge this and the other PR was open in #12314 (currently WIP)
Description:
Original PR: #11093
Rationale:
Review Hints:
Build the product:
To test these changes with Ansible:
Checkout Manual STIG OVAL definitions, and use software like DISA STIG Viewer to view definitions.
For reference, please review the latest artifacts: https://public.cyber.mil/stigs/downloads/