{"id":13788107,"url":"https://github.com/developer-guy/monitor-opa-gatekeeper","last_synced_at":"2025-05-06T23:18:36.828Z","repository":{"id":104879702,"uuid":"322069565","full_name":"developer-guy/monitor-opa-gatekeeper","owner":"developer-guy","description":"🖥️ 👓 Monitor your OPA Gatekeeper via Grafana Dashboard","archived":false,"fork":false,"pushed_at":"2020-12-17T09:39:22.000Z","size":124,"stargazers_count":14,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T23:18:31.399Z","etag":null,"topics":["dashboard","gatekeeper","grafana","metrics","opa"],"latest_commit_sha":null,"homepage":"https://sysdig.com/blog/monitor-gatekeeper-prometheus/","language":null,"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/developer-guy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2020-12-16T18:33:32.000Z","updated_at":"2023-05-24T09:50:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"77d407ef-ee0c-4ed8-af04-5f7d35143cf4","html_url":"https://github.com/developer-guy/monitor-opa-gatekeeper","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmonitor-opa-gatekeeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmonitor-opa-gatekeeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmonitor-opa-gatekeeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer-guy%2Fmonitor-opa-gatekeeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer-guy","download_url":"https://codeload.github.com/developer-guy/monitor-opa-gatekeeper/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252782856,"owners_count":21803413,"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":["dashboard","gatekeeper","grafana","metrics","opa"],"created_at":"2024-08-03T21:00:36.900Z","updated_at":"2025-05-06T23:18:36.812Z","avatar_url":"https://github.com/developer-guy.png","language":null,"readme":"# 🖥️ 👓 Monitor your OPA Gatekeeper via Grafana Dashboard\n\n# Setup Cluster\nYou can start your local kubernetes cluster via KinD or minikube\n```bash\n$ minikube start\n```\n# Deploy Gatekeeper via Helm\nYou can deploy OPA Gatekeeper via plain YAML or Helm chart, in this guide we are going to use Helm to deploy OPA Gatekeeper\n```bash\n$ helm repo add gatekeeper https://open-policy-agent.github.io/gatekeeper/charts\n$ helm install gatekeeper gatekeeper/gatekeeper\n```\n# Install Prometheus Operator via Helm\n```bash\n$ kubectl create namespace monitoring\n$ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts\n$ helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack --namespace monitoring\n```\n\n# Intall ServiceMonitor\nYou need to scrape gatekeeper metrics, in order to do that you need a resource which is kind ServiceMonitor and you need a new port which is \"metrics\" in this case to the gatekeeper service like the following:\n```yaml\nports:\n- name: https\n  port: 443\n  targetPort: 8443\n- name: metrics                                                                \n  port: 8888\n```\nAfter you edit the service , create the ServiceMonitor resource\n```bash\n$ kubectl apply -f monitoring/servicemonitor.yaml\n```\n\n# Apply Sample Policies\n```bash\n$ kubectl apply -f policies/privileged-containers-contraints-template.yaml\n$ kubectl apply -f policies/privileged-containers-constraint.yaml\n```\n\n# Test\n```bash\n$ kubectl apply -f samples/\n```\n\n# Open Dashboard\n```bash\n$ kubectl port-forward -n monitoring svc/kube-prometheus-stack-grafana 3000:80\n$ open localhost:3000 # username: admin password: prom-operator\n```\nAfter you opened the Grafana in the browser, you need to import the your json file, in order to do that copy your [dashoard.json](monitoring/dashboard.json) add paste to the import section of the grafana dashboard, then vola !\n\n\u003e Credit: https://promcat.io/apps/open-policy-agent \n\n![dashboard](dashboard.png)\n","funding_links":[],"categories":["Tools and Utilities"],"sub_categories":["Serverless Blogs and Articles","Testing Blogs and Articles"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-guy%2Fmonitor-opa-gatekeeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper-guy%2Fmonitor-opa-gatekeeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-guy%2Fmonitor-opa-gatekeeper/lists"}