1
0
mirror of https://github.com/aquasecurity/kube-bench.git synced 2025-05-08 09:58:52 +00:00

Update federated definitions.

This commit is contained in:
Abubakr-Sadik Nii Nai Davis 2017-10-15 11:02:50 +00:00
parent 82e325f96e
commit 8e758bb5e0

View File

@ -1,6 +1,6 @@
--- ---
controls: controls:
version: 1.7 version: 1.8
id: 3 id: 3
text: "Federated Deployments" text: "Federated Deployments"
type: "federated" type: "federated"
@ -8,278 +8,320 @@ groups:
- id: 3.1 - id: 3.1
text: "Federation API Server" text: "Federation API Server"
checks: checks:
- id: 3.1.1 - id: 3.1.1
text: "Ensure that the --anonymous-auth argument is set to false (Scored)" text: "Ensure that the --anonymous-auth argument is set to false (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--anonymous-auth" - flag: "--anonymous-auth"
compare: compare:
op: eq op: eq
value: false value: false
set: true set: true
remediation: "Edit the deployment specs and set --anonymous-auth=false.\n remediation: |
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" Edit the deployment specs and set --anonymous-auth=false .
scored: true kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.2 - id: 3.1.2
text: "Ensure that the --basic-auth-file argument is not set (Scored)" text: "Ensure that the --basic-auth-file argument is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--basic-auth-file" - flag: "--basic-auth-file"
set: false set: false
remediation: "Follow the documentation and configure alternate mechanisms for authentication. remediation: |
Then, edit the deployment specs and remove \"--basic-auth-file=<filename>\".\n Follow the documentation and configure alternate mechanisms for authentication. Then,
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" edit the deployment specs and remove "--basic-auth-file=<filename>" .
scored: true kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
- id: 3.1.3 scored: true
text: "Ensure that the --insecure-allow-any-token argument is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--insecure-allow-any-token"
set: false
remediation: "Edit the deployment specs and remove --insecure-allow-any-token.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.4
text: "Ensure that the --insecure-bind-address argument is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--insecure-bind-address"
set: false
remediation: "Edit the deployment specs and remove --insecure-bind-address.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.5 - id: 3.1.3
text: "Ensure that the --insecure-port argument is set to 0 (Scored)" text: "Ensure that the --insecure-allow-any-token argument is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--insecure-port" - flag: "--insecure-allow-any-token"
compare: set: false
op: eq remediation: |
value: 0 Edit the deployment specs and remove --insecure-allow-any-token .
set: true kubectl edit deployments federation-apiserver-deployment --
remediation: "Edit the deployment specs and set --insecure-port=0.\n namespace=federation-system
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" scored: true
scored: true
- id: 3.1.6 - id: 3.1.4
text: "Ensure that the --secure-port argument is not set to 0 (Scored)" text: "Ensure that the --insecure-bind-address argument is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
bin_op: or test_items:
test_items: - flag: "--insecure-bind-address"
- flag: "--secure-port" set: false
compare: remediation: |
op: gt Edit the deployment specs and remove --insecure-bind-address .
value: 0 kubectl edit deployments federation-apiserver-deployment --
set: true namespace=federation-system
- flag: "--secure-port" scored: true
set: false
remediation: "Edit the deployment specs and set the --secure-port argument to the desired port.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.7 - id: 3.1.5
text: "Ensure that the --profiling argument is set to false (Scored)" text: "Ensure that the --insecure-port argument is set to 0 (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--profiling" - flag: "--insecure-port"
compare: compare:
op: eq op: eq
value: false value: 0
set: true set: true
remediation: "Edit the deployment specs and set \"--profiling=false\".\n remediation: |
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" Edit the deployment specs and set --insecure-port=0 .
score: true kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.8 - id: 3.1.6
text: "Ensure that the admission control policy is not set to AlwaysAdmit (Scored)" text: "Ensure that the --secure-port argument is not set to 0 (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: bin_op: or
- flag: "--admission-control" test_items:
compare: - flag: "--secure-port"
op: nothave compare:
value: AlwaysAdmit op: gt
set: true value: 0
remediation: "Edit the deployment specs and set --admission-control argument to a value that does set: true
not include AlwaysAdmit.\n - flag: "--secure-port"
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" set: false
scored: true remediation: |
Edit the deployment specs and set the --secure-port argument to the desired port.
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.9 - id: 3.1.7
text: "Ensure that the admission control policy is set to NamespaceLifecycle (Scored)" text: "Ensure that the --profiling argument is set to false (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "admission-control" - flag: "--profiling"
compare: compare:
op: has op: eq
value: "NamespaceLifecycle" value: false
set: true set: true
remediation: "Edit the deployment specs and set --admission-control argument to a value that includes NamespaceLifecycle.\n remediation: |
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" Edit the deployment specs and set "--profiling=false" :
scored: true kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
score: true
- id: 3.1.10 - id: 3.1.8
text: "Ensure that the --audit-log-path argument is set as appropriate (Scored)" text: "Ensure that the admission control policy is not set to AlwaysAdmit (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--audit-log-path" - flag: "--admission-control"
set: true compare:
remediation: "Edit the deployment specs and set --audit-log-path argument as appropriate.\n op: nothave
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" value: AlwaysAdmit
scored: true set: true
remediation: |
- id: 3.1.11 Edit the deployment specs and set --admission-control argument to a value that does not
text: "Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Scored)" include AlwaysAdmit .
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" kubectl edit deployments federation-apiserver-deployment --
tests: namespace=federation-system
test_items: scored: true
- flag: "--audit-log-maxage"
compare:
op: gte
value: 30
set: true
remediation: "Edit the deployment specs and set --audit-log-maxage to 30 or as appropriate.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.12
text: "Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--audit-log-maxbackup"
compare:
op: gte
value: 10
set: true
remediation: "Edit the deployment specs and set --audit-log-maxbackup to 10 or as appropriate.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.13 - id: 3.1.9
text: "Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Scored)" text: "Ensure that the admission control policy is set to NamespaceLifecycle (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--audit-log-maxsize" - flag: "admission-control"
compare: compare:
op: gte op: has
value: 100 value: "NamespaceLifecycle"
set: true set: true
remediation: "Edit the deployment specs and set --audit-log-maxsize=100 to 100 or as appropriate.\n remediation: |
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" Edit the deployment specs and set --admission-control argument to a value that includes
scored: true NamespaceLifecycle .
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.14 - id: 3.1.10
text: "Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored)" text: "Ensure that the --audit-log-path argument is set as appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--authorization-mode" - flag: "--audit-log-path"
compare: set: true
op: nothave remediation: "Edit the deployment specs and set --audit-log-path argument as appropriate.\n
value: "AlwaysAllow" kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
set: true scored: true
remediation: "Edit the deployment specs and set --authorization-mode argument to a value other than AlwaysAllow.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.15
text: "Ensure that the --token-auth-file parameter is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--token-auth-file"
set: false
remediation: "Follow the documentation and configure alternate mechanisms for authentication.
Then, edit the deployment specs and remove the --token-auth-file=<filename> argument.\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.16
text: "Ensure that the --service-account-lookup argument is set to true (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--service-account-lookup"
compare:
op: eq
value: true
set: true
remediation: "Edit the deployment specs and set \"--service-account-lookup=true\".\n
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system"
scored: true
- id: 3.1.17 - id: 3.1.11
text: "Ensure that the --service-account-key-file argument is set as appropriate (Scored)" text: "Ensure that the --audit-log-maxage argument is set to 30 or as appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--service-account-key-file" - flag: "--audit-log-maxage"
set: true compare:
remediation: "Edit the deployment specs and set --service-account-key-file argument as appropriate.\n op: gte
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" value: 30
scored: true set: true
remediation: |
Edit the deployment specs and set --audit-log-maxage to 30 or as appropriate.
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.12
text: "Ensure that the --audit-log-maxbackup argument is set to 10 or as appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--audit-log-maxbackup"
compare:
op: gte
value: 10
set: true
remediation: |
Edit the deployment specs and set --audit-log-maxbackup to 10 or as appropriate.
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.18 - id: 3.1.13
text: "Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as appropriate (Scored" text: "Ensure that the --audit-log-maxsize argument is set to 100 or as appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
bin_op: and test_items:
test_items: - flag: "--audit-log-maxsize"
- flag: "--etcd-certfile" compare:
set: true op: gte
- flag: "--etcd-keyfile" value: 100
set: true set: true
remediation: "Follow the Kubernetes documentation and set up the TLS connection between the remediation: |
federation apiserver and etcd. Then, edit the deployment specs and set \"--etcd- Edit the deployment specs and set --audit-log-maxsize=100 to 100 or as appropriate.
certfile=<path/to/client-certificate-file>\" and \"--etcd- kubectl edit deployments federation-apiserver-deployment --
keyfile=<path/to/client-key-file>\" arguments.\n namespace=federation-system
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" scored: true
scored: true
- id: 3.1.19 - id: 3.1.14
text: "Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as appropriate (Scored)" text: "Ensure that the --authorization-mode argument is not set to AlwaysAllow (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep" audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests: tests:
bin_op: and test_items:
test_items: - flag: "--authorization-mode"
- flag: "--tls-cert-file" compare:
set: true op: nothave
- flag: "--tls-private-key-file" value: "AlwaysAllow"
set: true set: true
remediation: "Follow the Kubernetes documentation and set up the TLS connection on the federation remediation: |
apiserver. Then, edit the deployment specs and set \"--tls-cert-file=<path/to/tls- Edit the deployment specs and set --authorization-mode argument to a value other than
certificate-file>\" and \"--tls-private-key-file=<path/to/tls-key-file>\" : AlwaysAllow
kubectl edit deployments federation-apiserver-deployment --namespace=federation-system" kubectl edit deployments federation-apiserver-deployment --
scored: true namespace=federation-system
scored: true
- id: 3.1.15
text: "Ensure that the --token-auth-file parameter is not set (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--token-auth-file"
set: false
remediation: |
Follow the documentation and configure alternate mechanisms for authentication. Then,
edit the deployment specs and remove the --token-auth-file=<filename> argument.
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.16
text: "Ensure that the --service-account-lookup argument is set to true (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--service-account-lookup"
compare:
op: eq
value: true
set: true
remediation: |
Edit the deployment specs and set "--service-account-lookup=true" .
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.17
text: "Ensure that the --service-account-key-file argument is set as appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
test_items:
- flag: "--service-account-key-file"
set: true
remediation: |
Edit the deployment specs and set --service-account-key-file argument as appropriate.
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.18
text: "Ensure that the --etcd-certfile and --etcd-keyfile arguments are set as
appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
bin_op: and
test_items:
- flag: "--etcd-certfile"
set: true
- flag: "--etcd-keyfile"
set: true
remediation: |
Follow the Kubernetes documentation and set up the TLS connection between the
federation apiserver and etcd. Then, edit the deployment specs and set "--etcd-
certfile=<path/to/client-certificate-file>" and "--etcd-
keyfile=<path/to/client-key-file>" arguments.
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.1.19
text: "Ensure that the --tls-cert-file and --tls-private-key-file arguments are set as
appropriate (Scored)"
audit: "ps -ef | grep $fedapiserverbin | grep -v grep"
tests:
bin_op: and
test_items:
- flag: "--tls-cert-file"
set: true
- flag: "--tls-private-key-file"
set: true
remediation: |
Follow the Kubernetes documentation and set up the TLS connection on the federation
apiserver. Then, edit the deployment specs and set "--tls-cert-file=<path/to/tls-
certificate-file>" and "--tls-private-key-file=<path/to/tls-key-file>" :
kubectl edit deployments federation-apiserver-deployment --
namespace=federation-system
scored: true
- id: 3.2 - id: 3.2
text: "Federation Controller Manager" text: "Federation Controller Manager"
checks: checks:
- id: 3.2.1 - id: 3.2.1
text: "Ensure that the --profiling argument is set to false (Scored)" text: "Ensure that the --profiling argument is set to false (Scored)"
audit: "ps -ef | grep $fedcontrollermanagerbin | grep -v grep" audit: "ps -ef | grep $fedcontrollermanagerbin | grep -v grep"
tests: tests:
test_items: test_items:
- flag: "--profiling" - flag: "--profiling"
compare: compare:
op: eq op: eq
value: false value: false
set: true set: true
remediation: "Edit the deployment specs and set \"--profiling=false\".\n remediation: |
kubectl edit deployments federation-controller-manager-deployment --namespace=federation-system" Edit the deployment specs and set "--profiling=false" :
scored: true kubectl edit deployments federation-controller-manager-deployment --
namespace=federation-system
scored: true