Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/policy-hub/policy-hub-cli
CLI for searching Rego policies
https://github.com/policy-hub/policy-hub-cli
cloud-native cncf hacktoberfest kubernetes opa openpolicyagent policies rego
Last synced: 7 days ago
JSON representation
CLI for searching Rego policies
- Host: GitHub
- URL: https://github.com/policy-hub/policy-hub-cli
- Owner: policy-hub
- Created: 2020-10-05T17:10:40.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-05T18:46:53.000Z (almost 3 years ago)
- Last Synced: 2024-08-02T02:13:16.844Z (3 months ago)
- Topics: cloud-native, cncf, hacktoberfest, kubernetes, opa, openpolicyagent, policies, rego
- Language: Go
- Homepage:
- Size: 102 KB
- Stars: 104
- Watchers: 5
- Forks: 6
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-cloud-sec - policy-hub-cli - - CLI for searching Rego policies (Other Awesome Lists / Open Policy Agent (OPA))
- awesome-opa - Policy Hub CLI - CLI tool that makes Rego policies searchable (Policy Packages / Blogs and Articles)
README
# PolicyHub CLI
This is the home of the PolicyHub CLI, a CLI tool that makes Rego policies searchable.
## Goals
Policies are everywhere. Compliance policies, security policies, policies that define organisational best practices. The Open Policy Agent project provided a single policy language, Rego, that can be used to automate policy enforcement. However currently there is no existing mechanism that allows you to search for specific Rego policies.
For example you might be looking for a set of policies that validate Kubernetes security best practices as a starting point for your organisations Kubernetes policies. Or you might be looking for a set of Microservice Authorization policies. Right now you have to hope that your google search points you in the right direction.
The PolicyHub CLI aims to make policies searchable. We provide a standard format for policy creators to share their policies. Users of the CLI can search our registry for specific tags or descriptions, hopefully finding the policy they where looking for.
## Searching policies
To search our registry, you can use the `search` command:
```bash
> policy-hub search k8s+---------------------------+---------------------------------+--------------------------------+
| NAME | MAINTAINERS | LABELS |
+---------------------------+---------------------------------+--------------------------------+
| deprek8ion | https://github.com/swade1987 | k8s, kubernetes, gatekeeper |
| contrib.k8s_node_selector | https://github.com/tsandall | kubernetes, k8s, node_selector |
| redhat-cop.rego-policies | https://github.com/garethahealy | k8s, kubernetes, gatekeeper |
| konstraint | https://github.com/garethahealy | k8s, kubernetes, gatekeeper |
+---------------------------+---------------------------------+--------------------------------+
```## Downloading policies
To download a policy, use the `pull` command:
```bash
> policy-hub pull konstraint
```## Make your policies discoverable
Do you have policies that the community could benefit from too?
Make them searchable for users of policy-hub by adding metadata for them
here (https://github.com/policy-hub/policy-hub-cli/blob/main/metadata/registries.yml)
and submitting a PR## Contributing
Join us make policies more searchable!
- We accept contributions to our registry.
- Use [GitHub Issues](https://github.com/policy-hub/policy-hub-cli/issues) to file bugs or propose new features.
- Create a [Pull Request](https://github.com/policy-hub/policy-hub-cli/pulls) and contribute to the project.