opa README

The project's README from github.com/open-policy-agent/opa. As one markdown file: README.md.

logo Open Policy Agent

Build Status CII Best Practices Netlify Status

Open Policy Agent (OPA) is an open source, general-purpose policy engine that enables unified, context-aware policy enforcement across the entire stack.

OPA is proud to be a graduated project in the Cloud Native Computing Foundation (CNCF) landscape. For details read the CNCF announcement.

Get started with OPA

Want to talk about OPA or get support?

Interested to learn what others are doing with OPA?

Want to integrate OPA?

Want to contribute to OPA?

How does OPA work?

OPA gives you a high-level declarative language to author and enforce policies across your stack.

With OPA, you define rules that govern how your system should behave. These rules exist to answer questions like:

You integrate services with OPA so that these kinds of policy decisions do not have to be hardcoded in your service. Services integrate with OPA by executing queries when policy decisions are needed.

When you query OPA for a policy decision, OPA evaluates the rules and data (which you give it) to produce an answer. The policy decision is sent back as the result of the query.

For example, in a simple API authorization use case:

For concrete examples of how to integrate OPA with systems like Kubernetes, Terraform, Docker, SSH, and more, see openpolicyagent.org.

Presentations

Security

A third party security audit was performed by Cure53, you can see the full report here.

Please report vulnerabilities by email to open-policy-agent-security. We will send a confirmation message to acknowledge that we have received the report and then we will send additional messages to follow up once the issue has been investigated.

opa (open-policy-agent/opa)

Searching Database…

12.4K ·GitHub
这是什么?OPA(Open Policy Agent)是一个开源的通用策略引擎,可以通过名为 Rego 的声明式策略语言,在整个技术栈中一致地执行策略,例如“用户 X 能否对资源 Z 执行操作 Y?”。
它是我要嵌入的库,还是我要查询的独立服务?两者都可以:你可以把 OPA 作为独立的 CLI/服务器运行,让你的服务通过 REST API 进行查询;如果你的服务是用 Go 编写的,也可以通过 Go SDK/API 直接嵌入。
我该如何开始使用 OPA?你可以在 Rego Playground 中直接在浏览器里试用 Rego,安装 VS Code 扩展进行本地编辑,或按照“Running OPA”文档运行 CLI;容器镜像可以在 Docker Hub 获取,二进制文件可以在 GitHub Releases 下载。
我需要自己编写规则,还是它自带内置策略?规则需要你自己用 Rego 编写,并提供数据;OPA 开箱即用时并不包含任何内置的策略逻辑。
集成时可能会遇到哪些坑?OPA 不会自动强制执行任何策略——你的服务必须修改为查询 OPA,并根据其返回的允许或拒绝决定采取行动,这意味着你需要为每个系统(Kubernetes、Terraform、Docker、SSH 等)自行完成集成工作。
通常谁会用它?主要是平台工程师和安全工程师,用于在云原生系统中构建授权与合规控制;它是 CNCF 毕业项目,已被许多组织用于生产环境。
OPA 只能用于 Kubernetes 吗?还是可以用在其他地方?OPA 是通用型工具,除 Kubernetes 外,还可以与 Terraform、Docker、SSH 等众多系统集成。
什么是 Rego?Rego 是 OPA 的高级声明式策略语言,用于编写规则,OPA 通过这些规则评估并做出允许或拒绝的决定。
OPA 的安全性经过审计吗?经过了。第三方安全公司 Cure53 进行了安全审计,并公开发布了完整报告;如果发现漏洞,可以通过电子邮件联系 OPA 安全团队报告。
OPA 能帮助回答哪些类型的问题?例如某个用户能否对某资源调用特定操作、工作负载应部署到哪些集群,或资源在创建前必须带有哪些标签等策略类问题。
Size
3.5 GB
Stars
12.4K
Age
10y
Commits · 90 Days