From magic-powers
Use when hardening Azure Pipelines security — YAML pipeline permissions, fork build security, resource authorization, secret scanning, protected resources, and preventing pipeline-based attacks.
npx claudepluginhub kienbui1995/magic-powers --plugin magic-powersThis skill uses the workspace's default tool permissions.
- Reviewing pipeline security before production use
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
# WRONG — secret visible in logs even with masking in some scenarios
- script: echo "Password is $(DB_PASSWORD)"
# WRONG — secret visible in process list on the agent
- script: myapp --connection-string "$(ConnectionString)"
# CORRECT — pass as environment variable (masked in logs, not in process list)
- script: dotnet ef database update
env:
ConnectionStrings__Default: $(ConnectionString) # masked in logs
# CORRECT — use az keyvault to fetch at runtime (never stored in pipeline)
- task: AzureKeyVault@2
inputs:
azureSubscription: Azure-ServiceConnection
KeyVaultName: myapp-keyvault
SecretsFilter: 'db-password,api-key'
RunAsPreJob: true # fetch before all jobs in the stage
Secret hygiene rules:
ps aux on agent)# For public repos — fork PRs can modify pipeline YAML (attacker-controlled)
# Restrict via Organization Settings → Pipelines → Settings:
# "Limit variables that can be set at queue time": enabled
# "Protect access to repositories in YAML pipelines": enabled
# "Disable creating classic build pipelines": enabled (YAML only, auditable)
# PR trigger with fork safety
pr:
autoCancel: true # cancel old PR builds when new commit pushed (no resource waste)
branches:
include: [main]
Fork PR security settings (Project Settings → Pipelines → Settings):
# Reference service connection in pipeline — ADO prompts for authorization on first run
# This is the expected security flow — do not skip by granting "all pipelines"
steps:
- task: AzureWebApp@1
inputs:
azureSubscription: Azure-Production-ServiceConnection # authorized pipeline-by-pipeline
appName: myapp-prod
Restrict service connection access (Azure DevOps UI):
Project Settings → Service connections → [connection name] → Security
→ Remove "Allow access to all pipelines"
→ Add only specific pipelines that legitimately need this connection
Service connection best practices:
Contributor on one resource group, not subscription)# Container jobs — isolate pipeline job from agent host
jobs:
- job: Build
pool:
vmImage: ubuntu-latest
container: mcr.microsoft.com/dotnet/sdk:8.0 # runs in container, isolated from host
steps:
- script: dotnet build
# Deploy job — don't check out source code (not needed, reduces attack surface)
- stage: Deploy
jobs:
- deployment: DeployProd
environment: production
strategy:
runOnce:
deploy:
steps:
- checkout: none # explicitly skip source checkout
- download: current
artifact: drop
- task: AzureWebApp@1
# Red flags to look for in pipeline YAML review:
# 1. Inline scripts with sensitive operations (check for hardcoded values)
- script: |
export API_KEY=abc123 # WRONG — hardcoded secret
# 2. Overly permissive chmod
- script: chmod -R 777 /app # WRONG — unnecessary broad permissions
# 3. curl | bash patterns (supply chain risk)
- script: curl https://example.com/install.sh | bash # WRONG — unverified code execution
# 4. Publishing artifacts that may contain secrets
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.SourcesDirectory) # WRONG — may include .env files
artifactName: source # publish only the built output, not source
# CORRECT — publish only the build output directory
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Build.ArtifactStagingDirectory)
artifactName: drop
# List all service connections in project
az devops service-endpoint list \
--project MyProject \
--org https://dev.azure.com/MyOrg \
--output table
# List all pipelines (to review which have access to sensitive connections)
az pipelines list \
--project MyProject \
--org https://dev.azure.com/MyOrg \
--output table
# Show pipeline YAML for review
az pipelines show \
--id 5 \
--project MyProject \
--org https://dev.azure.com/MyOrg
# Review audit log for service connection usage
az devops audit query \
--org https://dev.azure.com/MyOrg \
--start-time "2024-01-01T00:00:00" \
--output table
*** in pipeline logs; only works if variable is marked secretcheckout: none in deploy jobs (source code not needed at deploy time)?curl | bash patterns in pipeline scripts (supply chain risk)?curl | bash patterns in scriptsecho $(SECRET_VARIABLE) in scripts — even with masking, some debug log modes can reveal valuesado-pipeline-design — security principles applied to the pipeline structure designed thereado-pipelines-ops — service connection setup with least-privilege RBAC rolesado-security-policies — branch policies and organization security settings that complement pipeline security