bt-cli 0.4.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. bt_cli/__init__.py +3 -0
  2. bt_cli/cli.py +830 -0
  3. bt_cli/commands/__init__.py +1 -0
  4. bt_cli/commands/configure.py +415 -0
  5. bt_cli/commands/learn.py +229 -0
  6. bt_cli/commands/quick.py +784 -0
  7. bt_cli/core/__init__.py +1 -0
  8. bt_cli/core/auth.py +213 -0
  9. bt_cli/core/client.py +313 -0
  10. bt_cli/core/config.py +393 -0
  11. bt_cli/core/config_file.py +420 -0
  12. bt_cli/core/csv_utils.py +91 -0
  13. bt_cli/core/errors.py +247 -0
  14. bt_cli/core/output.py +205 -0
  15. bt_cli/core/prompts.py +87 -0
  16. bt_cli/core/rest_debug.py +221 -0
  17. bt_cli/data/CLAUDE.md +88 -0
  18. bt_cli/data/__init__.py +0 -0
  19. bt_cli/data/skills/bt/SKILL.md +98 -0
  20. bt_cli/data/skills/entitle/SKILL.md +159 -0
  21. bt_cli/data/skills/epmw/SKILL.md +145 -0
  22. bt_cli/data/skills/pra/SKILL.md +149 -0
  23. bt_cli/data/skills/pws/SKILL.md +197 -0
  24. bt_cli/entitle/__init__.py +1 -0
  25. bt_cli/entitle/client/__init__.py +5 -0
  26. bt_cli/entitle/client/base.py +443 -0
  27. bt_cli/entitle/commands/__init__.py +24 -0
  28. bt_cli/entitle/commands/accounts.py +53 -0
  29. bt_cli/entitle/commands/applications.py +39 -0
  30. bt_cli/entitle/commands/auth.py +68 -0
  31. bt_cli/entitle/commands/bundles.py +218 -0
  32. bt_cli/entitle/commands/integrations.py +60 -0
  33. bt_cli/entitle/commands/permissions.py +70 -0
  34. bt_cli/entitle/commands/policies.py +97 -0
  35. bt_cli/entitle/commands/resources.py +131 -0
  36. bt_cli/entitle/commands/roles.py +74 -0
  37. bt_cli/entitle/commands/users.py +123 -0
  38. bt_cli/entitle/commands/workflows.py +187 -0
  39. bt_cli/entitle/models/__init__.py +31 -0
  40. bt_cli/entitle/models/bundle.py +28 -0
  41. bt_cli/entitle/models/common.py +37 -0
  42. bt_cli/entitle/models/integration.py +30 -0
  43. bt_cli/entitle/models/permission.py +27 -0
  44. bt_cli/entitle/models/policy.py +25 -0
  45. bt_cli/entitle/models/resource.py +29 -0
  46. bt_cli/entitle/models/role.py +28 -0
  47. bt_cli/entitle/models/user.py +24 -0
  48. bt_cli/entitle/models/workflow.py +55 -0
  49. bt_cli/epmw/__init__.py +1 -0
  50. bt_cli/epmw/client/__init__.py +5 -0
  51. bt_cli/epmw/client/base.py +848 -0
  52. bt_cli/epmw/commands/__init__.py +33 -0
  53. bt_cli/epmw/commands/audits.py +250 -0
  54. bt_cli/epmw/commands/auth.py +55 -0
  55. bt_cli/epmw/commands/computers.py +140 -0
  56. bt_cli/epmw/commands/events.py +233 -0
  57. bt_cli/epmw/commands/groups.py +215 -0
  58. bt_cli/epmw/commands/policies.py +673 -0
  59. bt_cli/epmw/commands/quick.py +348 -0
  60. bt_cli/epmw/commands/requests.py +224 -0
  61. bt_cli/epmw/commands/roles.py +78 -0
  62. bt_cli/epmw/commands/tasks.py +38 -0
  63. bt_cli/epmw/commands/users.py +219 -0
  64. bt_cli/epmw/models/__init__.py +1 -0
  65. bt_cli/pra/__init__.py +1 -0
  66. bt_cli/pra/client/__init__.py +5 -0
  67. bt_cli/pra/client/base.py +618 -0
  68. bt_cli/pra/commands/__init__.py +30 -0
  69. bt_cli/pra/commands/auth.py +55 -0
  70. bt_cli/pra/commands/import_export.py +442 -0
  71. bt_cli/pra/commands/jump_clients.py +139 -0
  72. bt_cli/pra/commands/jump_groups.py +146 -0
  73. bt_cli/pra/commands/jump_items.py +638 -0
  74. bt_cli/pra/commands/jumpoints.py +95 -0
  75. bt_cli/pra/commands/policies.py +197 -0
  76. bt_cli/pra/commands/quick.py +470 -0
  77. bt_cli/pra/commands/teams.py +81 -0
  78. bt_cli/pra/commands/users.py +87 -0
  79. bt_cli/pra/commands/vault.py +564 -0
  80. bt_cli/pra/models/__init__.py +27 -0
  81. bt_cli/pra/models/common.py +12 -0
  82. bt_cli/pra/models/jump_client.py +25 -0
  83. bt_cli/pra/models/jump_group.py +15 -0
  84. bt_cli/pra/models/jump_item.py +72 -0
  85. bt_cli/pra/models/jumpoint.py +19 -0
  86. bt_cli/pra/models/team.py +14 -0
  87. bt_cli/pra/models/user.py +17 -0
  88. bt_cli/pra/models/vault.py +45 -0
  89. bt_cli/pws/__init__.py +1 -0
  90. bt_cli/pws/client/__init__.py +5 -0
  91. bt_cli/pws/client/base.py +356 -0
  92. bt_cli/pws/client/beyondinsight.py +869 -0
  93. bt_cli/pws/client/passwordsafe.py +1786 -0
  94. bt_cli/pws/commands/__init__.py +33 -0
  95. bt_cli/pws/commands/accounts.py +372 -0
  96. bt_cli/pws/commands/assets.py +311 -0
  97. bt_cli/pws/commands/auth.py +166 -0
  98. bt_cli/pws/commands/clouds.py +221 -0
  99. bt_cli/pws/commands/config.py +344 -0
  100. bt_cli/pws/commands/credentials.py +347 -0
  101. bt_cli/pws/commands/databases.py +306 -0
  102. bt_cli/pws/commands/directories.py +199 -0
  103. bt_cli/pws/commands/functional.py +298 -0
  104. bt_cli/pws/commands/import_export.py +452 -0
  105. bt_cli/pws/commands/platforms.py +118 -0
  106. bt_cli/pws/commands/quick.py +1646 -0
  107. bt_cli/pws/commands/search.py +256 -0
  108. bt_cli/pws/commands/secrets.py +1343 -0
  109. bt_cli/pws/commands/systems.py +389 -0
  110. bt_cli/pws/commands/users.py +415 -0
  111. bt_cli/pws/commands/workgroups.py +166 -0
  112. bt_cli/pws/config.py +18 -0
  113. bt_cli/pws/models/__init__.py +19 -0
  114. bt_cli/pws/models/account.py +186 -0
  115. bt_cli/pws/models/asset.py +102 -0
  116. bt_cli/pws/models/common.py +132 -0
  117. bt_cli/pws/models/system.py +121 -0
  118. bt_cli-0.4.7.dist-info/METADATA +172 -0
  119. bt_cli-0.4.7.dist-info/RECORD +121 -0
  120. bt_cli-0.4.7.dist-info/WHEEL +4 -0
  121. bt_cli-0.4.7.dist-info/entry_points.txt +2 -0
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: pra
3
+ description: Privileged Remote Access commands for jump items, vault accounts, and remote sessions. Use when working with PRA shell jumps, RDP, protocol tunnels, or SSH CA authentication.
4
+ ---
5
+
6
+ # PRA Commands (`bt pra`)
7
+
8
+ ## IMPORTANT: Destructive Operations
9
+
10
+ **ALWAYS confirm with the user before:**
11
+ - `bt pra jump-items shell delete` - Deletes shell jump item
12
+ - `bt pra jump-items rdp delete` - Deletes RDP jump item
13
+ - `bt pra jump-items tunnel delete` - Deletes protocol tunnel
14
+ - `bt pra jump-groups delete` - Deletes jump group
15
+ - `bt pra vault accounts delete` - Deletes vault account
16
+
17
+ List affected resources first, then ask for explicit confirmation.
18
+
19
+ ## Quick Commands
20
+
21
+ ```bash
22
+ # Vault credential checkout
23
+ bt pra quick vault # Interactive - shows accounts, prompts
24
+ bt pra quick vault -n "server-admin"
25
+ bt pra quick vault -n postgres --raw
26
+
27
+ # Search jump items and vault
28
+ bt pra quick search axion
29
+ bt pra quick search admin -o json
30
+ ```
31
+
32
+ ## Jump Items
33
+
34
+ ### Shell Jump (SSH/Telnet)
35
+
36
+ ```bash
37
+ bt pra jump-items shell list
38
+ bt pra jump-items shell get 55
39
+ bt pra jump-items shell create \
40
+ --name "web-server-01" \
41
+ --hostname "10.0.1.50" \
42
+ --jumpoint 3 \
43
+ --jump-group 24 \
44
+ --protocol ssh \
45
+ --port 22 \
46
+ --username "ec2-admin"
47
+ bt pra jump-items shell delete 55
48
+ ```
49
+
50
+ ### RDP Jump
51
+
52
+ ```bash
53
+ bt pra jump-items rdp list
54
+ bt pra jump-items rdp get 1
55
+ bt pra jump-items rdp create \
56
+ --name "win-server-01" \
57
+ --hostname "10.0.2.10" \
58
+ --jumpoint 3 \
59
+ --jump-group 31 \
60
+ --port 3389
61
+ ```
62
+
63
+ ### Protocol Tunnels (TCP/MSSQL/K8s)
64
+
65
+ ```bash
66
+ bt pra jump-items tunnel list
67
+ bt pra jump-items tunnel create \
68
+ --name "production-k8s" \
69
+ --hostname "k8s-api.example.com" \
70
+ --jumpoint 3 \
71
+ --jump-group 24 \
72
+ --type k8s \
73
+ --url "https://k8s-api.example.com:6443" \
74
+ --ca-cert "$(cat /path/to/ca.crt)"
75
+ ```
76
+
77
+ ## Jump Groups
78
+
79
+ ```bash
80
+ bt pra jump-groups list
81
+ bt pra jump-groups get 24
82
+ bt pra jump-groups create \
83
+ --name "Customer-05 (Bing7)" \
84
+ --code-name bing7 \
85
+ --comments "Demo customer"
86
+ bt pra jump-groups delete 30
87
+ ```
88
+
89
+ ## Vault Accounts
90
+
91
+ ```bash
92
+ bt pra vault accounts list
93
+ bt pra vault accounts get 6
94
+ bt pra vault accounts checkout 6
95
+ bt pra vault accounts checkin 6
96
+ bt pra vault accounts rotate 6
97
+
98
+ # SSH CA - get public key for provisioning
99
+ bt pra vault accounts get-public-key 31
100
+ ```
101
+
102
+ ## SSH CA Authentication
103
+
104
+ PRA supports SSH CA for ephemeral access - no static keys on hosts.
105
+
106
+ ```bash
107
+ # Get CA public key (ready for authorized_keys)
108
+ bt pra vault accounts get-public-key 31
109
+ # Output: cert-authority ssh-rsa AAAAB3NzaC1yc2E...
110
+
111
+ # Provision EC2 with SSH CA
112
+ PRA_CA_KEY=$(bt pra vault accounts get-public-key 31)
113
+ # Embed in user-data script for EC2
114
+ ```
115
+
116
+ **SSH CA Vault Accounts:**
117
+ | ID | Name | Username |
118
+ |----|------|----------|
119
+ | 3 | Ephemeral Admin SSH CA | admin-ephemeral |
120
+ | 31 | ec2-admin | ec2-admin |
121
+
122
+ ## CSV Import/Export
123
+
124
+ ```bash
125
+ bt pra export jump-items --file jump-items-template.csv
126
+ bt pra export vault-accounts --file vault-accounts-template.csv
127
+ bt pra import jump-items --file jump-items.csv --dry-run
128
+ bt pra import jump-items --file jump-items.csv
129
+ ```
130
+
131
+ ## Key IDs
132
+
133
+ | Resource | ID |
134
+ |----------|-----|
135
+ | Jumpoint: Data Center 01 | 2 |
136
+ | Jumpoint: AWS Account | 3 |
137
+ | Jump Group: Datacenter 01 (West) | 1 |
138
+ | Jump Group: Customer-01 (Axion) | 24 |
139
+ | Jump Group: Customer-02 (Meridian) | 25 |
140
+ | Jump Group: Cloud Containers | 26 |
141
+ | Vault: ec2-admin (SSH CA) | 31 |
142
+
143
+ ## API Notes
144
+
145
+ - Base path: `/api/config/v1`
146
+ - Pagination: `per_page`/`current_page` (1-indexed)
147
+ - Response: Array directly (pagination in headers)
148
+ - Jump item types have separate endpoints
149
+ - K8s tunnels require Linux jumpoint
@@ -0,0 +1,197 @@
1
+ ---
2
+ name: pws
3
+ description: Password Safe commands for credentials, systems, accounts, secrets, and user management. Use when working with PWS checkouts, managed systems, Secrets Safe, or credential rotation.
4
+ ---
5
+
6
+ # Password Safe Commands (`bt pws`)
7
+
8
+ ## IMPORTANT: Destructive Operations
9
+
10
+ **ALWAYS confirm with the user before:**
11
+ - `bt pws systems delete` - Deletes managed system
12
+ - `bt pws accounts delete` - Deletes managed account
13
+ - `bt pws secrets safes delete` - Deletes entire safe
14
+ - `bt pws secrets folders delete` - Deletes folder and contents
15
+ - `bt pws quick offboard` - Removes system + accounts + asset
16
+
17
+ List affected resources first, then ask for explicit confirmation.
18
+
19
+ ## Quick Commands (Most Common)
20
+
21
+ ```bash
22
+ # Checkout credentials
23
+ bt pws quick checkout -s "axion-finapp-01" -a "root"
24
+ bt pws quick checkout -s axion -a root --duration 30 --reason "Maintenance"
25
+ PASSWORD=$(bt pws quick checkout -s server -a admin --raw)
26
+
27
+ # Check in
28
+ bt pws quick checkin 17
29
+ bt pws quick checkin 17 --rotate
30
+
31
+ # Quick password lookup with auto-checkin
32
+ bt pws quick password -s "axion-finapp-01" -a "root"
33
+
34
+ # Search systems and accounts
35
+ bt pws quick search axion
36
+ bt pws quick search root -o json
37
+
38
+ # Rotate password
39
+ bt pws quick rotate -s "axion-finapp-01" -a "root"
40
+
41
+ # Onboard system (asset + system + account)
42
+ bt pws quick onboard -n "my-server" -i "10.0.1.50" -w 3
43
+ bt pws quick onboard -n "web-01" -i "10.0.1.100" -w 3 -f 7 -e "sudo"
44
+
45
+ # Offboard system
46
+ bt pws quick offboard -s "my-server"
47
+ bt pws quick offboard -s "web-01" --force
48
+ ```
49
+
50
+ ## Systems & Accounts
51
+
52
+ ```bash
53
+ # List systems
54
+ bt pws systems list
55
+ bt pws systems list --workgroup 3
56
+ bt pws systems list -o json
57
+
58
+ # Get system details
59
+ bt pws systems get 22
60
+
61
+ # List accounts on a system
62
+ bt pws accounts list --system 22
63
+ bt pws accounts get 45
64
+ ```
65
+
66
+ ## Secrets Safe
67
+
68
+ ```bash
69
+ # Safes
70
+ bt pws secrets safes list
71
+ bt pws secrets safes create --name "MyApp" --description "App credentials"
72
+ bt pws secrets safes delete <safe_id>
73
+
74
+ # Folders
75
+ bt pws secrets folders list
76
+ bt pws secrets folders create --name "Database" --parent <safe_id>
77
+ bt pws secrets folders delete <folder_id>
78
+
79
+ # Secrets
80
+ bt pws secrets secrets list
81
+ bt pws secrets secrets get <secret_id>
82
+ bt pws secrets secrets create --folder <folder_id> --title "db-admin" \
83
+ --username "admin" --password "secret123"
84
+
85
+ # Search secrets
86
+ bt pws quick find-secret database
87
+ bt pws quick get-secret "MySafe/Folder/SecretName"
88
+ PASSWORD=$(bt pws quick get-secret "MySafe/Secret" --raw)
89
+ ```
90
+
91
+ ### Storing SSH Private Keys
92
+
93
+ Use **TEXT type** for SSH keys - simpler retrieval for automation:
94
+
95
+ ```bash
96
+ # Store SSH key as TEXT (recommended for automation)
97
+ bt pws secrets secrets create-text --folder <folder_id> --title "svc-deploy SSH Key" \
98
+ --file /path/to/id_rsa --description "Deployment service account key"
99
+
100
+ # Retrieve SSH key (one API call)
101
+ bt pws secrets secrets get <secret_id> --show-password
102
+
103
+ # Alternative: FILE type (preserves filename metadata)
104
+ bt pws secrets secrets create-file --folder <folder_id> --title "svc-deploy Key" \
105
+ --file /path/to/id_rsa
106
+
107
+ # Download FILE type secret
108
+ bt pws secrets secrets download <secret_id> -o /tmp/key
109
+ ```
110
+
111
+ **Note:** TEXT type stores content in Password field (retrieved with `-p`). FILE type requires separate download command.
112
+
113
+ ## Users & Groups
114
+
115
+ ```bash
116
+ bt pws users list
117
+ bt pws users list -s "admin" # Search
118
+ bt pws users get 4
119
+ bt pws users groups
120
+ bt pws users group 1 --members
121
+ bt pws users roles
122
+
123
+ # User entitlements report
124
+ bt pws quick user-entitlements dave
125
+ ```
126
+
127
+ ## Credential Checkout Flow (Manual)
128
+
129
+ ```bash
130
+ # 1. Find system
131
+ bt pws systems list -o json | jq '.[] | select(.SystemName=="axion-finapp-01")'
132
+
133
+ # 2. Find account
134
+ bt pws accounts list --system 22
135
+
136
+ # 3. Checkout
137
+ bt pws credentials checkout --system "axion-finapp-01" --account "root"
138
+
139
+ # 4. Get password
140
+ bt pws credentials show <request_id>
141
+
142
+ # 5. Checkin
143
+ bt pws credentials checkin <request_id>
144
+ ```
145
+
146
+ ## CSV Import/Export
147
+
148
+ ```bash
149
+ # Export template
150
+ bt pws export systems --file systems-template.csv
151
+ bt pws export secrets --file secrets-template.csv
152
+
153
+ # Dry run validation
154
+ bt pws import systems --file systems.csv --dry-run
155
+
156
+ # Import
157
+ bt pws import systems --file systems.csv
158
+ bt pws import secrets --file secrets.csv
159
+ ```
160
+
161
+ ## Key IDs
162
+
163
+ | Resource | ID |
164
+ |----------|-----|
165
+ | Workgroup: Default | 1 |
166
+ | Workgroup: Datacenter_West | 2 |
167
+ | Workgroup: AWS_Account | 3 |
168
+ | Platform: Windows | 1 |
169
+ | Platform: Linux | 2 |
170
+ | Platform: MySQL | 10 |
171
+ | Platform: PostgreSQL | 79 |
172
+ | Functional Account | 7 |
173
+
174
+ ## EC2 Systems in AWS
175
+
176
+ When onboarding EC2 instances to Password Safe, use the **internal AWS DNS name** (not public IP) for reliable connectivity:
177
+
178
+ ```bash
179
+ # Use internal DNS for EC2 systems
180
+ bt pws quick onboard -n "web-prod-01" \
181
+ -i "ip-10-0-12-45.us-east-1.compute.internal" \
182
+ -w 3 -f 7
183
+
184
+ # Or set DNS separately
185
+ bt pws systems update <system_id> --dns "ip-10-0-12-45.us-east-1.compute.internal"
186
+ ```
187
+
188
+ **Why internal DNS?**
189
+ - Public IPs change on instance restart
190
+ - Internal DNS resolves correctly from VPC-connected jumpoints
191
+ - Enables ECM integration (PWS system name must match PRA jump item)
192
+
193
+ ## API Notes
194
+
195
+ - Pagination: `limit`/`offset` (not page/perPage)
196
+ - Response format: `{"TotalCount": N, "Data": [...]}`
197
+ - Asset creation requires workgroup: `POST /Workgroups/{id}/Assets`
@@ -0,0 +1 @@
1
+ """Entitle product module."""
@@ -0,0 +1,5 @@
1
+ """Entitle API client."""
2
+
3
+ from .base import EntitleClient, get_client
4
+
5
+ __all__ = ["EntitleClient", "get_client"]