2.8.3.2. 启用完整性 shield 保护
通过完成以下步骤,在 Red Hat Advanced Cluster Management 受管集群中启用完整性 shield:
为完整性 shield 在 hub 集群上创建一个命名空间。运行以下命令:
oc create ns your-integrity-shield-ns
oc create ns your-integrity-shield-nsCopy to Clipboard Copied! Toggle word wrap Toggle overflow 在 Red Hat Advanced Cluster Management 受管集群中部署验证密钥。提醒,您必须创建签名和验证密钥。在 hub 集群上运行
acm-verification-key-setup.sh来设置验证密钥。运行以下命令:curl -s https://raw.githubusercontent.com/stolostron/integrity-shield/master/scripts/ACM/acm-verification-key-setup.sh | bash -s \ --namespace integrity-shield-operator-system \ --secret keyring-secret \ --path /tmp/pubring.gpg \ --label environment=dev | oc apply -f -curl -s https://raw.githubusercontent.com/stolostron/integrity-shield/master/scripts/ACM/acm-verification-key-setup.sh | bash -s \ --namespace integrity-shield-operator-system \ --secret keyring-secret \ --path /tmp/pubring.gpg \ --label environment=dev | oc apply -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow 要删除验证密钥,请运行以下命令:
curl -s https://raw.githubusercontent.com/stolostron/integrity-shield/master/scripts/ACM/acm-verification-key-setup.sh | bash -s - \ --namespace integrity-shield-operator-system \ --secret keyring-secret \ --path /tmp/pubring.gpg \ --label environment=dev | oc delete -f -curl -s https://raw.githubusercontent.com/stolostron/integrity-shield/master/scripts/ACM/acm-verification-key-setup.sh | bash -s - \ --namespace integrity-shield-operator-system \ --secret keyring-secret \ --path /tmp/pubring.gpg \ --label environment=dev | oc delete -f -Copy to Clipboard Copied! Toggle word wrap Toggle overflow 在 hub 集群中创建一个名为
policy-integrity-shield的 Red Hat Advanced Cluster Management 策略。- 
										从 
policy-collection存储库检索policy-integrity-shield策略。确定 fork 了 存储库。 - 
										通过更新 
remediationAction参数值(从inform到enforce),将命名空间配置为在 Red Hat Advanced Cluster Management 受管集群上部署完整性 shield。 - 
										通过更新 
signerConfig部分,为签名者和验证密钥配置电子邮件。 - 
										配置 
PlacementRule,它决定了应该部署完整性的 Red Hat Advanced Cluster Management 受管集群。 运行以下命令,签署
policy-integrity-shield.yaml:curl -s https://raw.githubusercontent.com/stolostron/integrity-shield/master/scripts/gpg-annotation-sign.sh | bash -s \ signer@enterprise.com \ policy-integrity-shield.yamlcurl -s https://raw.githubusercontent.com/stolostron/integrity-shield/master/scripts/gpg-annotation-sign.sh | bash -s \ signer@enterprise.com \ policy-integrity-shield.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow 注 :每当您更改策略并应用到其他集群时,您必须创建新的签名。否则,更改会被阻止且不应用。
- 
										从 
 
						如需示例,请参阅 policy-integrity-shield 策略。