Convert Figma logo to code with AI

FairwindsOps logopolaris

Validation of best practices in your Kubernetes clusters

3,271
216
3,271
15

Top Related Projects

🐊 Gatekeeper - Policy Controller for Kubernetes

27,268

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more

10,855

Kubescape is an open-source Kubernetes security platform for your IDE, CI/CD pipelines, and clusters. It includes risk analysis, security, compliance, and misconfiguration scanning, saving Kubernetes users and administrators precious time, effort, and resources.

1,373

Security risk analysis for Kubernetes resources

KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices.

Quick Overview

Polaris is an open-source project by Fairwinds that helps validate and secure Kubernetes workloads. It runs a variety of checks to ensure that Kubernetes pods and controllers are configured using best practices, helping teams find and prevent potential issues in their Kubernetes deployments.

Pros

  • Provides automated checks for Kubernetes best practices
  • Offers both CLI and dashboard interfaces for easy integration and visualization
  • Customizable with support for custom checks and configuration
  • Can be integrated into CI/CD pipelines for continuous validation

Cons

  • May require additional setup and maintenance in complex environments
  • Some checks might be overly strict for certain use cases, requiring customization
  • Learning curve for teams new to Kubernetes best practices
  • Dashboard requires additional setup compared to CLI usage

Getting Started

To get started with Polaris, follow these steps:

  1. Install Polaris using Helm:
helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm upgrade --install polaris fairwinds-stable/polaris --namespace polaris --create-namespace
  1. Run a scan on your cluster:
kubectl port-forward --namespace polaris svc/polaris-dashboard 8080:80
  1. Open your browser and navigate to http://localhost:8080 to view the Polaris dashboard.

For CLI usage, install the Polaris binary:

brew tap fairwindsops/tap
brew install fairwindsops/tap/polaris

Then run a scan:

polaris audit --audit-path /path/to/your/manifests

Competitor Comparisons

🐊 Gatekeeper - Policy Controller for Kubernetes

Pros of Gatekeeper

  • More flexible and powerful policy engine with Rego language
  • Supports a wider range of Kubernetes resources and custom resources
  • Integrates well with other OPA-based tools and ecosystems

Cons of Gatekeeper

  • Steeper learning curve due to Rego language complexity
  • Requires more setup and configuration compared to Polaris
  • May have higher resource overhead for large-scale deployments

Code Comparison

Polaris configuration example:

checks:
  - name: hostNetworkSet
    exclude:
      - Deployment
  - name: hostPIDSet

Gatekeeper constraint template example:

apiVersion: templates.gatekeeper.sh/v1beta1
kind: ConstraintTemplate
metadata:
  name: k8spspprivilegedcontainer
spec:
  crd:
    spec:
      names:
        kind: K8sPSPPrivilegedContainer

Both tools aim to enforce policies in Kubernetes clusters, but they differ in approach and complexity. Polaris focuses on simplicity and ease of use, while Gatekeeper offers more advanced policy enforcement capabilities at the cost of increased complexity.

27,268

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more

Pros of Trivy

  • Broader scope: Scans for vulnerabilities in container images, file systems, and Git repositories
  • Extensive vulnerability database: Covers multiple operating systems and package managers
  • Fast scanning speed: Optimized for quick results, especially for container images

Cons of Trivy

  • Limited Kubernetes-specific checks compared to Polaris
  • Lacks built-in policy enforcement capabilities for Kubernetes resources
  • May require additional tools for comprehensive Kubernetes security auditing

Code Comparison

Polaris configuration example:

checks:
  - name: hostNetworkSet
    exclude:
      - Deployment
  - name: hostPIDSet
    exclude:
      - DaemonSet

Trivy configuration example:

vulnerability:
  type: "os,library"
  severity: "CRITICAL,HIGH"
misconfiguration:
  include:
    - "kubernetes"
    - "docker"

While Polaris focuses on Kubernetes-specific checks and policies, Trivy offers a broader range of security scanning capabilities. Polaris excels in Kubernetes resource validation and best practices enforcement, whereas Trivy provides comprehensive vulnerability scanning for various components of the software supply chain. The choice between the two depends on the specific security requirements and the scope of the infrastructure being secured.

10,855

Kubescape is an open-source Kubernetes security platform for your IDE, CI/CD pipelines, and clusters. It includes risk analysis, security, compliance, and misconfiguration scanning, saving Kubernetes users and administrators precious time, effort, and resources.

Pros of Kubescape

  • More comprehensive security scanning, including MITRE ATT&CK framework
  • Supports multiple security frameworks (NSA, MITRE, etc.)
  • Offers both CLI and web-based UI for easier visualization

Cons of Kubescape

  • Steeper learning curve due to more complex features
  • May require more system resources for extensive scans
  • Less focus on general best practices compared to Polaris

