Kiro
Kiro copied to clipboard
Allow trustedCommands wildcards in the middle of command strings and within command words
Feature Description
Current Limitation Currently, wildcards (*) in trustedCommands only work:
- At the end of a command
- Must be preceded by a space
- Example: aws ec2 describe-dhcp-options * ✅
- Cannot do: aws * describe* ❌
Requested Enhancement Be able to use wildcards:
- In the middle of commands: aws * describe*
- Within command words: describe* (without requiring a space before the *)
- This would allow patterns like:
- aws * describe* - All AWS describe commands
- aws ec2 * - All AWS EC2 commands
- git * - All git commands
- kubectl get * - All kubectl get commands
Benefits
- Easier Maintenance: One pattern instead of dozens of individual commands
- Faster Setup: Quickly grant broad permissions with patterns
- More Flexible: Better control over what Kiro can do autonomously
- Reduced Errors: Fewer entries means less chance of typos or missing commands
Use Case
Before (Current):
{
"trustedCommands": [
"aws ec2 describe-instances *",
"aws ec2 describe-vpcs *",
"aws ec2 describe-subnets *",
"aws ec2 describe-security-groups *",
"aws ec2 describe-dhcp-options *",
"aws ec2 describe-vpc-endpoints *",
"aws iam list-roles *",
"aws iam list-policies *",
"aws iam get-role *"
]
}
After (Proposed):
{
"trustedCommands": [
"aws * describe* *",
"aws * list* *",
"aws * get* *"
]
}
Additional Context
The wildcard matching could work similar to glob patterns:
- * matches any sequence of characters (including none)
- Wildcards can appear anywhere in the pattern
- Multiple wildcards in a single pattern are supported
- Matching is done word-by-word or character-by-character depending on position
Pattern Matching Examples:
- aws * describe* matches:
- aws ec2 describe-instances
- aws s3 describe-bucket
- aws iam describe-role
- git * matches:
- git status
- git commit -m "message"
- git push origin main
Security Considerations
While this makes the feature more powerful, it's important to note:
- Broader permissions: Patterns like aws * would allow ALL AWS commands
- Review carefully: Users should understand what each pattern permits
- Start narrow: Begin with specific patterns and broaden as needed
- Documentation: Clear examples of safe vs. risky patterns
+1