-
Notifications
You must be signed in to change notification settings - Fork 718
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 new rule ensure_apparmor_enforce_or_complain #9985
Conversation
96fb00b
to
d139432
Compare
Code Climate has analyzed commit d139432 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 49.8% (0.0% change). View more on Code Climate. |
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. I a couple of questions on this PR.
@@ -0,0 +1,32 @@ | |||
<def-group> | |||
<definition class="compliance" id="ensure_apparmor_enforce_or_complain" version="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.
I wanted to double-check that you wanted this rule to allow for both, even on level 2.
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.
hmm good catch, for level 2 I want it to be in enforce and to fail if in complain mode.
is there a good way to do this without creating two different 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.
You should be able to check if the state matches a variable like in selinux_state rule.
@@ -0,0 +1,32 @@ | |||
<def-group> | |||
<definition class="compliance" id="ensure_apparmor_enforce_or_complain" version="1"> | |||
{{{ oval_metadata("Ensure all AppArmor Profiles are in var_set_apparmor_mode") }}} |
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 think there is something wrong here. The final built content looks like
<oval-def:description>Ensure all AppArmor Profiles are in var_set_apparmor_mode</oval-def:description>
.
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.
nice catch, I will fix it
Description:
Rationale:
policy that is stricter than the default policy, which is perfectly acceptable. This item is
intended to ensure that any policies that exist on the system are activated.
Review Hints:
Run the following command and verify that profiles are loaded, and are in either enforce
or complain mode:
# apparmor_status | grep profiles
Review output and ensure that profiles are loaded, and in either enforce or complain mode:
Run the following command and verify no processes are unconfined
# apparmor_status | grep processes
Review the output and ensure no processes are unconfined: