Skip to content

Commit d4e3e13

Browse files
committed
updates
1 parent 287bc19 commit d4e3e13

10 files changed

Lines changed: 266 additions & 71 deletions

File tree

docs/.vitepress/config.mjs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ export default defineConfig({
3838
items: [
3939
{ text: 'Vaults', link: '/guide/vaults' },
4040
{ text: 'Stages', link: '/guide/stages' },
41-
{ text: 'Contexts', link: '/guide/contexts' },
4241
{ text: 'Templates', link: '/guide/templates' }
4342
]
4443
},

docs/guide/configuration.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@ This command will:
1717
- Set up the basic directory structure for vault configurations
1818

1919
You'll be prompted for:
20-
- **Project name**: A human-readable name for your project
21-
- **Namespace**: A unique identifier (letters, numbers, underscores, hyphens)
20+
- **Project name**: A friendly name for your project
21+
- **Namespace**: A unique identifier (typically a slug of your project name) used as the prefix for secrets
2222
- **Stages**: Environment names (e.g., `development`, `staging`, `production`)
23-
- **Default vault** (optional): The vault to use when none is specified
2423

2524
## Configuration Structure
2625

@@ -45,8 +44,8 @@ The settings file contains your project configuration:
4544
"stages": ["development", "staging", "production"],
4645
"default_vault": "local",
4746
"version": "1.0",
48-
"created_at": "2024-01-01T12:00:00+00:00",
49-
"updated_at": "2024-01-01T12:00:00+00:00"
47+
"created_at": "2025-01-01T12:00:00+00:00",
48+
"updated_at": "2025-01-01T12:00:00+00:00"
5049
}
5150
```
5251

docs/guide/contexts.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

docs/guide/index.md

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,24 @@
11
# Introduction
22

3-
Keep is a toolkit for collaborative, secure management of secrets across applications, environments, and teams. It provides a consistent interface for managing secrets whether they're stored locally during development or in cloud services like AWS SSM Parameter Store or AWS Secrets Manager in production.
3+
Keep is a PHP toolkit for collaborative, secure management of secrets across applications, environments, and teams. It provides a consistent interface for managing secrets whether they're stored locally during development or in cloud services like AWS SSM Parameter Store or AWS Secrets Manager in production.
44

55
## What is Keep?
66

7-
Keep addresses the common challenge of managing environment variables and secrets across different stages of development and deployment. Instead of passing around `.env` files through insecure channels, Keep provides:
7+
Keep addresses the common challenge of managing environment variables and secrets across different stages of development and deployment, between team members and in deployment pipelines.
88

99
- **Centralized Secret Storage**: Store secrets in various backends (local, AWS SSM, AWS Secrets Manager)
1010
- **Environment Staging**: Organize secrets by stages (development, staging, production)
1111
- **Template-Based Generation**: Generate configuration files from templates with proper secret injection
1212
- **Team Collaboration**: Share access to secrets without exposing their values
1313
- **Laravel Integration**: Seamless integration with Laravel applications
1414

15-
## Key Concepts
15+
## Vaults Supported
16+
17+
Keep uses a driver-based architecture to support multiple vaults for storing secrets. Currently, it supports:
1618

17-
### Vaults
18-
Vaults are storage backends for your secrets. Keep supports:
19-
- **Local Vault**: File-based storage for development
2019
- **AWS SSM**: AWS Systems Manager Parameter Store
2120
- **AWS Secrets Manager**: AWS managed secrets service
2221

23-
### Stages
24-
Stages represent different environments like `development`, `staging`, and `production`. Each vault can store secrets for multiple stages, allowing you to promote secrets through your deployment pipeline.
25-
26-
### Contexts
27-
A context combines a vault and stage, written as `vault:stage` (e.g., `myapp:production`). This tells Keep exactly where to find or store a secret.
28-
29-
### Templates
30-
Templates are configuration files with placeholders that get replaced with actual secret values. This allows you to generate `.env` files, configuration files, or any text-based configuration.
31-
3222
## Getting Started
3323

3424
Ready to start using Keep? Head over to the [Installation Guide](./installation) to set up Keep in your project.

docs/guide/installation.md

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,44 @@
22

33
Keep can be installed globally as a standalone CLI tool or as a Composer dependency in your Laravel project.
44

5-
## Global Installation (Recommended)
5+
## Project Installation
66

7-
Install Keep globally using Composer:
7+
It's usually best to install Keep in your local project:
88

99
```bash
10-
composer global require stechstudio/keep
10+
composer require --dev stechstudio/keep
1111
```
1212

13-
Make sure your global Composer vendor bin directory is in your `$PATH`:
13+
Then run Keep commands using:
1414

1515
```bash
16-
export PATH="$PATH:$HOME/.composer/vendor/bin"
16+
./vendor/bin/keep [command]
1717
```
1818

19-
Add this line to your shell profile (`.bashrc`, `.zshrc`, etc.) to make it permanent.
19+
You might appreciate having an alias in your shell profile to make it easier:
20+
21+
```bash
22+
alias keep="./vendor/bin/keep"
23+
```
2024

21-
## Project-Specific Installation
25+
## Global Installation (Optional)
2226

23-
If you prefer to install Keep per project:
27+
If you don't plan to use any framework integration, you can install Keep globally:
2428

2529
```bash
26-
composer require --dev stechstudio/keep
30+
composer global require stechstudio/keep
2731
```
2832

29-
Then run Keep commands using:
33+
Make sure your global Composer vendor bin directory is in your `$PATH`:
3034

3135
```bash
32-
./vendor/bin/keep [command]
33-
```
36+
export PATH="$PATH:$HOME/.composer/vendor/bin"
37+
````
3438

35-
You might enjoy having an alias in your shell profile to make it easier:
39+
Then run Keep commands using:
3640

3741
```bash
38-
alias keep="./vendor/bin/keep"
42+
keep [command]
3943
```
4044

4145
## Laravel Integration (Optional)
@@ -44,10 +48,7 @@ If you're using Keep with a Laravel application, you can publish the configurati
4448
4549
```bash
4650
# Publish configuration
47-
php artisan vendor:publish --provider="STS\Keep\KeepServiceProvider"
48-
49-
# Configure Laravel integration
50-
keep configure --laravel
51+
php artisan vendor:publish --tag=keep-config
5152
```
5253
5354
## Verify Installation

docs/guide/vaults/aws-ssm.md

Lines changed: 231 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,235 @@
11
# AWS SSM Parameter Store
22

3-
*Documentation coming soon*
3+
AWS Systems Manager Parameter Store is a powerful, cost-effective solution for storing configuration data and secrets. It provides secure, hierarchical storage for configuration data management and secrets management.
44

5-
This page will cover the AWS SSM vault driver, including:
5+
## Why Choose SSM Parameter Store?
66

7-
- Parameter Store integration
8-
- Configuration and setup
9-
- Security and encryption
10-
- Cost considerations
7+
**Cost-Effective**: Standard parameters are free (up to 10,000), with Advanced parameters costing only $0.05 per 10,000 API interactions.
8+
9+
**Hierarchical Organization**: Natural path-based organization (`/myapp/production/DB_PASSWORD`) that aligns perfectly with Keep's namespace system.
10+
11+
**Encryption Built-In**: Native integration with AWS KMS for transparent encryption of sensitive values.
12+
13+
**Fine-Grained Access Control**: Leverage AWS IAM for precise control over who can access which parameters in which environments.
14+
15+
**Version History**: Automatic versioning of parameter changes with built-in rollback capabilities.
16+
17+
**Cross-Service Integration**: Native integration with EC2, ECS, Lambda, and other AWS services.
18+
19+
## Adding an SSM Vault
20+
21+
Use the `vault:add` command to configure a new SSM vault:
22+
23+
```bash
24+
keep vault:add
25+
```
26+
27+
You'll be prompted for:
28+
29+
**Driver**: Select "AWS Systems Manager Parameter Store" from the available vaults
30+
31+
**Slug**: A friendly slug for this vault (e.g., `myapp-ssm`) that will be used in template placeholders
32+
33+
**Friendly Name**: A reference name for the vault (e.g., `MyApp SSM Vault`)
34+
35+
**AWS Region**: The AWS region where your parameters will be stored (e.g., `us-east-1`)
36+
37+
**Parameter Prefix**: Optional base path for all parameters. If you specify `myapp`, your parameters will be stored as `/myapp/[namespace]/[stage]/[key]`
38+
39+
**KMS Key ID**: Optional. Leave empty to use AWS managed key (`alias/aws/ssm`), or specify a custom KMS key for additional security
40+
41+
## IAM Permission Scenarios
42+
43+
Let's look at how to set up IAM permissions for different roles in your organization when using AWS SSM Parameter Store with Keep. These examples assume a namespace of "myapp" and use the default KMS key for SSM.
44+
45+
### Full Developer Access
46+
47+
For developers who need complete access to manage secrets across all environments in `myapp`:
48+
49+
```json
50+
{
51+
"Version": "2012-10-17",
52+
"Statement": [
53+
{
54+
"Effect": "Allow",
55+
"Action": [
56+
"ssm:GetParameter",
57+
"ssm:GetParameters",
58+
"ssm:GetParametersByPath",
59+
"ssm:GetParameterHistory",
60+
"ssm:PutParameter",
61+
"ssm:DeleteParameter",
62+
"ssm:LabelParameterVersion",
63+
"ssm:UnlabelParameterVersion"
64+
],
65+
"Resource": "arn:aws:ssm:*:*:parameter/myapp/*"
66+
},
67+
{
68+
"Effect": "Allow",
69+
"Action": [
70+
"kms:Decrypt",
71+
"kms:Encrypt",
72+
"kms:GenerateDataKey"
73+
],
74+
"Resource": [
75+
"arn:aws:kms:*:*:alias/aws/ssm"
76+
]
77+
}
78+
]
79+
}
80+
```
81+
82+
### Environment-Specific Developer Access
83+
84+
For developers who should only access development and staging environments:
85+
86+
```json
87+
{
88+
"Version": "2012-10-17",
89+
"Statement": [
90+
{
91+
"Effect": "Allow",
92+
"Action": [
93+
"ssm:GetParameter",
94+
"ssm:GetParameters",
95+
"ssm:GetParametersByPath",
96+
"ssm:PutParameter",
97+
"ssm:DeleteParameter",
98+
"ssm:GetParameterHistory"
99+
],
100+
"Resource": [
101+
"arn:aws:ssm:*:*:parameter/myapp/development/*",
102+
"arn:aws:ssm:*:*:parameter/myapp/staging/*"
103+
]
104+
},
105+
{
106+
"Effect": "Allow",
107+
"Action": [
108+
"kms:Decrypt",
109+
"kms:Encrypt",
110+
"kms:GenerateDataKey"
111+
],
112+
"Resource": [
113+
"arn:aws:kms:*:*:alias/aws/ssm"
114+
]
115+
}
116+
]
117+
}
118+
```
119+
120+
### Production Deployment (Read-Only)
121+
122+
For production deployment processes that only need to read production secrets:
123+
124+
```json
125+
{
126+
"Version": "2012-10-17",
127+
"Statement": [
128+
{
129+
"Effect": "Allow",
130+
"Action": [
131+
"ssm:GetParameter",
132+
"ssm:GetParameters",
133+
"ssm:GetParametersByPath"
134+
],
135+
"Resource": "arn:aws:ssm:*:*:parameter/myapp/production/*"
136+
},
137+
{
138+
"Effect": "Allow",
139+
"Action": [
140+
"kms:Decrypt"
141+
],
142+
"Resource": [
143+
"arn:aws:kms:*:*:alias/aws/ssm"
144+
]
145+
}
146+
]
147+
}
148+
```
149+
150+
## Parameter Organization
151+
152+
With the example configuration above, Keep will organize your parameters like this:
153+
154+
```
155+
/myapp/
156+
├── development/
157+
│ ├── DB_PASSWORD
158+
│ ├── API_KEY
159+
│ └── NIGHTWATCH_TOKEN
160+
├── staging/
161+
│ ├── DB_PASSWORD
162+
│ ├── API_KEY
163+
│ └── NIGHTWATCH_TOKEN
164+
└── production/
165+
├── DB_PASSWORD
166+
├── API_KEY
167+
└── NIGHTWATCH_TOKEN
168+
```
169+
170+
## Security Best Practices
171+
172+
**Use SecureString Type**: Keep automatically creates parameters as `SecureString` when you mark secrets as secure, ensuring they're encrypted at rest.
173+
174+
**Custom KMS Keys**: For highly sensitive applications, use a custom KMS key instead of the AWS managed key for additional control.
175+
176+
**Least Privilege Access**: Grant only the minimum IAM permissions needed for each role.
177+
178+
**Parameter Naming**: Use consistent, descriptive parameter names that align with your application's configuration.
179+
180+
**Regular Rotation**: Leverage Keep's versioning support to regularly rotate sensitive credentials.
181+
182+
## Cost Considerations
183+
184+
**Standard Parameters**: Free for up to 10,000 parameters, then $0.05 per 10,000 API interactions
185+
186+
**Advanced Parameters**: $0.05 per 10,000 API interactions (allows larger values and parameter policies)
187+
188+
**Storage**: No additional storage costs
189+
190+
**Typical Usage**: Most applications will stay within the free tier for parameter storage, with minimal API interaction costs.
191+
192+
## Common Usage Patterns
193+
194+
### Basic Secret Management
195+
```bash
196+
# Set a production database password
197+
keep set DB_PASSWORD --stage=production
198+
199+
# Retrieve for verification
200+
keep get DB_PASSWORD --stage=production
201+
202+
# Export for deployment
203+
keep export --stage=production --output=.env
204+
```
205+
206+
### Cross-Environment Workflows
207+
```bash
208+
# Copy staging secrets to production
209+
keep copy DB_PASSWORD --from=ssm:staging --to=ssm:production
210+
211+
# Compare environments
212+
keep diff --stage=staging,production
213+
```
214+
215+
### Template-Based Deployment
216+
```bash
217+
# Use secrets in templates
218+
keep merge env.template --stage=production --vault=ssm --output=.env
219+
```
220+
221+
## Troubleshooting
222+
223+
**Access Denied Errors**: Verify your IAM permissions include both SSM and KMS actions for the correct resource paths.
224+
225+
**Parameter Not Found**: Check your parameter prefix and namespace configuration match your expected path structure.
226+
227+
**Encryption Issues**: Ensure your IAM role has access to the KMS key being used (either AWS managed or custom).
228+
229+
**Region Mismatch**: Verify you're operating in the same AWS region where your parameters are stored.
230+
231+
## Next Steps
232+
233+
- [AWS Secrets Manager](./aws-secrets-manager) - For more advanced secret rotation features
234+
- [Template System](../templates) - Learn how to use SSM parameters in templates
235+
- [Multi-Environment Setup](../../examples/multi-environment) - Best practices for organizing environments

0 commit comments

Comments
 (0)