code-review
Comprehensive code review with actionable feedback using extended thinking
Comprehensive audit of permissions and security configuration
> /plugin marketplace add aws-solutions-library-samples/guidance-for-claude-code-with-amazon-bedrockHow it fires
How this command gets triggered: by you, by Claude, or both.
/permission-auditContext preview
What this command does when you run it.
Comprehensive audit of permissions and security configuration
name: permission-audit description: Comprehensive audit of permissions and security configuration version: 1.0.0 argument-hint: "[--quick|--comprehensive] [focus-area]"
You are a security auditor specializing in permission management and access control. Perform comprehensive security audits of Claude Code configurations and project permissions.
$ARGUMENTS
Parse the arguments to determine:
Deploy concurrent security specialists: @security-reviewer @qa-engineer @business-analyst
# Check for overly permissive files
find . -type f -perm /go+w -exec ls -la {} \;
# Identify sensitive files with wrong permissions
find . -name "*.key" -o -name "*.pem" -o -name ".env*" | \
xargs ls -la | grep -v "^-rw-------"
# Check for setuid/setgid files
find . -type f \( -perm -4000 -o -perm -2000 \) -exec ls -la {} \;{
"audit_checks": {
"settings_review": [
"Check for --dangerously-skip-permissions usage",
"Verify trusted_directories are appropriate",
"Ensure auto_approve settings are secure",
"Validate network access restrictions"
],
"permission_levels": [
"Verify principle of least privilege",
"Check for unnecessary elevated permissions",
"Audit tool-specific permissions",
"Review agent model permissions"
]
}
}def scan_for_secrets():
"""Scan codebase for hardcoded secrets"""
patterns = [
r'api[_-]?key\s*=\s*["\'][^"\']{20,}["\']',
r'password\s*=\s*["\'][^"\']+["\']',
r'token\s*=\s*["\'][^"\']{20,}["\']',
r'AWS[A-Z0-9]{16,}',
r'-----BEGIN (RSA|DSA|EC|PGP) PRIVATE KEY-----'
]
findings = []
for pattern in patterns:
# Scan all files for pattern
matches = scan_files(pattern)
if matches:
findings.append({
'type': 'secret_detected',
'pattern': pattern,
'files': matches,
'severity': 'critical'
})
return findings# Check gh CLI configuration gh auth status # Verify no dangerous aliases gh alias list | grep -E "force|--hard|delete" # Check repository permissions gh api user/permissions # Verify SSH key configuration ssh -T git@github.com
# Python dependencies pip-audit --desc # Node.js dependencies npm audit --json # Check for outdated packages pip list --outdated npm outdated
1. **Finding**: Description
Directory Permissions: ├── src/ (755) ✓ Appropriate ├── tests/ (755) ✓ Appropriate ├── .env (644) ✗ Too permissive - should be 600 └── secrets/ (777) ✗ Critical - world writable
{
"claude_settings": {
"security_score": 75,
"issues": [
{
"setting": "auto_approve_write",
"current": true,
"recommended": false,
"risk": "Automatic file modifications without review"
}
]
}
}1. Remove hardcoded secrets from code 2. Fix world-writable directories 3. Rotate compromised credentials 4. Enable audit logging
1. Implement proper secret management 2. Configure file permission policies 3. Set up security monitoring 4. Update vulnerable dependencies
1. Implement zero-trust architecture 2. Set up continuous security scanning 3. Develop incident response plan 4. Conduct security training
#!/bin/bash
# fix-permissions.sh
echo "Fixing file permissions..."
# Fix sensitive files
find . -name "*.key" -exec chmod 600 {} \;
find . -name "*.pem" -exec chmod 600 {} \;
find . -name ".env*" -exec chmod 600 {} \;
# Fix directories
find . -type d -exec chmod 755 {} \;
# Remove world-writable permissions
find . -type f -perm /o+w -exec chmod o-w {} \;
echo "Permissions fixed!"{
"recommended_settings": {
"file_access": {
"default_permission": "prompt",
"auto_approve_read": false,
"auto_approve_write": false
},
"network_access": {
"require_https": true,
"verify_certificates": true,
"timeout_seconds": 30
},
"command_execution": {
"require_confirmation": true,
"block_dangerous_commands": true,
"auditThis guidance enables enterprise deployment of Claude Code and Claude Cowork on Amazon Bedrock across command-line (CLI) and desktop surfaces — with secure single sign-on (SSO), usage monitoring, and cost controls.
Comprehensive code review with actionable feedback using extended thinking
Complete architecture design and documentation workflow using simple-architect and simple-architecture-documenter agents in…
Intelligent refactoring with strategic thinking and parallel analysis
Create comprehensive documentation with intelligent type detection and orchestration
Create in-depth explanations that build conceptual understanding of complex topics
Create practical how-to guides for solving specific problems and accomplishing tasks