You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -8,20 +8,8 @@ A CLI tool for elevating cloud permissions (Azure, AWS) via CyberArk Secure Clou
8
8
9
9
`grant` enables terminal-based cloud permission elevation (Azure, AWS) through CyberArk SCA. It wraps the `idsec-sdk-golang` SDK for authentication and builds a custom SCA Access API client for JIT role elevation.
10
10
11
-
**Key Features:**
12
-
- Multi-CSP support (Azure, AWS) with concurrent eligibility queries
13
-
- Interactive permission elevation with fuzzy search
14
-
- Direct elevation with target and role flags
15
-
- AWS credential export via `grant env` for shell integration
16
-
- Favorites management for frequently used roles
17
-
- Entra ID group membership elevation via `grant --group` or `grant --groups`
18
-
- Session revocation via `grant revoke`
19
-
- Session status monitoring
20
-
- Eligible target discovery via `grant list`
21
-
- Local eligibility cache with configurable TTL
22
-
- Machine-readable JSON output (`--output json`)
23
-
- TTY detection with fail-fast for non-interactive environments
24
-
- Secure token storage in system keyring
11
+
-**Azure:** SCA creates a JIT RBAC role assignment — your existing `az` CLI session picks up the elevated permissions automatically.
12
+
-**AWS:** SCA returns temporary credentials. Use `grant env` to export them: `eval $(grant env --provider aws)`
25
13
26
14
## Usage
27
15
@@ -52,7 +40,6 @@ grant --group "Cloud Admins"
52
40
# List eligible targets (no elevation)
53
41
grant list
54
42
grant list --provider azure
55
-
grant list --groups
56
43
grant list --output json
57
44
58
45
# Check active sessions
@@ -62,36 +49,30 @@ grant status
62
49
grant revoke # interactive multi-select
63
50
grant revoke <session-id># direct by ID
64
51
grant revoke --all # revoke all
65
-
grant revoke --all --provider azure # revoke all for a specific provider
66
52
```
67
53
54
+

55
+
68
56
## Installation
69
57
70
58
### Binary Releases (Recommended)
71
59
72
60
Download pre-built binaries from the [Releases](https://github.com/aaearon/grant-cli/releases) page.
tar xzf "grant-cli_${VERSION}_${OS}_${ARCH}.tar.gz"
84
68
sudo mv grant /usr/local/bin/
85
-
```
86
69
87
-
**Windows:**
88
-
Download the appropriate `grant-cli_<version>_windows_<arch>.zip` from [releases](https://github.com/aaearon/grant-cli/releases) and extract to a directory in your PATH.
89
-
90
-
**Updating:**
91
-
```bash
70
+
# Self-update
92
71
grant update
93
72
```
94
73
74
+
**Windows:** Download `grant-cli_<version>_windows_<arch>.zip` from [releases](https://github.com/aaearon/grant-cli/releases) and extract to a directory in your PATH.
75
+
95
76
### Go Install
96
77
97
78
```bash
@@ -108,160 +89,36 @@ make build
108
89
109
90
## Commands
110
91
111
-
Running `grant` with no subcommand elevates cloud permissions (the core behavior). Subcommands are listed below.
92
+
Running `grant` with no subcommand elevates cloud permissions (the core behavior).
112
93
113
94
| Command | Description |
114
95
|---------|-------------|
115
-
|`configure`| Configure or reconfigure Identity URL and username (optional — `login` auto-configures on first run) |
- Performs the full elevation flow (interactive, direct, or favorite mode)
153
-
- Outputs only shell `export` statements (no human-readable messages)
154
-
- Designed for AWS elevations — returns an error for Azure (which doesn't return credentials)
155
-
156
-
Supports the same flags as the root command: `--provider`, `--target`, `--role`, `--favorite`, `--refresh`.
157
-
158
-
### list
159
-
160
-
List eligible cloud targets and Entra ID groups without triggering elevation. Useful for discovering what you can elevate to, and for programmatic consumption via JSON output.
161
-
162
-
```bash
163
-
grant list # all targets and groups
164
-
grant list --provider azure # cloud targets for a specific provider
165
-
grant list --groups # Entra ID groups only
166
-
grant list --output json # machine-readable JSON
167
-
grant list --refresh # bypass eligibility cache
168
-
```
169
-
170
-
**Flags:**
171
-
-`--provider, -p` — Filter by cloud provider: `azure`, `aws`
172
-
-`--groups` — Show only Entra ID groups (mutually exclusive with `--provider`)
173
-
-`--refresh` — Bypass eligibility cache and fetch fresh data
174
-
175
-
### login
176
-
177
-
Authenticate to CyberArk Identity with MFA.
178
-
179
-
```bash
180
-
grant login
181
-
```
182
-
183
-
On first run, prompts for Identity URL and username (auto-configures). Authenticates with password and MFA (method selected interactively), then stores tokens in the system keyring. Tokens are automatically refreshed during operations.
184
-
185
-
### logout
186
-
187
-
Clear all cached tokens from the system keyring.
188
-
189
-
```bash
190
-
grant logout
191
-
```
192
-
193
-
This removes stored authentication tokens but preserves your configuration files.
194
-
195
-
### Default Behavior (Elevate)
196
-
197
-
Running `grant` with no subcommand requests JIT (just-in-time) permission elevation for cloud resources. Supports interactive, direct (`--target`/`--role`), and favorite (`--favorite`) modes as shown in the [Usage](#usage) section.
198
-
199
-
**Flags:**
200
-
-`--provider, -p` — Cloud provider: `azure`, `aws` (omit to show all providers)
201
-
-`--target, -t` — Target name (subscription, resource group, account, etc.)
202
-
-`--role, -r` — Role name (e.g., "Contributor", "Reader", "AdministratorAccess")
203
-
-`--favorite, -f` — Use a saved favorite alias (combines provider, target, and role)
204
-
-`--groups` — Show only Entra ID groups in the interactive selector
205
-
-`--group, -g` — Group name for direct group membership elevation
206
-
-`--refresh` — Bypass eligibility cache and fetch fresh data
207
-
208
-
**Target matching:**
209
-
- Matches by workspace name (case-insensitive, partial match)
210
-
- Interactive mode provides fuzzy search
211
-
- Shows workspace type (subscription, resource group, etc.) and available roles
212
-
213
-
**How it works:**
214
-
-**Azure:** SCA creates a JIT Azure RBAC role assignment. Your existing `az` CLI session automatically picks up the elevated permissions — no credentials are returned.
Display authentication state and active elevation sessions.
110
+
**Global:**`--verbose, -v` (detailed output) | `--output, -o` (`text` or `json`)
220
111
221
-
```bash
222
-
grant status
223
-
grant status --provider azure # filter by Azure
224
-
grant status --provider aws # filter by AWS
225
-
```
226
-
227
-
### favorites
228
-
229
-
Manage saved role combinations for quick elevation.
230
-
231
-
**Add a favorite (interactive):**
232
-
```bash
233
-
grant favorites add <name>
234
-
```
235
-
Fetches your eligible targets from SCA and presents an interactive selector with fuzzy search — the same experience as `grant` elevation. Select a target/role combination and it's saved as a favorite.
236
-
237
-
**Add a favorite (non-interactive):**
238
-
```bash
239
-
grant favorites add <name> --target "Prod-EastUS" --role "Contributor"
240
-
grant favorites add <name> -t "MyResourceGroup" -r "Owner" -p azure
241
-
```
242
-
When `--target` and `--role` are both provided, the interactive selector is skipped and no authentication is required.
243
-
Provider defaults to the config value (azure) if omitted.
244
-
245
-
**List favorites:**
246
-
```bash
247
-
grant favorites list
248
-
```
249
-
Shows all saved favorites with their provider, target, and role.
0 commit comments