/opa/blob/master/ADOPTERS.md [4] 这里: https://github.com/open-policy-agent/opa/blob/master/SECURITY_AUDIT.pdf [5] 这里: https://github.com/open-policy-agent/gatekeeper/blob/master/SECURITY_AUDIT.pdf [6] 评估过程: https /github.com/cncf/sig-security/tree/master/assessments/projects/opa [7] 安全漏洞披露流程: https://github.com/open-policy-agent CII最佳实践徽章: https://bestpractices.coreinfrastructure.org/en/projects/1768 [9] 治理: https://github.com/open-policy-agent /opa/blob/master/GOVERNANCE.md [10] CNCF行为准则: https://github.com/open-policy-agent/opa/blob/master/CODE_OF_CONDUCT.md
安装 OPA 二进制方式 我们可以直接从 OPA 的 release 页面下载其二进制进行使用 ➜ ~ wget -q -O ~/bin/opa https://github.com/open-policy-agent 将 OPA 嵌入为库的最简单方法是导入 github.com/open-policy-agent/opa/rego 包。 } main.go 文件 package main import ( "context" "encoding/json" "fmt" "log" "os" "github.com/open-policy-agent
安装篇 安装可以通过 kubectl 来进行: $ kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper gatekeeper-validating-webhook-configuration created 或者也可以使用 Helm(目前只支持 Helm 2): helm repo add gatekeeper https://raw.githubusercontent.com/open-policy-agent
https://github.com/open-policy-agent/gatekeeper 以下来自2019年KubeCon欧洲会议的视频是使用Gatekeeper的一个很好的开始: 简介:开放政策代理 https://github.com/open-policy-agent/frameworks/tree/master/constraint https://www.openpolicyagent.org https://github.com/open-policy-agent/gatekeeper https://openpolicyagent.slack.com/messages/CDTN970AX
使用Open Policy Agent Gatekeeper 策略控制器来实现对外部IP 的限制,具体参见:https://github.com/open-policy-agent/gatekeeper-library
以Helm为例,你可以通过Helm安装命令来部署OPA: helm repo add open-policy-agent https://open-policy-agent.github.io/kube-mgmt /charts helm install open-policy-agent/opa 这将安装OPA并将其配置为一个 Kubernetes 准入控制器。
还可以使用此处(https://github.com/open-policy-agent/gatekeeper-library/tree/master/library/general/externalip
有关如何配置此方案的更多信息,请参见 open-policy-agent / kubernetes-policy-controller(授权方案[4])。 ? 3.https://itnext.io/kubernetes-compliance-with-open-policy-agent-3d282179b1e9 4.https://github.com/open-policy-agent
root-ca cp ~/PATH/TO/k8-content-trust/notary-k8s/helm/notary/certs/root-ca.crt ~/PATH/TO/k8-content-trust/open-policy-agent /webhook=ignore 接下来我们要确认一下 values.yaml 中的 validating 和 mutating 是否已经配置(晚些时候我们会设置 mutating: true): # open-policy-agent 89cce606b29fb2xxxxx # valid deployment: # - image: GUN/<hub-id>/nginx@sha256:<your-signed-RepoDigest> 另外在 open-policy-agent 最简单的方式就是回到本地的 Helm 目录,启用 mutating,然后执行 helm upgrade: # open-policy-agent/helm/opa/values.yml ... validating 如果想要测试这个 Webhook,可以看看 open-policy-agent/tests,如果保存了前面的校验 Webhook,可以测试一下有效和无效的 Tag 或者哈希。
cruise-automation/k-rail [7] Kyverno: https://github.com/kyverno/kyverno/ [8] OPA/Gatekeeper: https://github.com/open-policy-agent 2579: https://github.com/kubernetes/enhancements/issues/2579 [10] Gatekeeper 策略库: https://github.com/open-policy-agent
直接使用下面的命令即可安装 Gatekeeper: ➜ kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper kinds: ["Namespace"] 由于约束模板或者说策略库具有一定的通用性,所以 OPA Gatekeeper 社区提供了一个通用的策略库:https://github.com/open-policy-agent
pod-security-policy/[2]淘汰和移除: https://github.com/kubernetes/kubernetes/pull/97171[3]Gatekeeper: https://github.com/open-policy-agent
kubectl apply -f https://raw.githubusercontent.com/open-policy-agent/gatekeeper/release-3.1/deploy/gatekeeper.yaml 延伸阅读 OPA/Gatekeeper GitHub 存储库:https://github.com/open-policy-agent/gatekeeper 15.
执行完后将相应的结果返回 Kubernetes 中使用 OPA Kubernetes 中使用 OPA 需要使用 Kubernetes 准入控制器,拿最新发布的 Gatekeeper(https://github.com/open-policy-agent
此处要求用户使用管理用户操作 Kubernetes,使用下面的指令部署 Gatekeeper: kubectl apply -f \ https://raw.githubusercontent.com/open-policy-agent
open-policy-agent Kubernetes Open Policy Agent(OPA)可用于强制执行各种策略,包括: 授权:OPA 可用于授权用户访问资源。