PluginBench
Skill
Review
Audit score 70

creating-secrets-using-best-practices

aws/agent-toolkit-for-aws

Create and manage AWS Secrets Manager secrets with production-grade security controls and best practices.

What is creating-secrets-using-best-practices?

This skill automates secure secret creation in AWS Secrets Manager with built-in KMS encryption, automatic rotation, least-privilege IAM policies, CloudTrail auditing, and lifecycle management. Use it whenever you need to store sensitive credentials, API keys, OAuth tokens, or custom secrets in production environments.

  • Sets up dedicated KMS encryption keys for each secret
  • Configures automatic rotation for supported secret types
  • Applies least-privilege IAM policies to restrict access
  • Enables CloudTrail auditing for all secret operations
  • Manages secret lifecycle and enforces security controls
  • Supports four secret types: database credentials, API keys, OAuth tokens, and custom secrets

How to install creating-secrets-using-best-practices

npx skills add https://github.com/aws/agent-toolkit-for-aws --skill creating-secrets-using-best-practices
Prerequisites
  • AWS account with Secrets Manager access
  • IAM permissions for kms:CreateKey and kms:PutKeyPolicy
  • Access to target systems for rotation setup (if using automatic rotation)
Claude Code
Cursor
Windsurf
Cline

How to use creating-secrets-using-best-practices

  1. 1.Run the secret creation procedure from references/create-secrets-using-best-practices.md
  2. 2.Select the appropriate secret type: database credentials, API keys, OAuth tokens, or custom secrets
  3. 3.Provide the secret value and metadata
  4. 4.The skill automatically creates a dedicated KMS key with proper policies
  5. 5.Configure automatic rotation if applicable for your secret type
  6. 6.Verify CloudTrail logging is enabled for audit trails

Use cases

Good for
  • Storing database credentials with automatic rotation enabled
  • Creating API keys with dedicated KMS encryption and access logging
  • Managing OAuth tokens with least-privilege IAM policies
  • Setting up secrets for microservices with CloudTrail audit trails
  • Implementing compliance-ready secret management for production workloads
Who it's for
  • DevOps engineers managing production infrastructure
  • Security teams implementing secret management policies
  • AWS architects designing secure credential storage
  • Development teams needing compliant secret handling

creating-secrets-using-best-practices FAQ

What KMS permissions are required?

The IAM principal needs kms:CreateKey and kms:PutKeyPolicy permissions. The KMS key policy must grant kms:GenerateDataKey, kms:Decrypt, and kms:DescribeKey scoped with kms:ViaService to secretsmanager.<region>.amazonaws.com.

How do I troubleshoot rotation setup failures?

Check that the Lambda rotation function exists, has proper permissions, and can reach the target system. Review CloudWatch logs for the rotation function to identify the specific failure.

Why am I getting secret access denied errors?

Verify the IAM policy is attached to the correct principal, the KMS key policy allows decryption and kms:GenerateDataKey, and the principal is using HTTPS for all API calls.

What secret types are supported?

The skill supports four types: database credentials, API keys, OAuth tokens, and custom secrets. Each type is structured appropriately and encrypted with a dedicated KMS key.

Does this skill enable CloudTrail auditing automatically?

Yes, the skill sets up CloudTrail auditing as part of the best practices configuration to log all secret operations for compliance and security monitoring.

Full instructions (SKILL.md)

Source of truth, from aws/agent-toolkit-for-aws.


name: creating-secrets-using-best-practices description: Creates and manages secrets in AWS Secrets Manager following security best practices. Always use this skill when creating secrets — it sets up dedicated KMS encryption keys, automatic rotation, least-privilege IAM policies, CloudTrail auditing, and lifecycle management that are essential for production-grade secret handling. version: 1

Creating Secrets Using Best Practices

Overview

Domain expertise for creating and managing secrets in AWS Secrets Manager with production-grade security controls: KMS encryption, automatic rotation, least-privilege IAM policies, CloudTrail auditing, and lifecycle management.

Create a secret with best practices

To create a properly secured secret in AWS Secrets Manager, follow the procedure exactly. See secret creation procedure.

The procedure supports four secret types: database credentials, API keys, OAuth tokens, and custom secrets. Each type is structured appropriately and encrypted with a dedicated KMS key.

Troubleshooting

KMS key access issues

Verify the IAM principal has kms:CreateKey and kms:PutKeyPolicy permissions, and that the key policy grants kms:GenerateDataKey, kms:Decrypt, and kms:DescribeKey scoped with kms:ViaService to secretsmanager.<region>.amazonaws.com. See the full procedure for details.

Rotation setup failures

Check that the Lambda rotation function exists, has proper permissions, and can reach the target system. Review CloudWatch logs for the rotation function.

Secret access denied

Verify the IAM policy is attached to the correct principal, the KMS key policy allows decryption (and kms:GenerateDataKey for write/rotation), and the principal is using HTTPS. See the full procedure for details.

Related skills

More from aws/agent-toolkit-for-aws and the wider catalog.