Skip to content

Security & secrets: Debug & troubleshoot

Security & secrets commands for debug & troubleshoot (tags: #debug #performance).

Index
5 items

Trivy4

Trivy: Scan an image for high and critical CVEs

Safe

Only vulnerabilities that actually have a fix available.

trivy image --severity HIGH,CRITICAL --ignore-unfixed <image>:<tag>
What each part does
  1. trivy imagescan a container image (OS packages + app dependencies)
  2. --severity HIGH,CRITICALonly show these severities
  3. --ignore-unfixedhide vulnerabilities with no fix available
  4. <image>:<tag>the image

Also known as: cve scan · image scan

Trivy: Scan a repo for secrets and misconfigurations

Safe

Dependencies, hard-coded secrets and IaC misconfigurations in a directory.

trivy fs --scanners vuln,secret,misconfig <path>
What each part does
  1. trivy fsscan a local directory
  2. --scanners vuln,secret,misconfigdependency CVEs, hard-coded secrets, and IaC / Dockerfile misconfigurations
  3. <path>the directory, e.g. .

Also known as: leaked secret · secret scanning

Trivy: Scan Terraform or Kubernetes manifests

Safe

Misconfiguration checks for Terraform, Kubernetes YAML, Helm charts and Dockerfiles.

trivy config <path>
What each part does
  1. trivy configscan IaC files: Terraform, Kubernetes YAML, Helm, Dockerfiles, CloudFormation
  2. <path>directory or file to scan

Also known as: tfsec · iac scan · kubernetes misconfig

Trivy: Scan the current Kubernetes cluster

Safe

Vulnerabilities and misconfigurations across workloads in the current kube context.

trivy k8s --report summary
What each part does
  1. trivy k8sscan the cluster in the current kubeconfig context: workload images, configs, RBAC
  2. --report summaryone table of counts per resource instead of every finding (all for full detail)

Also known as: cluster scan · k8s

SonarQube1

SonarQube: Check the quality gate status

Safe

OK or ERROR for the latest analysis. Add -Dsonar.qualitygate.wait=true to the scanner to block CI instead.

curl -s -u "$SONAR_TOKEN:" "<sonar-url>/api/qualitygates/project_status?projectKey=<project-key>" | jq -r .projectStatus.status
What each part does
  1. curl -sHTTP request, quiet
  2. -u "$SONAR_TOKEN:"token as the user name, empty password
  3. /api/qualitygates/project_status?projectKey=<project-key>quality gate result for the project
  4. | jq -r .projectStatus.statusprint just OK, WARN, ERROR or NONE

Also known as: quality gate failed · sonar gate

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…