Scans DAPR projects for security issues including plain-text secrets, missing ACLs, insecure configurations, and security best practice violations. Automatically triggers on component file modifications.
This skill inherits all available tools. When active, it can use any tool Claude has access to.
Proactively scan DAPR configurations for security vulnerabilities and best practice violations.
This skill should be invoked:
Scan for hardcoded credentials in component files:
# BAD - Plain text secret
- name: connectionString
value: "Server=myserver;Password=secret123"
# GOOD - Using secret reference
- name: connectionString
secretKeyRef:
name: db-secrets
key: connectionString
Check for:
password, secret, key, token, credential in value fieldsVerify sensitive fields use secretKeyRef:
# Required for these field patterns:
- *password*
- *secret*
- *key* (except keyName for crypto)
- *token*
- *credential*
- connectionString
- accessKey
- apiKey
Check that sensitive components have scopes defined:
# Components requiring scopes:
- secretstores.* - MUST have scopes
- state.* with sensitive data - SHOULD have scopes
- pubsub.* - SHOULD have scopes
- bindings.* with write access - SHOULD have scopes
Flag connection string usage when managed identity is available:
# Azure components should prefer:
- azureClientId (for managed identity)
# Over:
- connectionString
- accountKey
Verify access control is properly configured:
accessControl in Configuration resourcesdefaultAction: deny is setCheck mutual TLS settings:
spec:
mtls:
enabled: true # Should be true for production
Verify resiliency policies exist for production:
python scripts/security-scan.py path/to/component.yaml
python scripts/security-scan.py components/
python scripts/security-scan.py --report security-report.json
| Severity | Description | Examples |
|---|---|---|
| CRITICAL | Immediate security risk | Plain-text passwords, exposed API keys |
| HIGH | Significant vulnerability | Missing scopes on secret stores, no mTLS |
| MEDIUM | Security improvement needed | No resiliency policies, missing ACLs |
| LOW | Best practice recommendation | Using connection strings vs managed identity |
{
"scan_time": "2024-01-01T12:00:00Z",
"files_scanned": 5,
"issues": [
{
"severity": "CRITICAL",
"file": "components/statestore.yaml",
"line": 15,
"message": "Plain-text password detected in 'redisPassword'",
"recommendation": "Use secretKeyRef instead of value"
}
],
"summary": {
"critical": 1,
"high": 0,
"medium": 2,
"low": 3
}
}
For common issues, suggest automatic fixes:
# Before
- name: password
value: "mysecret"
# After (suggested)
- name: password
secretKeyRef:
name: app-secrets
key: password
# Before
spec:
type: secretstores.azure.keyvault
...
# After (suggested)
spec:
type: secretstores.azure.keyvault
...
scopes:
- app-id-1
The security scanner can be integrated into CI/CD pipelines:
# GitHub Actions example
- name: DAPR Security Scan
run: python scripts/security-scan.py components/ --fail-on critical
Exit codes: