-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8fc376
commit dc963f5
Showing
7 changed files
with
1,928 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
--- | ||
## Version-specific settings that override the values in cfg/config.yaml | ||
master: | ||
apiserver: | ||
confs: | ||
- /var/snap/k8s/common/args/kube-apiserver | ||
bins: | ||
- kube-apiserver | ||
scheduler: | ||
confs: | ||
- /var/snap/k8s/common/args/kube-scheduler | ||
kubeconfig: | ||
- /etc/kubernetes/scheduler.conf | ||
bins: | ||
- kube-scheduler | ||
controllermanager: | ||
confs: | ||
- /var/snap/k8s/common/args/kube-controller-manager | ||
bins: | ||
- kube-controller-manager | ||
kubeconfig: | ||
- /etc/kubernetes/controller.conf | ||
etcd: | ||
confs: | ||
- /var/snap/k8s/common/args/k8s-dqlite | ||
bins: | ||
- k8s-dqlite | ||
|
||
etcd: | ||
components: | ||
- etcd | ||
|
||
etcd: | ||
bins: | ||
- "k8s-dqlite" | ||
confs: | ||
- /var/snap/microk8s/common/args/k8s-dqlite | ||
defaultconf: /var/snap/microk8s/common/args/k8s-dqlite | ||
defaultdatadir: /var/snap/k8s/common/var/lib/k8s-dqlite | ||
|
||
node: | ||
kubelet: | ||
cafile: | ||
- "/etc/kubernetes/pki/client-ca.crt" | ||
svc: | ||
- "/etc/systemd/system/snap.k8s.kubelet.service" | ||
bins: | ||
- "bin/kubelet" | ||
confs: | ||
- "/var/snap/k8s/common/args/kubelet" | ||
kubeconfig: | ||
- "/etc/kubernetes/kubelet.conf" | ||
proxy: | ||
confs: | ||
- /var/snap/k8s/common/args/kube-proxy | ||
kubeconfig: | ||
- /etc/kubernetes/proxy.conf | ||
svc: | ||
- "/etc/systemd/system/snap.k8s.kube-proxy.service" | ||
|
||
controlplane: | ||
apiserver: | ||
confs: | ||
- /var/snap/k8s/common/args/kube-apiserver |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
--- | ||
controls: | ||
version: "cis-1.24" | ||
id: 3 | ||
text: "Control Plane Configuration" | ||
type: "controlplane" | ||
groups: | ||
- id: 3.1 | ||
text: "Authentication and Authorization" | ||
checks: | ||
- id: 3.1.1 | ||
text: "Client certificate authentication should not be used for users (Manual)" | ||
type: "manual" | ||
remediation: | | ||
Alternative mechanisms provided by Kubernetes such as the use of OIDC should be | ||
implemented in place of client certificates. | ||
scored: false | ||
|
||
- id: 3.2 | ||
text: "Logging" | ||
checks: | ||
- id: 3.2.1 | ||
text: "Ensure that a minimal audit policy is created (Manual)" | ||
audit: "/bin/ps -ef | grep $apiserverbin | grep -v grep" | ||
tests: | ||
test_items: | ||
- flag: "--audit-policy-file" | ||
set: true | ||
remediation: | | ||
Create an audit policy file for your cluster. | ||
scored: false | ||
|
||
- id: 3.2.2 | ||
text: "Ensure that the audit policy covers key security concerns (Manual)" | ||
type: "manual" | ||
remediation: | | ||
Review the audit policy provided for the cluster and ensure that it covers | ||
at least the following areas, | ||
- Access to Secrets managed by the cluster. Care should be taken to only | ||
log Metadata for requests to Secrets, ConfigMaps, and TokenReviews, in | ||
order to avoid risk of logging sensitive data. | ||
- Modification of Pod and Deployment objects. | ||
- Use of `pods/exec`, `pods/portforward`, `pods/proxy` and `services/proxy`. | ||
For most requests, minimally logging at the Metadata level is recommended | ||
(the most basic level of logging). | ||
scored: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
--- | ||
controls: | ||
version: "cis-1.24" | ||
id: 2 | ||
text: "Datastore Node Configuration" | ||
type: "etcd" | ||
groups: | ||
- id: 2 | ||
text: "Datastore Node Configuration" | ||
checks: | ||
- id: 2.1 | ||
text: "Ensure that the --cert-file and --key-file arguments are set as appropriate (Automated)" | ||
tests: | ||
test_items: | ||
- flag: "--not-applicable" | ||
set: false | ||
remediation: | | ||
Not applicable. Canonical K8s uses dqlite and the communication to this service is done through a | ||
local socket (/var/snap/k8s/common/var/lib/k8s-dqlite/k8s-dqlite.sock) accessible to users with root permissions. | ||
scored: true | ||
|
||
- id: 2.2 | ||
text: "Ensure that the --client-cert-auth argument is set to true (Automated)" | ||
tests: | ||
test_items: | ||
- flag: "--not-applicable" | ||
set: false | ||
remediation: | | ||
Not applicable. Canonical K8s uses dqlite and the communication to this service is done through a | ||
local socket (/var/snap/k8s/common/var/lib/k8s-dqlite/k8s-dqlite.sock) accessible to users with root permissions. | ||
scored: true | ||
|
||
- id: 2.3 | ||
text: "Ensure that the --auto-tls argument is not set to true (Automated)" | ||
tests: | ||
test_items: | ||
- flag: "--not-applicable" | ||
set: false | ||
remediation: | | ||
Not applicable. Canonical K8s uses dqlite and the communication to this service is done through a | ||
local socket (/var/snap/k8s/common/var/lib/k8s-dqlite/k8s-dqlite.sock) accessible to users with root permissions. | ||
scored: true | ||
|
||
- id: 2.4 | ||
text: "Ensure that the --peer-cert-file and --peer-key-file arguments are set as appropriate (Automated)" | ||
audit: "if test -e /var/snap/k8s/common/var/lib/k8s-dqlite/cluster.crt && test -e /var/snap/k8s/common/var/lib/k8s-dqlite/cluster.key; then echo 'certs-found'; fi" | ||
tests: | ||
test_items: | ||
- flag: "certs-found" | ||
remediation: | | ||
The certificate pair for dqlite and tls peer communication is | ||
/var/snap/k8s/common/var/lib/k8s-dqlite/cluster.crt and | ||
/var/snap/k8s/common/var/lib/k8s-dqlite/cluster.key. | ||
scored: true | ||
|
||
- id: 2.5 | ||
text: "Ensure that the --peer-client-cert-auth argument is set to true (Automated)" | ||
audit: "/bin/cat $etcdconf | /bin/grep enable-tls || true; echo $?" | ||
tests: | ||
bin_op: or | ||
test_items: | ||
- flag: "--enable-tls" | ||
compare: | ||
op: eq | ||
value: true | ||
- flag: "--enable-tls" | ||
set: false | ||
remediation: | | ||
Dqlite peer communication uses TLS unless the --enable-tls is set to false in | ||
/var/snap/k8s/common/args/k8s-dqlite. | ||
scored: true | ||
|
||
- id: 2.6 | ||
text: "Ensure that the --peer-auto-tls argument is not set to true (Automated)" | ||
tests: | ||
test_items: | ||
- flag: "--not-applicable" | ||
set: false | ||
remediation: | | ||
Not applicable. Canonical K8s uses dqlite and tls peer communication uses the certificates | ||
created upon the snap creation. | ||
scored: false | ||
|
||
- id: 2.7 | ||
text: "Ensure that a unique Certificate Authority is used for the datastore (Manual)" | ||
tests: | ||
test_items: | ||
- flag: "--not-applicable" | ||
set: false | ||
remediation: | | ||
Not applicable. Canonical K8s uses dqlite and tls peer communication uses certificates | ||
created upon cluster setup. | ||
scored: true |
Oops, something went wrong.