Security Audit

Separate Kubernetes configuration findings, effective RBAC exposure, and optional Trivy results before deciding what to remediate.

Overview

Krust includes a built-in security audit engine that evaluates live cluster resources against explicit security configuration checks. Results are presented in one view with severity, source, affected resource, and a remediation direction.

Optional Trivy integration is a separate evidence source. Krust runs a locally installed trivy executable and parses its Kubernetes or image scan output. Krust does not bundle Trivy, and a missing or failed Trivy run must not be interpreted as a clean scan.

Krust Security Audit showing Kubernetes configuration and vulnerability findings grouped by severity

How to Use

Navigate to the Security Audit tab in the sidebar. Krust automatically starts the built-in audit for a selected namespace scope. For All Namespaces, start the audit explicitly so a large cluster does not begin an expensive scan without intent. Findings are sorted by severity and grouped by category, with counts for each severity at the top.

Built-In Audit vs Trivy

SourceBest forRequirement
Krust built-in auditWorkload security context, image tags, RBAC, service accounts, and secret exposureCurrent Kubernetes access through kubeconfig
Trivy cluster scanVulnerabilities, misconfigurations, and secret findings across a selected cluster or namespaceLocal Trivy installation and sufficient cluster permission
Trivy image scanPackage-level vulnerability detail for a selected imageLocal Trivy installation and image access

Install Trivy with brew install trivy, then verify its status under Settings → Security. Scan mode, severity, scanners, timeout, namespace scope, and unfixed-vulnerability handling remain explicit settings.

Check Categories

The built-in audit evaluates Pods, RBAC, ServiceAccounts, and ConfigMaps. Pods owned by the same ReplicaSet, StatefulSet, DaemonSet, Job, or CronJob are checked once and reported against the owner with an affected-Pod count. Init containers are skipped by the Pod and image checks.

Pod Security

Checks related to pod-level and container security context.

CheckSeverityDescription
Privileged containerCriticalContainers running with privileged: true
Host PID namespaceCriticalPods with hostPID: true
Host networkHighPods with hostNetwork: true
Host IPC namespaceHighPods with hostIPC: true
Container runs as rootHighContainers with runAsUser: 0 or runAsNonRoot: false
Dangerous capabilityHigh / MediumContainers that add ALL or SYS_ADMIN (High), or NET_ADMIN, SYS_PTRACE, or NET_RAW (Medium)
Privilege escalation allowedMediumNon-privileged containers without allowPrivilegeEscalation: false
Writable root filesystemLowContainers without readOnlyRootFilesystem: true

Image Security

Checks related to container image hygiene.

CheckSeverityDescription
Image uses :latest or no tagLowImages using the :latest tag or no tag, unless pinned by digest (@sha256:...)

RBAC Permissions

Checks for overly broad RBAC policies. Findings name the subject, binding, and role that grant the permission; system: subjects are skipped.

CheckSeverityDescription
Cluster admin bindingHighClusterRoleBindings or RoleBindings that bind the cluster-admin ClusterRole
Secret read accessHighRules granting get, list, or watch on secrets
Pod exec or attachHighRules granting pods/exec, pods/attach, or pods/portforward
Permission managementHighRules granting bind, escalate, impersonate, or write access to RBAC resources
Wildcard permissionsMediumRules granting * verbs on * resources

Service Account

Checks related to service account configuration.

CheckSeverityDescription
Default SA auto-mounts tokenMediumThe default ServiceAccount in a namespace auto-mounts API tokens into Pods that don't name a service account

Secret Exposure

Checks for credentials exposed through environment variables or ConfigMaps.

CheckSeverityDescription
Secret in env varMediumContainers that read a Secret into an environment variable
ConfigMap has sensitive keyLowConfigMap keys that look like credentials, such as password, token, api_key, or private_key

Severity Levels

LevelMeaning
CriticalImmediate security risk that should be addressed urgently
HighSignificant security concern that could lead to exploitation
MediumBest-practice violation that weakens security posture
LowMinor improvement opportunity for defense in depth
InfoInformational result with no direct risk

From Finding to Fix

  1. Confirm the context, namespace, scan source, and scope.
  2. Open the affected resource and verify the exact field, rule, package, or binding behind the finding.
  3. Trace Pods to their owning workload and RBAC rules to the binding and subject that receive them.
  4. Review the YAML or image change in the durable deployment source.
  5. Deploy, then rerun the same audit scope and confirm the finding is gone.

Use Kubernetes Security Audit: Configuration First, Trivy Second for prioritization guidance and common failure modes.

Primary References