Code Comparison

Polaris configuration example:

checks:
  pullPolicyNotAlways: ignore
  hostNetworkSet: warning
  hostIPCSet: error

Kubescape configuration example:

frameworks:
  - nsa
  - mitre
exceptions:
  - name: allow-host-path
    policyType: postureExceptionPolicy

Both tools aim to improve Kubernetes security and best practices, but Kubescape offers more advanced security features while Polaris focuses on simplicity and general best practices. Kubescape may be better suited for larger, security-focused organizations, while Polaris could be ideal for teams looking for a straightforward tool to enforce basic Kubernetes standards.

1,373

Security risk analysis for Kubernetes resources

Pros of Kubesec

  • Focused specifically on security scanning of Kubernetes YAML files
  • Provides a detailed security score and explanation for each issue
  • Can be easily integrated into CI/CD pipelines as a standalone tool

Cons of Kubesec

  • Limited scope compared to Polaris, focusing only on security aspects
  • Less frequent updates and smaller community compared to Polaris
  • Lacks a web UI for easy visualization of results

Code Comparison

Kubesec example:

apiVersion: v1
kind: Pod
metadata:
  name: kubesec-demo
spec:
  containers:
  - name: kubesec-demo
    image: gcr.io/google-samples/node-hello:1.0
    securityContext:
      readOnlyRootFilesystem: true

Polaris example:

apiVersion: v1
kind: Pod
metadata:
  name: polaris-demo
spec:
  containers:
  - name: polaris-demo
    image: gcr.io/google-samples/node-hello:1.0
    resources:
      limits:
        cpu: 100m
        memory: 128Mi

Both tools analyze Kubernetes YAML files, but Kubesec focuses on security-specific checks, while Polaris covers a broader range of best practices, including resource management and general configuration issues.

KubeLinter is a static analysis tool that checks Kubernetes YAML files and Helm charts to ensure the applications represented in them adhere to best practices.

Pros of kube-linter

  • More extensive set of built-in checks (over 60) compared to Polaris
  • Supports custom checks using Rego language for advanced use cases
  • Provides a plugin system for easy integration with CI/CD pipelines

Cons of kube-linter

  • Less user-friendly web interface for visualizing results
  • Fewer options for generating reports in different formats
  • Limited support for scanning Helm charts directly

Code Comparison

kube-linter:

checks:
  - name: privileged-containers
    description: Flag privileged containers
    remediation: Avoid using privileged containers
    template: privileged

Polaris:

checks:
  privileged:
    successMessage: Containers are not running in privileged mode
    failureMessage: Containers should not be running in privileged mode
    category: Security

Both tools use YAML configuration for defining checks, but kube-linter's approach is more flexible and allows for custom checks using Rego. Polaris focuses on simplicity and readability in its configuration.

While both tools serve similar purposes in Kubernetes security and best practices enforcement, kube-linter offers more advanced features and customization options. Polaris, on the other hand, provides a more user-friendly experience with its web interface and simpler configuration. The choice between the two depends on the specific needs of the project and the team's expertise.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Polaris Logo

Polaris is an open source policy engine for Kubernetes

Polaris is an open source policy engine for Kubernetes that validates and remediates resource configuration. It includes 30+ built in configuration policies, as well as the ability to build custom policies with JSON Schema. When run on the command line or as a mutating webhook, Polaris can automatically remediate issues based on policy criteria.

Polaris can be run in three different modes:

  • As a dashboard - Validate Kubernetes resources against policy-as-code.
  • As an admission controller - Automatically reject or modify workloads that don't adhere to your organization's policies.
  • As a command-line tool - Incorporate policy-as-code into the CI/CD process to test local YAML files.

Polaris Architecture

Documentation

Check out the documentation at docs.fairwinds.com

Join the Fairwinds Open Source Community

The goal of the Fairwinds Community is to exchange ideas, influence the open source roadmap, and network with fellow Kubernetes users. Chat with us on Slack or join the user group to get involved!

Love Fairwinds Open Source? Automate Fairwinds Open Source for free with Fairwinds Insights. Click to learn more

Other Projects from Fairwinds

Enjoying Polaris? Check out some of our other projects:

  • Goldilocks - Right-size your Kubernetes Deployments by compare your memory and CPU settings against actual usage
  • Pluto - Detect Kubernetes resources that have been deprecated or removed in future versions
  • Nova - Check to see if any of your Helm charts have updates available
  • rbac-manager - Simplify the management of RBAC in your Kubernetes clusters

Or check out the full list

Fairwinds Insights

If you're interested in running Polaris in multiple clusters, tracking the results over time, integrating with Slack, Datadog, and Jira, or unlocking other functionality, check out Fairwinds Insights, a platform for auditing and enforcing policy in Kubernetes clusters.

Fairwinds Insights