creating-secrets-using-best-practices

Creates AWS Secrets Manager secrets with KMS encryption, rotation, and least-privilege IAM policies.

Updated Jul 21, 2026
One-click install
npx skills add https://github.com/richardnroman/Synthetic-Data-Exchange-Licensing-Platform --skill creating-secrets-using-best-practices-richardnroman
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: creating-secrets-using-best-practices
Source: https://github.com/richardnroman/Synthetic-Data-Exchange-Licensing-Platform/tree/main/.agents/skills/creating-secrets-using-best-practices
Command: npx skills add https://github.com/richardnroman/Synthetic-Data-Exchange-Licensing-Platform --skill creating-secrets-using-best-practices-richardnroman

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Manually provisioning secrets in AWS often skips critical security controls like dedicated KMS keys, automatic rotation, and scoped IAM policies, leaving credentials exposed. This Skill walks you through a complete, security-first procedure for creating secrets in AWS Secrets Manager so nothing important is missed. ## Core Features & Use Cases - Structured Secret Creation: Supports four secret types — database credentials, API keys, OAuth tokens, and custom secrets — each stored in the appropriate JSON structure and encrypted with a dedicated KMS key. - Automatic Rotation & Lifecycle Management: Configures rotation intervals, Lambda rotation functions, recovery windows, and tagging for safe secret lifecycle handling. - Auditing & Least-Privilege Access: Sets up CloudTrail logging, CloudWatch alarms for suspicious access, and read-only IAM policies scoped to specific secret and key ARNs with HTTPS enforcement. - Use Case: You need to store production database credentials for a new application. The Skill creates the secret with a dedicated KMS key, enables 30-day automatic rotation, attaches a least-privilege read policy, and validates retrieval end to end. ## Quick Start Ask the agent to create a new database secret named prod-database-credentials in us-east-1 with automatic 30-day rotation and production tags following security best practices.

Frequently Asked Questions about creating-secrets-using-best-practices

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a secret in AWS Secrets Manager securely?▼

Create the secret with a dedicated KMS key, structure the value by type (database, api-key, oauth, or custom), set a recovery window, and enable automatic rotation. Then attach a least-privilege IAM policy and verify retrieval works before use.

How to set up automatic rotation for AWS Secrets Manager secrets?▼

Enable rotation with a specified interval in days, using the AWS-managed rotation function for database secrets or a custom Lambda function ARN for other types. Verify the function has permissions to access both the secret and the target system, then trigger an initial test rotation.

What IAM permissions are needed to read an AWS secret?▼

A read-only policy needs secretsmanager:GetSecretValue and secretsmanager:DescribeSecret on the specific secret ARN, plus kms:Decrypt and kms:DescribeKey on the KMS key ARN. Include the aws:SecureTransport condition to enforce HTTPS and avoid wildcard resources.

Why does KMS key access fail when reading a Secrets Manager secret?▼

KMS access fails when the key policy does not grant the principal kms:Decrypt and kms:DescribeKey, or when the key is not scoped to the Secrets Manager service. Check that the policy uses the kms:ViaService condition set to secretsmanager.<region>.amazonaws.com.

Can I store OAuth tokens and API keys in AWS Secrets Manager?▼

Yes, Secrets Manager supports api-key and oauth secret types alongside database and custom secrets. API keys are stored as JSON with key and metadata fields, while OAuth secrets use client_id and client_secret structures, all encrypted with KMS.