-
Notifications
You must be signed in to change notification settings - Fork 697
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
Add ansible remediation to mount_option_home template #12546
Add ansible remediation to mount_option_home template #12546
Conversation
Signed-off-by: Armando Acosta <[email protected]>
Signed-off-by: Armando Acosta <[email protected]>
Hi @mrkanon. 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. |
# complexity = low | ||
# disruption = high | ||
|
||
- name: "Initialize variables" |
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.
Please add {{{ rule_title }}}:
to each Ansible Task name so that the same Ansible Tasks can be distinguished between rules.
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.
Thank you for the review, I updated this
ansible.builtin.set_fact: | ||
allowed_mount_point: "{{ allowed_mount_point + [item.stdout_lines[0]] }}" | ||
with_items: "{{ df_output.results }}" | ||
when: item.stdout_lines[0] != "" |
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 df
doesn't return anything or produces an error then the stdout_lines is empty and doesn't have 0
element which causes the Playbook to fail and terminate.
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.
Thank you for the review, I updated this
Update task name with "full_name" in the mount_home_option template & Fix conditional to cover none value Signed-off-by: Armando Acosta <[email protected]>
Code Climate has analyzed commit 434ad07 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 60.9% (0.0% change). View more on Code Climate. |
Description:
Added
Updated
Rationale:
This change introduces ansible remediation in the mount_option_home template, which is used by the mount_option_home_noexec and mount_option_home_nosuid rules; the logic was taken from bash remediation.