aws-secrets-rotation
自动化 AWS Secrets 轮换,适用于 RDS 和 API 密钥
手动轮换密钥容易出错且常被忽视。本技能提供生产就绪的 Lambda 函数和 AWS CLI 命令,用于自动化数据库和第三方服务的凭据轮换。
下载技能 ZIP
在 Claude 中上传
前往 设置 → 功能 → 技能 → 上传技能
开启并开始使用
测试它
正在使用“aws-secrets-rotation”。 Set up rotation for production RDS credentials
预期结果:
Rotation enabled for prod/db/mysql with 30-day schedule. Lambda function arn:aws:lambda:us-east-1:123456789012:function:SecretsManagerRDSMySQLRotation will automatically rotate credentials. First rotation initiated.
正在使用“aws-secrets-rotation”。 Audit all secrets for rotation compliance
预期结果:
Compliant Secrets: 12
Non-Compliant Secrets: 3
Non-Compliant Details:
- dev/test/api-key: Rotation not enabled
- staging/db/postgres: Not rotated in 127 days
- legacy/service-token: Never rotated
安全审计
安全All 70 static findings are false positives. The skill contains legitimate AWS CLI documentation, Lambda rotation code examples, and compliance tracking scripts. External command patterns are bash examples in markdown code blocks demonstrating AWS API usage. Network references are official AWS and Stripe API endpoints. No malicious patterns detected.
质量评分
你能构建什么
DevOps 工程师自动化数据库凭据轮换
使用 AWS 托管的 Lambda 模板设置生产环境 RDS MySQL 凭据的 30 天自动轮换,并通过 CloudWatch 监控轮换失败。
安全团队实施合规要求
为所有密钥部署轮换策略,生成显示轮换状态的季度合规报告,并为逾期轮换配置告警。
开发者轮换第三方 API 密钥
创建自定义 Lambda 函数,通过调用 Stripe API 生成新密钥、验证新密钥并自动撤销旧凭据来轮换 Stripe API 密钥。
试试这些提示
Create an AWS secret for my production MySQL database with username admin, host mydb.cluster-abc.us-east-1.rds.amazonaws.com, port 3306, and database myapp
Set up automatic rotation every 30 days for my RDS MySQL secret using the AWS-managed Lambda rotation function
Create a Lambda function that rotates Stripe API keys by calling the Stripe API to generate new keys, test them, and revoke old ones
Generate a compliance report listing all secrets without rotation enabled and those not rotated in over 90 days
最佳实践
- 在生产环境部署前,先在非生产环境中测试轮换
- 配置 CloudWatch 告警,在 5 分钟内通知轮换失败
- 维护运行手册,记录受损凭据的紧急轮换流程
避免
- 在应用代码中硬编码密钥,而不是从 Secrets Manager 检索
- 对敏感凭据设置超过 90 天的轮换间隔
- 在未先测试应用兼容性的情况下轮换密钥
常见问题
使用此技能需要哪些 AWS 权限?
这可以为非 AWS 数据库轮换密钥吗?
如果轮换失败会发生什么?
在发生泄露后如何立即轮换密钥?
在轮换期间,应用可以同时访问旧凭据和新凭据吗?
使用自动轮换会产生费用吗?
开发者详情
作者
sickn33许可证
MIT
仓库
https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/security/aws-secrets-rotation引用
main
文件结构
📄 SKILL.md