Skip to content
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

feat: add cisbenchmark checks for session 1.2 API Server #720

Merged
merged 1 commit into from
Jul 25, 2022

Conversation

josedonizetti
Copy link
Contributor

@josedonizetti josedonizetti commented Jul 4, 2022

Signed-off-by: Jose Donizetti jdbjunior@gmail.com

Adds rules for session 1.2 API Server (up to 1.2.30, for now 1.2.31 and 1.2.32 are not included). This is my first time writing opa, let me know if you see anything that can be improved.

aquasecurity/trivy#2200

cisbenchmark version: V1.23

"KCV0001": "1.2.1 Ensure that the --anonymous-auth argument is set to false (Manual)",
"KCV0002": "1.2.2 Ensure that the --token-auth-file parameter is not set (Automated)",
"KCV0003": "1.2.3 Ensure that the --DenyServiceExternalIPs is not set (Automated)",
"KCV0004": "1.2.4 Ensure that the --kubelet-https argument is set to true (Automated)",
"KCV0005": "1.2.5 Ensure that the --kubelet-client-certificate and --kubelet-client-key arguments are set as appropriate (Automated)",
"KCV0006": "1.2.6 Ensure that the --kubelet-certificate-authority argument is set as appropriate (Automated)",
"KCV0007": "1.2.7 Ensure that the --authorization-mode argument is not set to AlwaysAllow (Automated)",
"KCV0008": "1.2.8 Ensure that the --authorization-mode argument includes Node (Automated)",
"KCV0009": "1.2.9 Ensure that the --authorization-mode argument includes RBAC (Automated)",
"KCV0010": "1.2.10 Ensure that the admission control plugin EventRateLimit is set (Manual)",
"KCV0011": "1.2.11 Ensure that the admission control plugin AlwaysAdmit is not set (Automated)",
"KCV0012": "1.2.12 Ensure that the admission control plugin AlwaysPullImages is set (Manual)",
"KCV0013": "1.2.13 Ensure that the admission control plugin SecurityContextDeny is set if PodSecurityPolicy is not used (Manual)",
"KCV0014": "1.2.14 Ensure that the admission control plugin ServiceAccount is set (Automated)",
"KCV0015": "1.2.15 Ensure that the admission control plugin NamespaceLifecycle is set (Automated)",
"KCV0016": "1.2.16 Ensure that the admission control plugin NodeRestriction is set (Automated)",
"KCV0017": "1.2.17 Ensure that the --secure-port argument is not set to 0 (Automated)",
"KCV0018": "1.2.18 Ensure that the --profiling argument is set to false (Automated)",
"KCV0019": "1.2.19 Ensure that the --audit-log-path argument is set (Automated)",
"KCV0020": "1.2.20 Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Automated)",
"KCV0021": "1.2.21 Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Automated)",
"KCV0022": "1.2.22 Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Automated)",
"KCV0024": "1.2.24 Ensure that the --service-account-lookup argument is set to true (Automated)",
"KCV0025": "1.2.25 Ensure that the --service-account-key-file argument is set as appropriate (Automated)",
"KCV0026": "1.2.26 Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Automated)",
"KCV0027": "1.2.27 Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Automated)",
"KCV0028": "1.2.28 Ensure that the --client-ca-file argument is set as appropriate (Automated)",
"KCV0029": "1.2.29 Ensure that the --etcd-cafile argument is set as appropriate (Automated)",
"KCV0030": "1.2.30 Ensure that the --encryption-provider-config argument is set as appropriate (Manual)",

@josedonizetti josedonizetti changed the title DRAFT: feat: add cisbench 1.2 API Server checks DRAFT: feat: add cisbench part 1 Jul 4, 2022
@josedonizetti josedonizetti force-pushed the cisbenchmark branch 12 times, most recently from b9f4a5d to 713ed13 Compare July 12, 2022 23:31
@josedonizetti josedonizetti marked this pull request as ready for review July 12, 2022 23:44
@josedonizetti josedonizetti changed the title DRAFT: feat: add cisbench part 1 feat: add cisbenchmark checks for session 1.2 API Server Jul 12, 2022
@josedonizetti
Copy link
Contributor Author

@chen-keinan ^^

@chen-keinan
Copy link
Contributor

chen-keinan commented Jul 13, 2022

@josedonizetti , look amazing can you put more details on , it will be clear to understand:

  • which cis bench was the the checks written against
  • mapping between rego checks and cis checks

@chen-keinan
Copy link
Contributor

chen-keinan commented Jul 15, 2022

LGTM! only one comment , maybe change the prefix id , KCVXXX or something, so we could be able to easily identified it as cis-bench release in Trivy and trivy operator if needed

Signed-off-by: Jose Donizetti <jdbjunior@gmail.com>
@josedonizetti
Copy link
Contributor Author

@chen-keinan prefix id changed!

@josedonizetti
Copy link
Contributor Author

@liamg @owenrumney This is ready for review now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants