Skip to content

Instantly share code, notes, and snippets.

@kimschles
Last active July 29, 2022 21:41
Show Gist options
  • Save kimschles/b9dc73ba08a4694bd8c485b178b3dd91 to your computer and use it in GitHub Desktop.
Save kimschles/b9dc73ba08a4694bd8c485b178b3dd91 to your computer and use it in GitHub Desktop.
Polaris Commands and Output

Helm install success message:

Release "polaris" does not exist. Installing it now.
NAME: polaris
LAST DEPLOYED: Thu Jul 28 19:56:21 2022
NAMESPACE: demo
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **

Enjoy Polaris and smooth sailing!
To view the dashboard execute this command:

kubectl port-forward --namespace demo svc/polaris-dashboard 8080:80

Then open http://localhost:8080 in your browser.

Polaris webhook install success message

Release "polaris" does not exist. Installing it now.
NAME: polaris
LAST DEPLOYED: Fri Jul 29 15:30:41 2022
NAMESPACE: demo
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
** Please be patient while the chart is being deployed **

Enjoy Polaris and smooth sailing!
The webhook is now running. Any resources that violate Polaris policy will be rejected.

Webhook rejection message

helm upgrade --install -n demo basic-demo fairwinds-incubator/basic-demo --create-namespace --set image.pullPolicy=IfNotPresent
Release "basic-demo" does not exist. Installing it now.

Error: admission webhook "polaris.fairwinds.com" denied the request:
Polaris prevented this deployment due to configuration problems:
- Container basic-demo: Image tag should be specified

Webhook success message

Release "basic-demo" has been upgraded. Happy Helming!
NAME: app
LAST DEPLOYED: Fri Jul 29 16:07:35 2022
NAMESPACE: demo
STATUS: deployed
REVISION: 2
TEST SUITE: None
NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace staging-app -l "app.kubernetes.io/name=basic-demo,app.kubernetes.io/instance=app" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80

Polaris Audit Output

Polaris audited Path ./deploy/ at 2022-07-29T16:40:08-05:00
    Nodes: 0 | Namespaces: 0 | Controllers: 1
    Final score: 55

Deployment kube-info-deployment in namespace demo
    deploymentMissingReplicas            πŸŽ‰ Success
        Reliability - Multiple replicas are scheduled
    hostIPCSet                           πŸŽ‰ Success
        Security - Host IPC is not configured
    hostNetworkSet                       πŸŽ‰ Success
        Security - Host network is not configured
    hostPIDSet                           πŸŽ‰ Success
        Security - Host PID is not configured
  Container kube-info
    runAsPrivileged                      πŸŽ‰ Success
        Security - Not running as privileged
    cpuLimitsMissing                     😬 Warning
        Efficiency - CPU limits should be set
    livenessProbeMissing                 😬 Warning
        Reliability - Liveness probe should be configured
    memoryLimitsMissing                  😬 Warning
        Efficiency - Memory limits should be set
    memoryRequestsMissing                😬 Warning
        Efficiency - Memory requests should be set
    privilegeEscalationAllowed           ❌ Danger
        Security - Privilege escalation should not be allowed
    readinessProbeMissing                😬 Warning
        Reliability - Readiness probe should be configured
    tagNotSpecified                      πŸŽ‰ Success
        Reliability - Image tag is specified
    insecureCapabilities                 😬 Warning
        Security - Container should not have insecure capabilities
    runAsRootAllowed                     ❌ Danger
        Security - Should not be allowed to run as root
    cpuRequestsMissing                   😬 Warning
        Efficiency - CPU requests should be set
    dangerousCapabilities                πŸŽ‰ Success
        Security - Container does not have any dangerous capabilities
    hostPortSet                          πŸŽ‰ Success
        Security - Host port is not configured
    notReadOnlyRootFilesystem            😬 Warning
        Security - Filesystem should be read only
    pullPolicyNotAlways                  😬 Warning
        Reliability - Image pull policy should be "Always"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment