Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ocp4/etcd: Fix rule checks for 4.8 #6732

Merged
merged 1 commit into from Mar 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions applications/openshift/etcd/etcd_cert_file/rule.yml
Expand Up @@ -5,11 +5,14 @@ prodtype: ocp4
title: 'Ensure That The etcd Client Certificate Is Correctly Set'

description: |-
To ensure the <tt>etcd</tt> service is serving TLS to clients,
make sure the <tt>etcd-pod*</tt> <tt>ConfigMaps</tt> in the
To ensure the etcd service is serving TLS to clients,
make sure the <tt>etcd-pod*</tt> ConfigMaps in the
<tt>openshift-etcd</tt> namespace contain the following argument
for the <tt>etcd</tt> binary in the <tt>etcd</tt> pod:
<pre>--cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-serving/etcd-serving-NODE_NAME.crt</pre>
<pre>--cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-serving-NODE_NAME.crt</pre>.

Note that the <pre>[a-z]+</pre> is being used since the directory might
change between OpenShift versions.

rationale: |-
Without cryptographic integrity protections, information can be
Expand All @@ -27,7 +30,7 @@ ocil_clause: 'the etcd client certificate is not configured'

ocil: |-
Run the following command:
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-serving/etcd-serving-NODE_NAME.crt"</pre>
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep -E "\-\-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-serving-NODE_NAME.crt"</pre>
Verify that there is a certificate configured.

warnings:
Expand All @@ -41,5 +44,5 @@ template:
filepath: /api/v1/namespaces/openshift-etcd/configmaps/etcd-pod
yamlpath: ".data['pod.yaml']"
values:
- value: ".*--cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-serving/etcd-serving-NODE_NAME.crt \\.*"
- value: ".*--cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-serving-NODE_NAME.crt \\.*"
operation: "pattern match"
15 changes: 9 additions & 6 deletions applications/openshift/etcd/etcd_key_file/rule.yml
Expand Up @@ -5,11 +5,14 @@ prodtype: ocp4
title: 'Ensure That The etcd Key File Is Correctly Set'

description: |-
To ensure the <tt>etcd</tt> service is serving TLS to clients,
make sure the <tt>etcd-pod*</tt> <tt>ConfigMaps</tt> in the
To ensure the etcd service is serving TLS to clients,
make sure the <tt>etcd-pod*</tt> ConfigMaps in the
<tt>openshift-etcd</tt> namespace contain the following argument
for the <tt>etcd</tt> binary in the <tt>etcd</tt> pod:
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-serving/etcd-serving-NODE_NAME.key"</pre>
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-serving-NODE_NAME.key"</pre>.

Note that the <pre>[a-z]+</pre> is being used since the directory might
change between OpenShift versions.

rationale: |-
Without cryptographic integrity protections, information can be
Expand All @@ -27,7 +30,7 @@ ocil_clause: 'the etcd client key file is not configured'

ocil: |-
Run the following command:
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-serving/etcd-serving-NODE_NAME.key"</pre>
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-serving-NODE_NAME.key"</pre>
Verify that there is a private key configured.

warnings:
Expand All @@ -41,5 +44,5 @@ template:
filepath: /api/v1/namespaces/openshift-etcd/configmaps/etcd-pod
yamlpath: ".data['pod.yaml']"
values:
- value: ".*--key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-serving/etcd-serving-NODE_NAME.key \\.*"
operation: "pattern match"
- value: ".*--key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-serving-NODE_NAME.key \\.*"
operation: "pattern match"
13 changes: 8 additions & 5 deletions applications/openshift/etcd/etcd_peer_cert_file/rule.yml
Expand Up @@ -5,11 +5,14 @@ prodtype: ocp4
title: 'Ensure That The etcd Peer Client Certificate Is Correctly Set'

description: |-
To ensure the <tt>etcd</tt> service is serving TLS to peers,
make sure the <tt>etcd-pod*</tt> <tt>ConfigMaps</tt> in the
To ensure the etcd service is serving TLS to peers,
make sure the <tt>etcd-pod*</tt> ConfigMaps in the
<tt>openshift-etcd</tt> namespace contain the following argument
for the <tt>etcd</tt> binary in the <tt>etcd</tt> pod:
<pre>--peer-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-peer/etcd-peer-NODE_NAME.crt</pre>
<pre>--peer-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-peer-NODE_NAME.crt</pre>

Note that the <pre>[a-z]+</pre> is being used since the directory might
change between OpenShift versions.

rationale: |-
Without cryptographic integrity protections, information can be
Expand All @@ -28,7 +31,7 @@ ocil_clause: 'the etcd peer client certificate is not configured'

ocil: |-
Run the following command:
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-peer-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-peer/etcd-peer-NODE_NAME.crt"</pre>
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-peer-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-peer-NODE_NAME.crt"</pre>
Verify that there is a certificate configured.

warnings:
Expand All @@ -42,5 +45,5 @@ template:
filepath: /api/v1/namespaces/openshift-etcd/configmaps/etcd-pod
yamlpath: ".data['pod.yaml']"
values:
- value: ".*--peer-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-peer/etcd-peer-NODE_NAME.crt \\.*"
- value: ".*--peer-cert-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-peer-NODE_NAME.crt \\.*"
operation: "pattern match"
13 changes: 8 additions & 5 deletions applications/openshift/etcd/etcd_peer_key_file/rule.yml
Expand Up @@ -5,11 +5,14 @@ prodtype: ocp4
title: 'Ensure That The etcd Peer Key File Is Correctly Set'

description: |-
To ensure the <tt>etcd</tt> service is serving TLS to peers,
make sure the <tt>etcd-pod*</tt> <tt>ConfigMaps</tt> in the
To ensure the etcd service is serving TLS to peers,
make sure the <tt>etcd-pod*</tt> ConfigMaps in the
<tt>openshift-etcd</tt> namespace contain the following argument
for the <tt>etcd</tt> binary in the <tt>etcd</tt> pod:
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-peer-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-peer/etcd-peer-NODE_NAME.key"</pre>
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-peer-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-peer-NODE_NAME.key"</pre>

Note that the <pre>[a-z]+</pre> is being used since the directory might
change between OpenShift versions.

rationale: |-
Without cryptographic integrity protections, information can be
Expand All @@ -28,7 +31,7 @@ ocil_clause: 'the etcd peer client key file is not configured'

ocil: |-
Run the following command:
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-peer-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-peer/etcd-peer-NODE_NAME.key"</pre>
<pre>oc get -nopenshift-etcd cm etcd-pod -oyaml | grep "\-\-peer-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-peer-NODE_NAME.key"</pre>
Verify that there is a private key configured.

warnings:
Expand All @@ -42,5 +45,5 @@ template:
filepath: /api/v1/namespaces/openshift-etcd/configmaps/etcd-pod
yamlpath: ".data['pod.yaml']"
values:
- value: ".*--peer-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-peer/etcd-peer-NODE_NAME.key \\.*"
- value: ".*--peer-key-file=/etc/kubernetes/static-pod-certs/secrets/etcd-all-[a-z]+/etcd-peer-NODE_NAME.key \\.*"
operation: "pattern match"