
Skill
kickstart-safeguard-checklist
validate Kubernetes manifests against safeguard rules
Description
AKS deployment safeguard rules checklist for validating Kubernetes manifests.
SKILL.md
AKS Deployment Safeguard Checklist
This skill provides a comprehensive checklist for validating generated Kubernetes manifests against AKS security and deployment best practices. Use this during the Review phase to ensure all generated configurations comply with organizational policies.
Safeguard Rules
Rule: no-privileged
- Severity: HIGH
- Description: Containers must not run in privileged mode.
- Check: Verify that
spec.containers[*].securityContext.privilegedis not set totrue - Pass / Fail
Rule: require-limits
- Severity: MEDIUM
- Description: All containers must declare resource limits (CPU and memory).
- Check: Verify that
spec.containers[*].resources.limitsis defined for all containers - Pass / Fail
Rule: no-hostpath
- Severity: HIGH
- Description: Pods must not use hostPath volumes.
- Check: Verify that
spec.volumes[*].hostPathis null or not present - Pass / Fail
Rule: no-latest-tag
- Severity: HIGH
- Description: Container images must not use the ':latest' tag.
- Check: Verify that
spec.containers[*].imagedoes not end with:latest - Pass / Fail
Rule: no-privilege-escalation
- Severity: HIGH
- Description: Containers must not allow privilege escalation.
- Check: Verify that
spec.containers[*].securityContext.allowPrivilegeEscalationis not set totrue - Pass / Fail
Rule: no-dangerous-capabilities
- Severity: HIGH
- Description: Containers must not add dangerous capabilities (SYS_ADMIN, NET_ADMIN, ALL, etc.).
- Check: Verify that
spec.containers[*].securityContext.capabilities.adddoes not contain any of:SYS_ADMIN,NET_ADMIN,ALL,SYS_PTRACE,SYS_MODULE,DAC_READ_SEARCH - Pass / Fail
Rule: run-as-non-root
- Severity: MEDIUM
- Description: Containers must run as a non-root user.
- Check: Verify that
spec.securityContext.runAsNonRootis set totrue - Pass / Fail
Rule: no-host-network
- Severity: HIGH
- Description: Pods must not use host networking.
- Check: Verify that
spec.hostNetworkis not set totrue - Pass / Fail
Rule: no-host-pid
- Severity: HIGH
- Description: Pods must not share the host PID namespace.
- Check: Verify that
spec.hostPIDis not set totrue - Pass / Fail
Rule: read-only-root-filesystem
- Severity: MEDIUM
- Description: readOnlyRootFilesystem should be true where the application permits.
- Check: Verify
spec.containers[*].securityContext.readOnlyRootFilesystemistrue(use tmpfs for writable paths) - Pass / Fail
Rule: gateway-api-for-ingress
- Severity: HIGH
- Description: Use Gateway API (HTTPRoute) for ingress, not the legacy Ingress resource.
- Check: Verify no
kind: Ingressresources exist; all ingress useskind: HTTPRoutewithgateway.networking.k8s.io/v1API - Pass / Fail
Rule: workload-identity-required
- Severity: HIGH
- Description: Azure access must use Workload Identity, not stored credentials.
- Check: Verify pods use
azure.workload.identity/use: "true"label and ServiceAccount withazure.workload.identity/client-idannotation. No Azure connection strings or keys in env vars or secrets. - Pass / Fail
Rule: acr-with-acrpull
- Severity: HIGH
- Description: Container images must be pulled from ACR with AcrPull role binding.
- Check: Verify images reference an ACR registry (
*.azurecr.io). NoimagePullSecretswith static credentials. - Pass / Fail
Rule: resource-quotas-production
- Severity: MEDIUM
- Description: Production-tier deployments must define ResourceQuota in the namespace.
- Check: Verify a
kind: ResourceQuotaexists in the namespace for production deployments - Pass / Fail (N/A for non-production)
Rule: network-policies-production
- Severity: MEDIUM
- Description: Production-tier deployments must define NetworkPolicy for pod-to-pod traffic.
- Check: Verify a
kind: NetworkPolicyexists restricting ingress/egress for production deployments - Pass / Fail (N/A for non-production)
Rule: pod-disruption-budget-production
- Severity: MEDIUM
- Description: Production-tier deployments must define PodDisruptionBudget for high availability.
- Check: Verify a
kind: PodDisruptionBudgetexists with appropriateminAvailableormaxUnavailablefor production deployments - Pass / Fail (N/A for non-production)
Automated Validation
When possible, use the runCommands tool to validate manifests programmatically:
# Dry-run validation against K8s API schemas
kubectl apply --dry-run=client -f k8s/
# Validate with kubeconform (if installed)
kubeconform -strict -summary k8s/*.yaml
Review Instructions
When reviewing manifests, use this checklist to validate each safeguard rule:
- For each rule above, examine the relevant manifest sections
- Mark the status for each rule as:
- ✓ PASS — The manifest complies with this rule
- ✗ FAIL — The manifest violates this rule
- ⊘ N/A — This rule does not apply to the manifest (e.g., a Deployment that has no volumes cannot violate the hostPath rule)
- Report results in a summary table showing rule ID, status, and any notes
- Block on failures: Any FAIL on a HIGH-severity rule must be fixed before the manifest proceeds to deployment
- Address medium-severity failures: MEDIUM-severity FAILs should be resolved or explicitly justified before proceeding
Example Review Output
| Rule ID | Severity | Status | Notes |
|---------|----------|--------|-------|
| no-privileged | HIGH | ✓ PASS | securityContext.privileged is false |
| require-limits | MEDIUM | ✓ PASS | All containers have CPU/memory limits |
| no-hostpath | HIGH | ✓ PASS | No hostPath volumes defined |
| no-latest-tag | HIGH | ✓ PASS | Image uses pinned tag v1.2.3 |
| ... | ... | ... | ... |
How to Use This Skill
- When validating K8s manifests, reference this checklist to ensure compliance
- Review the generated YAML against each rule listed above
- Document any violations and remediate before proceeding
- Use the severity levels to prioritize fixes (HIGH first, then MEDIUM)
Last updated: Safeguards from packages/pack-aks-automatic/src/safeguards.json
More skills from the vscode-aks-tools repository
View all 19 skillskickstart-acr-integration
integrate Azure Container Registry with AKS
Jul 12AzureContainersDeploymentkickstart-bicep-authoring
author idiomatic Azure Bicep templates
Jul 12AzureBicepDeploymentInfrastructure as Codekickstart-cluster-status
monitor AKS cluster provisioning status
Jul 12AzureDeploymentKubernetesMonitoringkickstart-collaborator-voice
define agent voice and interaction patterns
Jul 12AgentsBrandingCommunicationskickstart-configure-infra
configure Azure infrastructure for AKS clusters
Jul 12AzureDeploymentInfrastructureKuberneteskickstart-deploy
deploy applications with Azure CLI and kubectl
Jul 12AzureCLIDeploymentKubernetes
More from Azure (Microsoft)
View publisherazure-arg-external-evaluation-policy-author
author and test Azure Resource Graph policies
azure-policy
Jul 12AzureComplianceGovernancePolicyazure-blueprints-migration
migrate Azure Blueprints to Template Specs
azure-blueprints
Jul 12AzureDeploymentInfrastructure as CodeMigrationapiview-feedback-resolution
resolve APIView feedback on Azure SDKs
azure-sdk-tools
Jul 12API DevelopmentAzureCode ReviewDocumentationazsdk-common-live-and-recorded-tests
deploy resources and run Azure SDK tests
azure-sdk-tools
Jul 12AzureDeploymentSDKTestingazsdk-common-prepare-release-plan
manage Azure SDK release plan work items
azure-sdk-tools
Jul 12AzureGitHubProject ManagementSDKazsdk-common-sdk-release
release Azure SDK packages
azure-sdk-tools
Jul 12AzureCI/CDDeploymentSDK