gatekeeper-library
kube-bench
gatekeeper-library | kube-bench | |
---|---|---|
8 | 24 | |
606 | 6,659 | |
0.5% | 1.1% | |
8.8 | 8.4 | |
2 days ago | 5 days ago | |
Open Policy Agent | Go | |
Apache License 2.0 | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
gatekeeper-library
-
Multi-tenancy in Kubernetes
Here is a library or rules for the Open Policy Agent.
- open-policy-agent/gatekeeper-library: The OPA Gatekeeper policy library.
-
Security scanning of k8s manifest files vs running cluster
https://github.com/open-policy-agent/gatekeeper-library is the library of OPA Gatekeeper policies.
- OPA Rego is ridiculously confusing - best way to learn it?
-
Container security best practices: Comprehensive guide
Many more examples are available in the OPA Gatekeeper library project!
-
Expose Open Policy Agent/Gatekeeper Constraint Violations for Kubernetes Applications with Prometheus and Grafana
by default and exposes metrics on path ```/metrics``` . It can run locally on your development box as long as you have a valid Kubernetes configuration in your home folder (i.e. if you can run kubectl and have the right permissions). When running on the cluster a ```incluster``` parameter is passed in so that it knows where to look up for the cluster credentials. Exporter program connects to Kubernetes API every 10 seconds to scrape data from Kubernetes API. We've used [this](https://medium.com/teamzerolabs/15-steps-to-write-an-application-prometheus-exporter-in-go-9746b4520e26) blog post as the base for the code. ## Demo Let's go ahead and prepare our components so that we have a Grafana dashboard to show us which constraints have been violated and how the number of violations evolve over time. ### 0) Required tools - [Git](https://git-scm.com/downloads): A git cli is required to checkout the repo and - [Kubectl](https://kubernetes.io/docs/tasks/tools/) and a working K8S cluster - [Ytt](https://carvel.dev/ytt/): This is a very powerful yaml templating tool, in our setup it's used for dynamically overlaying a key/value pair in all constraints. It's similar to Kustomize, it's more flexibel than Kustomize and heavily used in some [Tanzu](https://tanzu.vmware.com/tanzu) products. - [Kustomize](https://kustomize.io/): Gatekeeper-library relies on Kustomize, so we need it too. - [Helm](https://helm.sh/): We will install Prometheus and Grafana using helm - Optional: [Docker](https://www.docker.com/products/docker-desktop): Docker is only optional as we already publish the required image on dockerhub. ### 1) Git submodule update Run ```git submodule update --init``` to download gatekeeper-library dependency. This command will download the [gatekeeper-library](https://github.com/open-policy-agent/gatekeeper-library) dependency into folder ```gatekeeper-library/library``` . ### 2) Install OPA/Gatekeeper If your K8S cluster does not come with Gatekeeper preinstalled, you can use install it as explained [here](https://open-policy-agent.github.io/gatekeeper/website/docs/install/). If you are familiar with helm, the easiest way to install is as follows: ```bash helm repo add gatekeeper https://open-policy-agent.github.io/gatekeeper/charts helm install gatekeeper/gatekeeper --generate-name
-
Who is doing image scanning on an admission controller? (Open source)
Gatekeeper library has example policies for restricting image repositories: https://github.com/open-policy-agent/gatekeeper-library/tree/master/library/general
-
Mental models for understanding Kubernetes Pod Security Policy PSP
You should check out the Gatekeeper project. There's plenty of templates available for use without having to write a single line of rego for most use cases (e.g https://github.com/open-policy-agent/gatekeeper-library)
kube-bench
-
Cloud Security and Resilience: DevSecOps Tools and Practices
2. Kubebench: https://github.com/aquasecurity/kube-bench Kubebench is an open-source tool that checks whether Kubernetes is deployed according to security best practices as defined in the CIS Kubernetes Benchmark.
-
Evaluating and securing your Kubernetes infrastructure with kube-bench
However, no matter how well our applications are secured, the security of our entire IT environment ultimately depends on the security of our infrastructure. Therefore, in the lab to follow, we will shift our focus away from Kubernetes workloads and instead explore how we can evaluate and improve upon the security of our Kubernetes clusters with kube-bench, the industry-leading Kubernetes benchmarking solution developed by Aqua.
-
Kube-bench and Popeye: A Power Duo for AKS Security Compliance
The official repository can be found here with detailed installation instructions.
-
Quickstart - Aqua Security Kube-Bench
curl -L [https://github.com/aquasecurity/kube-bench/releases/download/v0.6.10/kube-bench_0.6.10_linux_amd64.deb](https://github.com/aquasecurity/kube-bench/releases/download/v0.6.2/kube-bench_0.6.2_linux_amd64.deb) -o kube-bench_0.6.10_linux_amd64.deb
- Looking for Tips on Open Sourcing a kubernetes security tool
-
Kubernetes Security: 10 Best Practices from the Industry and Community
I haven't used Kubernetes for a while, but shouldn't kube-bench (1) be enough? Do you have to check anything manually?
(1) https://github.com/aquasecurity/kube-bench
-
Implement DevSecOps to Secure your CI/CD pipeline
kube-bench checks whether Kubernetes is deployed securely by running the checks documented in the CIS Kubernetes Benchmark. We can deploy kube-bench as a Job that runs daily and consume its report in CI/CD to pass or fail the pipeline based on the level of severity.
-
Securing Kubernetes Cluster using Kubescape and kube-bench
kube-bench can be executed as a simple command on the host, as a container on the host using Docker command, or as a job inside Kubernetes Cluster. In case it is run inside a container/pod, it will need access to the PID namespace of the host system. The methods to run kube-bench in AKS, EKS, GKE, On-prem cluster, Openshift and ACK (Alibaba Cloud Container Service For Kubernetes) are different but well documented.
-
What are some fundamental security practices for the self hosted k8s cluster?
Check this out: kube-bench - CIS Benchmark
-
Top 6 Kubernetes Security Tools
Kube-bench, written as a Go application, is deployable as a container. Ready-made job.yaml files make it easy to run Kube-bench inside a Kubernetes cluster or on a managed Kubernetes service, such as Azure Kubernetes Service (AKS), Amazon Elastic Kubernetes Service (EKS), Google Kubernetes Engine (GKE), or OpenShift. Here's a link to Kube-Bench on Github
What are some alternatives?
OPA (Open Policy Agent) - Open Policy Agent (OPA) is an open source, general-purpose policy engine.
trivy - Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
opa-scorecard
kubesec - Security risk analysis for Kubernetes resources
helm-charts - Prometheus community Helm charts
kubeaudit - kubeaudit helps you audit your Kubernetes clusters against common security controls
conftest - Write tests against structured configuration data using the Open Policy Agent Rego query language
kube-hunter - Hunt for security weaknesses in Kubernetes clusters
tfsec - Security scanner for your Terraform code
falco - Cloud Native Runtime Security
opa-image-scanner - Kubernetes Admission Controller for Image Scanning using OPA
docker-bench-security - The Docker Bench for Security is a script that checks for dozens of common best-practices around deploying Docker containers in production.