Replace custom k3s etcd script checks with vanilla grep checks

Signed-off-by: Derek Nola <derek.nola@suse.com>
pull/1601/head
Derek Nola 3 weeks ago
parent ff9341a5d0
commit 205268868b
No known key found for this signature in database
GPG Key ID: 5E741CE7ED12510E

@ -10,7 +10,7 @@ groups:
checks:
- id: 2.1
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 2.1"
audit: "grep -A 5 'client-transport-security' $etcdconf | grep -E 'cert-file|key-file'"
tests:
bin_op: and
test_items:
@ -30,7 +30,7 @@ groups:
- id: 2.2
text: "Ensure that the --client-cert-auth argument is set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.2"
audit: "grep -A 5 'client-transport-security' $etcdconf | grep 'client-cert-auth'"
tests:
bin_op: or
test_items:
@ -50,7 +50,7 @@ groups:
- id: 2.3
text: "Ensure that the --auto-tls argument is not set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.3"
audit: "grep 'auto-tls' $etcdconf"
tests:
bin_op: or
test_items:
@ -70,7 +70,7 @@ groups:
- id: 2.4
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 2.4"
audit: "grep -A 5 'peer-transport-security' $etcdconf | grep -E 'cert-file|key-file'"
tests:
bin_op: and
test_items:
@ -91,7 +91,7 @@ groups:
- id: 2.5
text: "Ensure that the --peer-client-cert-auth argument is set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.5"
audit: "grep -A 5 'peer-transport-security' $etcdconf | grep 'client-cert-auth'"
tests:
bin_op: or
test_items:
@ -111,7 +111,7 @@ groups:
- id: 2.6
text: "Ensure that the --peer-auto-tls argument is not set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.6"
audit: "grep 'peer-auto-tls' $etcdconf"
tests:
bin_op: or
test_items:
@ -132,7 +132,7 @@ groups:
- id: 2.7
text: "Ensure that a unique Certificate Authority is used for etcd (Manual)"
audit: "check_for_k3s_etcd.sh 2.7"
audit: "grep 'trusted-ca-file' $etcdconf"
tests:
test_items:
- flag: "trusted-ca-file"

@ -155,7 +155,7 @@ groups:
- id: 1.1.11
text: "Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)"
audit: "check_for_k3s_etcd.sh 1.1.11"
audit: "stat -c %a /var/lib/rancher/k3s/server/db/etcd"
tests:
test_items:
- flag: "700"
@ -736,7 +736,7 @@ groups:
- id: 1.2.26
text: "Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 1.2.29"
audit: "journalctl -D /var/log/journal -u k3s | grep -m1 'Running kube-apiserver'"
tests:
bin_op: and
test_items:

@ -10,7 +10,7 @@ groups:
checks:
- id: 2.1
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 2.1"
audit: "grep -A 5 'client-transport-security' $etcdconf | grep -E 'cert-file|key-file'"
tests:
bin_op: and
test_items:
@ -30,7 +30,7 @@ groups:
- id: 2.2
text: "Ensure that the --client-cert-auth argument is set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.2"
audit: "grep -A 5 'client-transport-security' $etcdconf | grep 'client-cert-auth'"
tests:
bin_op: or
test_items:
@ -50,7 +50,7 @@ groups:
- id: 2.3
text: "Ensure that the --auto-tls argument is not set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.3"
audit: "grep 'auto-tls' $etcdconf"
tests:
bin_op: or
test_items:
@ -70,7 +70,7 @@ groups:
- id: 2.4
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 2.4"
audit: "grep -A 5 'peer-transport-security' $etcdconf | grep -E 'cert-file|key-file'"
tests:
bin_op: and
test_items:
@ -91,7 +91,7 @@ groups:
- id: 2.5
text: "Ensure that the --peer-client-cert-auth argument is set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.5"
audit: "grep -A 5 'peer-transport-security' $etcdconf | grep 'client-cert-auth'"
tests:
bin_op: or
test_items:
@ -111,7 +111,7 @@ groups:
- id: 2.6
text: "Ensure that the --peer-auto-tls argument is not set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.6"
audit: "grep 'peer-auto-tls' $etcdconf"
tests:
bin_op: or
test_items:
@ -132,7 +132,7 @@ groups:
- id: 2.7
text: "Ensure that a unique Certificate Authority is used for etcd (Automated)"
audit: "check_for_k3s_etcd.sh 2.7"
audit: "grep 'trusted-ca-file' $etcdconf"
tests:
test_items:
- flag: "trusted-ca-file"

@ -155,7 +155,7 @@ groups:
- id: 1.1.11
text: "Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)"
audit: "check_for_k3s_etcd.sh 1.1.11"
audit: "stat -c %a /var/lib/rancher/k3s/server/db/etcd"
tests:
test_items:
- flag: "700"
@ -735,7 +735,7 @@ groups:
- id: 1.2.26
text: "Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 1.2.29"
audit: "journalctl -D /var/log/journal -u k3s | grep -m1 'Running kube-apiserver'"
tests:
bin_op: and
test_items:

@ -10,7 +10,7 @@ groups:
checks:
- id: 2.1
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 2.1"
audit: "grep -A 5 'client-transport-security' $etcdconf | grep -E 'cert-file|key-file'"
tests:
bin_op: and
test_items:
@ -30,7 +30,7 @@ groups:
- id: 2.2
text: "Ensure that the --client-cert-auth argument is set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.2"
audit: "grep -A 5 'client-transport-security' $etcdconf | grep 'client-cert-auth'"
tests:
bin_op: or
test_items:
@ -50,7 +50,7 @@ groups:
- id: 2.3
text: "Ensure that the --auto-tls argument is not set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.3"
audit: "grep 'auto-tls' $etcdconf | true"
tests:
bin_op: or
test_items:
@ -70,7 +70,7 @@ groups:
- id: 2.4
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 2.4"
audit: "grep -A 5 'peer-transport-security' $etcdconf | grep -E 'cert-file|key-file'"
tests:
bin_op: and
test_items:
@ -91,7 +91,7 @@ groups:
- id: 2.5
text: "Ensure that the --peer-client-cert-auth argument is set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.5"
audit: "grep -A 5 'peer-transport-security' $etcdconf | grep 'client-cert-auth'"
tests:
bin_op: or
test_items:
@ -111,7 +111,7 @@ groups:
- id: 2.6
text: "Ensure that the --peer-auto-tls argument is not set to true (Automated)"
audit: "check_for_k3s_etcd.sh 2.6"
audit: "grep 'peer-auto-tls' $etcdconf | true"
tests:
bin_op: or
test_items:
@ -132,7 +132,7 @@ groups:
- id: 2.7
text: "Ensure that a unique Certificate Authority is used for etcd (Automated)"
audit: "check_for_k3s_etcd.sh 2.7"
audit: "grep 'trusted-ca-file' $etcdconf"
tests:
test_items:
- flag: "trusted-ca-file"

@ -167,7 +167,7 @@ groups:
- id: 1.1.11
text: "Ensure that the etcd data directory permissions are set to 700 or more restrictive (Automated)"
audit: "check_for_k3s_etcd.sh 1.1.11"
audit: "stat -c %a /var/lib/rancher/k3s/server/db/etcd"
tests:
test_items:
- flag: "700"
@ -738,7 +738,7 @@ groups:
- id: 1.2.25
text: "Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Automated)"
audit: "check_for_k3s_etcd.sh 1.2.29"
audit: "journalctl -D /var/log/journal -u k3s | grep 'Running kube-apiserver' | tail -n1"
tests:
bin_op: and
test_items:

Loading…
Cancel
Save