-
Notifications
You must be signed in to change notification settings - Fork 510
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 CIS Agent for automated CIS compliance checking #2881
Conversation
This is already quite large, so I've broken each checker into separate commits to try to make it a little easier to review.
API wiring was relatively small, so just included it here. |
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'm still going through it but here are a few things that caught my eye.
e98bff1
to
4a0cd1f
Compare
Improved report information by adding a metadata file to be included in the checkers directory. This gives a little more flexibility if we want to have multiple types of compliance checks by just pointing bloodhound at a different checks directory where it can discover metadata about the checks being performed. |
Force pushed a refactoring of the code to make it better organized. |
446505c
to
a0e4f32
Compare
And a couple more force-pushes to get rid of commits that are already in |
Removed |
This adds the 1.1.1.1 check for the UDF module. Signed-off-by: Sean McGinnis <[email protected]>
This adds the 1.3.1 benchmark to ensure dm-verity is in use. Signed-off-by: Sean McGinnis <[email protected]>
This adds a check for CIS 1.4.1 to verify setuid core dumps are disabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds a CIS check for 1.4.2 to verify ASLR is enabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS check 1.4.3 to verify unprivileged eBPF is disabled. Signed-off-by: Sean McGinnis <[email protected]>
This add CIS check 1.4.4 to verify user namespaces are disabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 1.5.1 to verify selinux enforcement. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 1.5.2 to verify kernel lockdown mode is enabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 2.1.1.1 to verify ntp is configured. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.1.1 to verify send_redirects are disabled. Signed-off-by: Sean McGinnis <[email protected]>
Adds CIS 3.2.1 to verify source routed packets are disabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.2.2 to verify ICMP redirects are not accepted. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.2.3 to verify secure ICMP redirects are not accepted. Signed-off-by: Sean McGinnis <[email protected]>
This add CIS 3.2.4 to verify suspicious packets are logged. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.2.5 to verify broadcast ICMP requests are ignored. Signed-off-by: Sean McGinnis <[email protected]>
Adds CIS 3.2.6 to verify bogus ICMP responses are ignored. Signed-off-by: Sean McGinnis <[email protected]>
Adds CIS 3.2.7 to verify TCP SYN cookies are enabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.3.1 to verify SCTP is disabled. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.4.1.1 to verify default deny firewall policy. Signed-off-by: Sean McGinnis <[email protected]>
Adds CIS 3.4.1.2 to verify IPv4 loopback traffic policy. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 3.4.2.1 to verify IPv6 default deny firewall policy. Signed-off-by: Sean McGinnis <[email protected]>
Adds CIS 3.4.2.2 to verify IPv6 koopback traffic is configured. Signed-off-by: Sean McGinnis <[email protected]>
Adds CIS 4.1.1.1 to verify journald configuration. Signed-off-by: Sean McGinnis <[email protected]>
This adds CIS 4.1.2 to verify file permissions on journal files. Signed-off-by: Sean McGinnis <[email protected]>
Issue number:
Closes #2731
Description of changes:
This adds tooling to be able to run Bottlerocket CIS compliance checks.
This is made up of three parts:
apiserver
to be able to call this CLI and get its resultsapiclient
as the user interface for someone to get compliance status from a running systemTesting done:
bloodhound
CLI.Removed from this PR, but just for the sake of showing test coverage, also did:
apiserver
endpoint by usingapiclient raw -m GET -u /cis-report
andapiclient raw -m GET -u /cis-report?level=2&format=json
.apiclient
interface.apiclient
and verified help output contained information about new subcommand.apiclient cisreport
and verified default level 1 text report was output.apiclient cisreport -l 2
and verified level 2 report generated.apiclient cisreport -f json
and verified json report generated. Ran throughjq
to view pretty-print view.apiclient cisreport -f invalid
and verified error message returned.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.