|
|
|
@ -10,17 +10,15 @@ groups:
|
|
|
|
|
checks:
|
|
|
|
|
- id: 2.1
|
|
|
|
|
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate if use etcd as database (Automated)"
|
|
|
|
|
audit: grep -E 'cert-file|key-file' $etcdconf
|
|
|
|
|
audit: grep -A 4 'client-transport-security' $etcdconf | grep -E 'cert-file|key-file'
|
|
|
|
|
tests:
|
|
|
|
|
bin_op: and
|
|
|
|
|
test_items:
|
|
|
|
|
- flag: "--cert-file"
|
|
|
|
|
env: "ETCD_CERT_FILE"
|
|
|
|
|
- flag: "--key-file"
|
|
|
|
|
env: "ETCD_KEY_FILE"
|
|
|
|
|
- flag: "cert-file"
|
|
|
|
|
- flag: "key-file"
|
|
|
|
|
remediation: |
|
|
|
|
|
By default, K3s uses a config file for etcd that can be found at $etcdconf.
|
|
|
|
|
Server and peer cert and key files are specified. No manual remediation needed.
|
|
|
|
|
The config file contains client-transport-security: which has fields that have the peer cert and peer key files. No manual remediation needed.
|
|
|
|
|
scored: true
|
|
|
|
|
|
|
|
|
|
- id: 2.2
|
|
|
|
@ -28,8 +26,7 @@ groups:
|
|
|
|
|
audit: grep 'client-cert-auth' $etcdconf
|
|
|
|
|
tests:
|
|
|
|
|
test_items:
|
|
|
|
|
- flag: "--client-cert-auth"
|
|
|
|
|
env: "ETCD_CLIENT_CERT_AUTH"
|
|
|
|
|
- flag: "client-cert-auth"
|
|
|
|
|
compare:
|
|
|
|
|
op: eq
|
|
|
|
|
value: true
|
|
|
|
@ -40,15 +37,13 @@ groups:
|
|
|
|
|
|
|
|
|
|
- id: 2.3
|
|
|
|
|
text: "Ensure that the --auto-tls argument is not set to true (Automated)"
|
|
|
|
|
audit: grep 'auto-tls' $etcdconf
|
|
|
|
|
audit: grep 'auto-tls' $etcdconf | cat
|
|
|
|
|
tests:
|
|
|
|
|
bin_op: or
|
|
|
|
|
test_items:
|
|
|
|
|
- flag: "--auto-tls"
|
|
|
|
|
env: "ETCD_AUTO_TLS"
|
|
|
|
|
- flag: "auto-tls"
|
|
|
|
|
set: false
|
|
|
|
|
- flag: "--auto-tls"
|
|
|
|
|
env: "ETCD_AUTO_TLS"
|
|
|
|
|
- flag: "auto-tls"
|
|
|
|
|
compare:
|
|
|
|
|
op: eq
|
|
|
|
|
value: false
|
|
|
|
@ -59,14 +54,12 @@ groups:
|
|
|
|
|
- id: 2.4
|
|
|
|
|
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are
|
|
|
|
|
set as appropriate (Automated)"
|
|
|
|
|
audit: grep -A 5 'peer-transport-security' $etcdconf | grep -E 'cert-file|key-file'
|
|
|
|
|
audit: grep -A 4 'peer-transport-security' $etcdconf | grep -E 'cert-file|key-file'
|
|
|
|
|
tests:
|
|
|
|
|
bin_op: and
|
|
|
|
|
test_items:
|
|
|
|
|
- flag: "--peer-cert-file"
|
|
|
|
|
env: "ETCD_PEER_CERT_FILE"
|
|
|
|
|
- flag: "--peer-key-file"
|
|
|
|
|
env: "ETCD_PEER_KEY_FILE"
|
|
|
|
|
- flag: "cert-file"
|
|
|
|
|
- flag: "key-file"
|
|
|
|
|
remediation: |
|
|
|
|
|
By default, K3s starts Etcd with a config file found here, $etcdconf.
|
|
|
|
|
The config file contains peer-transport-security: which has fields that have the peer cert and peer key files.
|
|
|
|
@ -74,30 +67,27 @@ groups:
|
|
|
|
|
|
|
|
|
|
- id: 2.5
|
|
|
|
|
text: "Ensure that the --peer-client-cert-auth argument is set to true (Automated)"
|
|
|
|
|
audit: grep 'client-cert-auth' $etcdconf
|
|
|
|
|
audit: grep -A 4 'peer-transport-security' $etcdconf | grep 'client-cert-auth'
|
|
|
|
|
tests:
|
|
|
|
|
test_items:
|
|
|
|
|
- flag: "--peer-client-cert-auth"
|
|
|
|
|
env: "ETCD_PEER_CLIENT_CERT_AUTH"
|
|
|
|
|
- flag: "client-cert-auth"
|
|
|
|
|
compare:
|
|
|
|
|
op: eq
|
|
|
|
|
value: true
|
|
|
|
|
remediation: |
|
|
|
|
|
By default, K3s uses a config file for etcd that can be found at $etcdconf.
|
|
|
|
|
Within the file, the client-cert-auth field is set. No manual remediation needed.
|
|
|
|
|
The config file contains peer-transport-security: which has client-cert-auth set to true. No manual remediation needed.
|
|
|
|
|
scored: true
|
|
|
|
|
|
|
|
|
|
- id: 2.6
|
|
|
|
|
text: "Ensure that the --peer-auto-tls argument is not set to true (Automated)"
|
|
|
|
|
audit: grep 'peer-auto-tls' $etcdconf
|
|
|
|
|
audit: grep 'peer-auto-tls' $etcdconf | cat
|
|
|
|
|
tests:
|
|
|
|
|
bin_op: or
|
|
|
|
|
test_items:
|
|
|
|
|
- flag: "--peer-auto-tls"
|
|
|
|
|
env: "ETCD_PEER_AUTO_TLS"
|
|
|
|
|
- flag: "peer-auto-tls"
|
|
|
|
|
set: false
|
|
|
|
|
- flag: "--peer-auto-tls"
|
|
|
|
|
env: "ETCD_PEER_AUTO_TLS"
|
|
|
|
|
- flag: "peer-auto-tls"
|
|
|
|
|
compare:
|
|
|
|
|
op: eq
|
|
|
|
|
value: false
|
|
|
|
|