Skip to content

Commit

Permalink
Merge pull request #6411 from JAORMX/etcd-encryption-rem
Browse files Browse the repository at this point in the history
ocp4: Add automatic remediation for etcd encryption provider
  • Loading branch information
JAORMX committed Dec 2, 2020
2 parents a1d4167 + 7b5809d commit fe161d1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# platform = multi_platform_ocp
apiVersion: config.openshift.io/v1
kind: APIServer
metadata:
name: cluster
spec:
encryption:
type: aescbc
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
#!/bin/bash
#
# This applies the remediation needed for this rule. Which enables etcd encryption
# This rule wasn't able to be done via a standard remediation since we only need to
# apply a partial part of the Kubernetes object. PATCH support for the
# compliance-operator would be needed to make this work
# This waits for etcd encryption to be enabled. The operator can apply the
# remediation, but waiting for this to get applied is still something that
# needs to be done outside of the operator.
#
# This patch sets the encryption setting and waits for it to be applied

oc patch apiservers cluster -p '{"spec":{"encryption":{"type":"aescbc"}}}' --type=merge

while true; do
status=$(oc get openshiftapiserver -o=jsonpath='{range .items[0].status.conditions[?(@.type=="Encrypted")]}{.reason}')

Expand All @@ -20,4 +17,4 @@ while true; do
fi

sleep 5
done
done

0 comments on commit fe161d1

Please sign in to comment.