Skip to content

Commit 678f98e

Browse files
committed
Document keep iam command and onboarding flow updates
- Add full keep iam reference to CLI docs - Update init docs to show complete setup flow (vault, workspace, IAM) - Document shell auto-init on first run - Add keep iam callouts to SSM and Secrets Manager IAM sections - Update AWS authentication docs with keep iam generation - Update vault:add docs to mention IAM offer
1 parent 71625e8 commit 678f98e

5 files changed

Lines changed: 79 additions & 3 deletions

File tree

docs/guide/aws-authentication.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,28 @@ deploy:
204204

205205
## IAM Permissions
206206

207-
After setting up authentication, you need to configure IAM permissions for the AWS services Keep will access:
207+
After setting up authentication, you need to configure IAM permissions for the AWS services Keep will access.
208+
209+
### Generate a Policy with `keep iam`
210+
211+
The easiest way to get the right IAM policy is to let Keep generate it for you:
212+
213+
```bash
214+
# Generate policy scoped to your workspace (active vaults and environments)
215+
keep iam
216+
217+
# Generate policy for all vaults and environments
218+
keep iam --all
219+
220+
# Generate and open the AWS IAM console
221+
keep iam --browser
222+
```
223+
224+
The generated policy is scoped to your namespace, vault driver, region, and workspace environments — no manual editing needed.
225+
226+
### Manual Policy Setup
227+
228+
For manual configuration or custom policies, see the detailed IAM examples:
208229

209230
- **For AWS SSM Parameter Store**: See [SSM IAM Permissions](/guide/vaults/aws-ssm#iam-permissions)
210231
- **For AWS Secrets Manager**: See [Secrets Manager IAM Permissions](/guide/vaults/aws-secrets-manager#iam-permissions)

docs/guide/cli/reference.md

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,21 @@ Complete reference for all Keep CLI commands with their options and usage exampl
44

55
## `keep init`
66

7-
Initialize Keep settings and vault connections.
7+
Initialize Keep settings and vault connections. Walks you through the complete setup process.
88

99
| Option | Type | Default | Description |
1010
|--------|------|---------|-------------|
1111
| `--no-interaction` | boolean | `false` | Run without prompts using defaults |
1212

13+
**Setup flow:**
14+
1. Application name and namespace
15+
2. Environment selection (local, staging, production, custom)
16+
3. First vault configuration (driver, region, KMS key)
17+
4. Workspace setup (select your active vaults and environments)
18+
5. IAM policy generation (ready-to-use JSON for AWS)
19+
20+
Each step after vault setup is optional — you can skip and configure later with `keep vault:add`, `keep workspace`, or `keep iam`.
21+
1322
**Examples:**
1423
```bash
1524
# Interactive initialization
@@ -32,7 +41,8 @@ keep vault:add
3241
- Select vault driver (`ssm` or `secretsmanager`)
3342
- Choose a vault slug (short identifier for templates)
3443
- Configure driver-specific settings (region, KMS key, etc.)
35-
- Automatic permission testing after setup
44+
- Automatic credential check and permission testing
45+
- Option to generate IAM policy JSON for the new vault
3646

3747
## `keep vault:list`
3848

@@ -146,6 +156,43 @@ keep workspace
146156
- Filtering is cosmetic only - doesn't affect permissions or access
147157
- Useful for focusing on specific environments or reducing clutter
148158

159+
## `keep iam`
160+
161+
Generate a ready-to-use IAM policy JSON based on your configured vaults, namespace, and workspace.
162+
163+
| Option | Type | Default | Description |
164+
|--------|------|---------|-------------|
165+
| `--vault` | string | *all workspace vaults* | Generate policy for a specific vault only |
166+
| `--all` | boolean | `false` | Include all vaults and environments, ignoring workspace |
167+
| `--browser` | boolean | `false` | Open the AWS IAM console to create a policy |
168+
169+
**Examples:**
170+
```bash
171+
# Generate policy scoped to your workspace
172+
keep iam
173+
174+
# Generate policy for all vaults and environments
175+
keep iam --all
176+
177+
# Generate for a specific vault
178+
keep iam --vault=ssm
179+
180+
# Generate and open the IAM console
181+
keep iam --browser
182+
```
183+
184+
**Output:**
185+
- Shows a summary of namespace, environments, and vaults included
186+
- Outputs a complete IAM policy JSON document ready to paste into the AWS console
187+
- Policy is scoped to your workspace by default (active vaults and environments)
188+
189+
**Notes:**
190+
- The generated policy includes all permissions needed for Keep operations (read, write, list, delete, history)
191+
- SSM policies use resource ARN scoping per environment
192+
- Secrets Manager policies use tag-based access control with environment conditions
193+
- Use `--all` when generating a policy for an admin or CI/CD role that needs access to everything
194+
- This command is offered during `keep init` and `keep vault:add` setup flows
195+
149196
## `keep verify`
150197

151198
Verify vault configuration, authentication, and permissions by running a comprehensive test matrix.
@@ -371,6 +418,8 @@ Start an interactive shell for Keep commands with persistent context.
371418
| `--env` | string | *first configured env* | Initial env to use |
372419
| `--vault` | string | *default vault* | Initial vault to use |
373420

421+
**First Run:** If Keep hasn't been initialized yet, running `keep shell` (or just `keep`) will automatically launch the setup wizard (`keep init`).
422+
374423
### Shell Mode Features
375424

376425
The interactive shell provides:

docs/guide/shell/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ Launch the interactive shell with the `shell` command:
1010
keep shell
1111
```
1212

13+
If Keep hasn't been initialized yet, running `keep shell` (or just `keep` with no arguments) will automatically walk you through the setup process first.
14+
1315
You can also start with a specific vault and env:
1416

1517
```bash

docs/guide/vaults/aws-secrets-manager.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ You'll be prompted for:
3838

3939
## IAM Permission Scenarios
4040

41+
> **Quick start:** Run `keep iam` to generate a ready-to-use IAM policy based on your actual configuration. The examples below are for reference and custom setups.
42+
4143
Keep uses **tag-based permissions** for Secrets Manager to provide fine-grained access control. All secrets are tagged with `ManagedBy=Keep`, `Namespace={namespace}`, `Env={env}`, and `VaultSlug={vault}` for precise permission boundaries.
4244

4345
### Full Developer Access

docs/guide/vaults/aws-ssm.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ You'll be prompted for:
4040

4141
## IAM Permission Scenarios
4242

43+
> **Quick start:** Run `keep iam` to generate a ready-to-use IAM policy based on your actual configuration. The examples below are for reference and custom setups.
44+
4345
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.
4446

4547
### Full Developer Access

0 commit comments

Comments
 (0)