{"id":13690959,"url":"https://github.com/opcr-io/policy","last_synced_at":"2026-03-08T21:16:35.573Z","repository":{"id":37440116,"uuid":"411456245","full_name":"opcr-io/policy","owner":"opcr-io","description":"CLI for building OPA policies into OCI images","archived":false,"fork":false,"pushed_at":"2025-03-17T17:39:21.000Z","size":1474,"stargazers_count":228,"open_issues_count":5,"forks_count":10,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-03-17T18:38:07.027Z","etag":null,"topics":["oci","oci-image","openpolicyagent"],"latest_commit_sha":null,"homepage":"https://www.openpolicycontainers.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opcr-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-28T22:31:02.000Z","updated_at":"2025-03-17T17:39:24.000Z","dependencies_parsed_at":"2023-12-13T14:42:57.343Z","dependency_job_id":"ffc69abd-7117-46c7-831d-af8ffeb9f485","html_url":"https://github.com/opcr-io/policy","commit_stats":null,"previous_names":[],"tags_count":137,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcr-io%2Fpolicy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcr-io%2Fpolicy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcr-io%2Fpolicy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opcr-io%2Fpolicy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opcr-io","download_url":"https://codeload.github.com/opcr-io/policy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252030206,"owners_count":21683308,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["oci","oci-image","openpolicyagent"],"created_at":"2024-08-02T17:00:37.507Z","updated_at":"2026-03-08T21:16:35.566Z","avatar_url":"https://github.com/opcr-io.png","language":"Go","funding_links":[],"categories":["Tooling— Security and Policies","others","Tools and Utilities","Go"],"sub_categories":["Testing Blogs and Articles"],"readme":"\u003cimg src=\"assets/opcr.png\" alt=\"opcr\" width=\"200\"\u003e\n\n# policy - the CLI for managing authorization policies\n\nThe policy CLI is a tool for building, versioning and publishing your authorization policies.\nIt uses OCI standards to manage artifacts, and the [Open Policy Agent (OPA)](https://github.com/open-policy-agent/opa) to compile and run.\n\n---\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/opcr-io/policy?)](https://goreportcard.com/report/github.com/opcr-io/policy)\n[![ci](https://github.com/opcr-io/policy/actions/workflows/ci.yaml/badge.svg)](https://github.com/opcr-io/policy/actions/workflows/ci.yaml)\n[![codebeat badge](https://codebeat.co/badges/8e9c8690-9890-46d4-accc-17e5ac24cd88)](https://codebeat.co/projects/github-com-opcr-io-policy-main)\n![GitHub all releases](https://img.shields.io/github/downloads/opcr-io/policy/total)\n![Apache 2.0](https://img.shields.io/github/license/opcr-io/policy)\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/opcr-io/policy)\n[\u003cimg src=\"https://img.shields.io/badge/slack-@asertocommunity-yellow.svg?logo=slack\"\u003e](https://asertocommunity.slack.com/)\n[\u003cimg src=\"https://img.shields.io/badge/docs-%F0%9F%95%B6-blue\"\u003e](https://www.openpolicycontainers.com/docs/intro)\n[![CodeQL](https://github.com/opcr-io/policy/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/opcr-io/policy/actions/workflows/codeql-analysis.yml)\n[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6859/badge)](https://bestpractices.coreinfrastructure.org/projects/6859)\n---\n\n**_Note:_** Version v0.3.x of policy CLI uses Rego V1 as default to build policy images. \n\n## Documentation\n\nPlease refer to our [documentation](https://openpolicycontainers.com) site for installation, usage, customization and tips.\n\n## Slack Channel\n\nWanna discuss features or show your support for this tool?\n\n* Channel: [Slack](https://asertocommunity.slack.com/)\n* Invite: [Invite Link](https://asertocommunity.slack.com/join/shared_invite/zt-p06gin84-xNswWpTGyPDPxCz0LMux3g#/shared-invite/email)\n\n---\n\n## Installation\n\n`policy` is available on Linux, macOS and Windows platforms.\n\n* Binaries for Linux, Windows and Mac are available as tarballs in the [release](https://github.com/opcr-io/policy/releases) page.\n\n* Via Homebrew for macOS or LinuxBrew for Linux\n\n   ```shell\n  brew install --cask policy\n   ```\n\n* Via the nix package manager on nixOS, other linux distros, and macOS\n\n   At the moment the package is only available in the `unstable` channel. Below are some examples using nix to install `policy` via the shell, NixOS configuration, and home-manager configuration.\n\n   Shell:\n   ```shell\n   nix-env --install -A nixpkgs.opcr-policy\n   ```\n\n   NixOS:\n   ```nix\n     # your other config ...\n     environment.systemPackages = with pkgs; [\n       # your other packages ...\n       opcr-policy\n     ];\n\n   ```\n\n   home-manager:\n   ```nix\n     # your other config ...\n     home.packages = with pkgs; [\n       # your other packages ...\n       opcr-policy\n     ];\n   ```\n\n* Via a GO install\n\n  ```shell\n  go install github.com/opcr-io/policy/cmd/policy@latest\n  ```\n\n---\n\n## Building From Source\n\n `policy` uses the latest golang compiler to build. In order to build `policy` from source you must:\n\n 1. Install the latest golang compiler\n 2. Install `make`\n 2. Clone the repo\n 3. Build and run the executable\n\n      ```shell\n      make build\n      make build-container\n      ```\n\n---\n\n## Running with Docker\n\n### Running the official Docker image\n\n  You can run as a Docker container:\n\n  ```shell\n  docker run -it --rm ghcr.io/opcr-io/policy:latest --help\n  ```\n\n\n---\n\n## The Command Line\n\n```shell\n$ policy --help\nUsage: policy \u003ccommand\u003e\n\nCommands:\n  build        Build policies.\n  images       List policy images.\n  push         Push policies to a registry.\n  pull         Pull policies from a registry.\n  login        Login to a registry.\n  logout       Logout from a registry.\n  save         Save a policy to a local bundle tarball.\n  tag          Create a new tag for an existing policy.\n  rm           Removes a policy from the local registry.\n  inspect      Displays information about a policy.\n  repl         Sets you up with a shell for running queries using an OPA instance with a policy loaded.\n  templates    List and apply templates\n  version      Prints version information.\n\nFlags:\n  -h, --help             Show context-sensitive help.\n  -c, --config=\"/Users/gertd/.policy/config.yaml\"\n                         Path to the policy CLI config file.\n      --debug            Enable debug mode.\n  -v, --verbosity=INT    Use to increase output verbosity.\n  -k, --insecure         Do not verify TLS connections.\n\nRun \"policy \u003ccommand\u003e --help\" for more information on a command.\n```\n\n## Logs\n\nLogs are printed to `stderr`. You can increase detail using the verbosity flag (e.g. `-vvv`).\n\n## Demo Videos/Recordings\n\n![demo](./assets/demo-policy.gif)\n\n---\n\n## Known Issues\n\nThis is still work in progress! If something is broken or there's a feature\nthat you want, please file an issue and if so inclined submit a PR!\n\n---\n\n## Credits\n\nThe policy CLI uses a lot of great and amazing open source projects and libraries.\nA big thank you to all of them!\n\n---\n\n## Contributions Guideline\n\n* File an issue first prior to submitting a PR!\n* Ensure all exported items are properly commented\n* If applicable, submit a test suite against your PR\n\n## Reporting Vulnerabilities\n\nPlease send an email to one of the [maintainers](MAINTAINERS.md). We commit to addressing vulnerabilities promptly.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopcr-io%2Fpolicy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopcr-io%2Fpolicy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopcr-io%2Fpolicy/lists"}