Skip to content

Commit

Permalink
Merge pull request rancher#191 from vardhaman22/4.1.7-fix-cis-1.23-check
Browse files Browse the repository at this point in the history
fix 4.1.7 test case for k3s-cis-1.23-permissive profile
  • Loading branch information
vardhaman22 authored Mar 4, 2024
2 parents d7f5c12 + 95f0fc9 commit e11290c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 71 deletions.
38 changes: 3 additions & 35 deletions package/cfg/k3s-cis-1.23-hardened/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,45 +103,13 @@ groups:

- id: 4.1.7
text: "Ensure that the certificate authorities file permissions are set to 644 or more restrictive (Manual)"
audit: "stat -c %a /var/lib/rancher/k3s/server/tls/server-ca.crt"
audit: "stat -c %a $kubeletcafile"
tests:
test_items:
- flag: "644"
- flag: "permissions"
compare:
op: eq
op: bitmask
value: "644"
set: true
- flag: "640"
compare:
op: eq
value: "640"
set: true
- flag: "600"
compare:
op: eq
value: "600"
set: true
- flag: "444"
compare:
op: eq
value: "444"
set: true
- flag: "440"
compare:
op: eq
value: "440"
set: true
- flag: "400"
compare:
op: eq
value: "400"
set: true
- flag: "000"
compare:
op: eq
value: "000"
set: true
bin_op: or
remediation: |
Run the following command to modify the file permissions of the
--client-ca-file chmod 644 <filename>
Expand Down
40 changes: 4 additions & 36 deletions package/cfg/k3s-cis-1.23-permissive/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,49 +103,17 @@ groups:

- id: 4.1.7
text: "Ensure that the certificate authorities file permissions are set to 644 or more restrictive (Manual)"
audit: "stat -c %a /var/lib/rancher/k3s/server/tls/server-ca.crt"
audit: "stat -c %a $kubeletcafile"
tests:
test_items:
- flag: "644"
- flag: "permissions"
compare:
op: eq
op: bitmask
value: "644"
set: true
- flag: "640"
compare:
op: eq
value: "640"
set: true
- flag: "600"
compare:
op: eq
value: "600"
set: true
- flag: "444"
compare:
op: eq
value: "444"
set: true
- flag: "440"
compare:
op: eq
value: "440"
set: true
- flag: "400"
compare:
op: eq
value: "400"
set: true
- flag: "000"
compare:
op: eq
value: "000"
set: true
bin_op: or
remediation: |
Run the following command to modify the file permissions of the
--client-ca-file chmod 644 <filename>
scored: true
scored: false

- id: 4.1.8
text: "Ensure that the client certificate authorities file ownership is set to root:root (Manual)"
Expand Down

0 comments on commit e11290c

Please sign in to comment.