breachlock-blctl 0.1.0__tar.gz
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.
- breachlock_blctl-0.1.0/LICENSE +21 -0
- breachlock_blctl-0.1.0/PKG-INFO +256 -0
- breachlock_blctl-0.1.0/README.md +228 -0
- breachlock_blctl-0.1.0/blctl/__init__.py +5 -0
- breachlock_blctl-0.1.0/blctl/api/__init__.py +9 -0
- breachlock_blctl-0.1.0/blctl/api/client/__init__.py +9 -0
- breachlock_blctl-0.1.0/blctl/api/client/api_client.py +248 -0
- breachlock_blctl-0.1.0/blctl/api/client/api_error.py +43 -0
- breachlock_blctl-0.1.0/blctl/api/client/api_response_error.py +38 -0
- breachlock_blctl-0.1.0/blctl/api/enums/__init__.py +9 -0
- breachlock_blctl-0.1.0/blctl/api/enums/scan_intensity.py +33 -0
- breachlock_blctl-0.1.0/blctl/api/enums/score_severity.py +30 -0
- breachlock_blctl-0.1.0/blctl/api/enums/vulnerability_confidence.py +32 -0
- breachlock_blctl-0.1.0/blctl/api/models/__init__.py +26 -0
- breachlock_blctl-0.1.0/blctl/api/models/api_error_body.py +17 -0
- breachlock_blctl-0.1.0/blctl/api/models/engagement_created.py +27 -0
- breachlock_blctl-0.1.0/blctl/api/models/engagement_request_base.py +71 -0
- breachlock_blctl-0.1.0/blctl/api/models/external_asset_item.py +17 -0
- breachlock_blctl-0.1.0/blctl/api/models/external_asset_result.py +34 -0
- breachlock_blctl-0.1.0/blctl/api/models/external_network_engagement_request.py +21 -0
- breachlock_blctl-0.1.0/blctl/api/models/external_web_engagement_request.py +19 -0
- breachlock_blctl-0.1.0/blctl/api/models/internal_network_engagement_request.py +25 -0
- breachlock_blctl-0.1.0/blctl/api/models/internal_web_engagement_request.py +19 -0
- breachlock_blctl-0.1.0/blctl/api/models/network_engagement_request_base.py +25 -0
- breachlock_blctl-0.1.0/blctl/api/models/notify_url.py +20 -0
- breachlock_blctl-0.1.0/blctl/api/models/request_model.py +18 -0
- breachlock_blctl-0.1.0/blctl/api/models/response_model.py +18 -0
- breachlock_blctl-0.1.0/blctl/api/models/web_engagement_credentials.py +25 -0
- breachlock_blctl-0.1.0/blctl/api/models/web_engagement_request_base.py +30 -0
- breachlock_blctl-0.1.0/blctl/api/models/webhook_header.py +17 -0
- breachlock_blctl-0.1.0/blctl/commands/__init__.py +7 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/__init__.py +16 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/cli_errors.py +68 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/common_engagement_fields.py +65 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/engage_command.py +426 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/engagement_validation.py +160 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/external_assets.py +47 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/field_builders.py +125 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/network_engagements.py +92 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/network_recon_fields.py +20 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/parsing.py +52 -0
- breachlock_blctl-0.1.0/blctl/commands/engage/web_engagements.py +92 -0
- breachlock_blctl-0.1.0/blctl/main.py +29 -0
- breachlock_blctl-0.1.0/pyproject.toml +39 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 BreachLock Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: breachlock-blctl
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Command-line interface for BreachLock AEV, distributed via pip.
|
|
5
|
+
License: MIT
|
|
6
|
+
Keywords: security,pentesting,vulnerability-scanning,breachlock,devsecops
|
|
7
|
+
Author: Saul Johnson
|
|
8
|
+
Author-email: saul.j@breachlock.com
|
|
9
|
+
Requires-Python: >=3.11,<4.0
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: Information Technology
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Requires-Dist: click (>=8.4.1,<9.0.0)
|
|
22
|
+
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
23
|
+
Requires-Dist: pydantic (>=2.13.4,<3.0.0)
|
|
24
|
+
Project-URL: Homepage, https://github.com/BreachLock-Inc/blctl-py
|
|
25
|
+
Project-URL: Repository, https://github.com/BreachLock-Inc/blctl-py
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
|
|
28
|
+
# blctl
|
|
29
|
+
|
|
30
|
+
Command-line interface for [BreachLock AEV](https://www.breachlock.com/products/adversarial-exposure-validation/), designed for use in CI/CD pipelines. Start network and web application pentest engagements against your infrastructure directly from the terminal or your pipeline scripts.
|
|
31
|
+
|
|
32
|
+

|
|
33
|
+
|
|
34
|
+
## Requirements
|
|
35
|
+
|
|
36
|
+
- Python 3.11+
|
|
37
|
+
- A [BreachLock AEV](https://www.breachlock.com/products/adversarial-exposure-validation/) subscription with API access enabled on your account
|
|
38
|
+
|
|
39
|
+
## Installation
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install breachlock-blctl
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Configuration
|
|
46
|
+
|
|
47
|
+
`blctl` reads credentials and tenant settings from environment variables. Set these before running any commands:
|
|
48
|
+
|
|
49
|
+
| Variable | Description |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `BLCTL_API_KEY` | BreachLock API key (Bearer token) |
|
|
52
|
+
| `BLCTL_API_URL` | Base URL of your AEV tenant (e.g. `https://tenant.app.breachlock.com`) |
|
|
53
|
+
| `BLCTL_ORGANIZATION_ID` | Organization ID (CUID) — required for external engagements |
|
|
54
|
+
|
|
55
|
+
All three can also be passed as explicit flags (`--api-key`, `--api-url`, `--organization-id`), but using environment variables keeps secrets out of shell history and CI logs.
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
### `blctl engage`
|
|
60
|
+
|
|
61
|
+
Starts a pentest engagement against BreachLock AEV and prints the created engagement as JSON.
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
blctl engage --type <network|web> (--external|--internal) --name <name> [OPTIONS]
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
#### Engagement type and direction
|
|
68
|
+
|
|
69
|
+
| Flag | Description |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `--type network` | Network pentest |
|
|
72
|
+
| `--type web` | Web application pentest |
|
|
73
|
+
| `--external` | Scan externally reachable targets (mutually exclusive with `--internal`) |
|
|
74
|
+
| `--internal` | Scan internal targets via a deployed agent (mutually exclusive with `--external`) |
|
|
75
|
+
|
|
76
|
+
#### Target selection
|
|
77
|
+
|
|
78
|
+
| Flag | Description |
|
|
79
|
+
|---|---|
|
|
80
|
+
| `--targets <ip,host,...>` | Comma-separated IPs or hostnames to scan. Each is registered as an external asset before the engagement starts. External only. |
|
|
81
|
+
| `--asset-id <CUID>` | Asset ID to include. Repeatable. For `--external`, combinable with `--targets`. For `--internal`, at least one is required. |
|
|
82
|
+
| `--organization-id <CUID>` | Organization ID. Required for `--external`. Defaults to `$BLCTL_ORGANIZATION_ID`. |
|
|
83
|
+
| `--deployment-id <CUID>` | Deployment ID. Required for `--internal`. |
|
|
84
|
+
|
|
85
|
+
#### Scan controls
|
|
86
|
+
|
|
87
|
+
| Flag | Default | Description |
|
|
88
|
+
|---|---|---|
|
|
89
|
+
| `--scan-intensity` | `NORMAL` | `STEALTH`, `QUIET`, `POLITE`, `NORMAL`, `AGGRESSIVE`, or `EXTREME`. Affects host timeout and scan depth. |
|
|
90
|
+
| `--severity-threshold` | `NONE` | Minimum result severity: `NONE`, `LOW`, `MEDIUM`, `HIGH`, `CRITICAL`. |
|
|
91
|
+
| `--confidence-threshold` | `VERY_LOW` | Minimum vulnerability confidence: `VERY_LOW`, `LOW`, `MEDIUM`, `HIGH`, `VERY_HIGH`. |
|
|
92
|
+
|
|
93
|
+
#### Feature flags
|
|
94
|
+
|
|
95
|
+
| Flag | Default | Description |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| `--exploitation` / `--no-exploitation` | `false` for network, `true` for web | Attempt exploitation. |
|
|
98
|
+
| `--credential-recovery` / `--no-credential-recovery` | `false` | Attempt credential recovery. |
|
|
99
|
+
| `--tailored-remediation` / `--no-tailored-remediation` | `false` | Provide tailored remediation advice. |
|
|
100
|
+
| `--screenshots` / `--no-screenshots` | `false` | Capture screenshots during the engagement. |
|
|
101
|
+
| `--learn-findings` / `--no-learn-findings` | `false` for network, `true` for web | Feed findings into the BreachLock learning pipeline. |
|
|
102
|
+
| `--learn-exploits` / `--no-learn-exploits` | `false` for network, `true` for web | Feed exploits into the BreachLock learning pipeline. |
|
|
103
|
+
|
|
104
|
+
#### Network reconnaissance (network engagements only)
|
|
105
|
+
|
|
106
|
+
| Flag | Default | Description |
|
|
107
|
+
|---|---|---|
|
|
108
|
+
| `--advanced-network-recon` / `--no-advanced-network-recon` | `false` | Run advanced network reconnaissance. |
|
|
109
|
+
| `--advanced-web-server-recon` / `--no-advanced-web-server-recon` | `false` | Run advanced web server reconnaissance. |
|
|
110
|
+
| `--active-directory-recon` / `--no-active-directory-recon` | `false` | Run Active Directory reconnaissance. |
|
|
111
|
+
| `--azure-ad-recon` / `--no-azure-ad-recon` | `false` | Run Azure AD reconnaissance. Only valid with `--type=network --internal`. |
|
|
112
|
+
|
|
113
|
+
#### Web application credentials (web engagements only)
|
|
114
|
+
|
|
115
|
+
Provide these to enable authenticated scanning. `--username` and `--password` must be supplied together, or omitted together for an unauthenticated scan. `--totp-secret` requires both.
|
|
116
|
+
|
|
117
|
+
| Flag | Env var | Description |
|
|
118
|
+
|---|---|---|
|
|
119
|
+
| `--username` | `BLCTL_WEB_USERNAME` | Username the agent uses to log in to the target application. |
|
|
120
|
+
| `--password` | `BLCTL_WEB_PASSWORD` | Password for the above username. Prefer the env var to keep it out of logs. |
|
|
121
|
+
| `--totp-secret` | `BLCTL_WEB_TOTP_SECRET` | Base32 TOTP shared secret for MFA. Prefer the env var. |
|
|
122
|
+
|
|
123
|
+
#### Filtering
|
|
124
|
+
|
|
125
|
+
| Flag | Description |
|
|
126
|
+
|---|---|
|
|
127
|
+
| `--excluded-protocol <id>` | Protocol ID or code to exclude. Repeatable. |
|
|
128
|
+
| `--excluded-finding <id>` | Finding ID or code to exclude. Repeatable. |
|
|
129
|
+
| `--excluded-cve <CVE-ID>` | CVE to exclude. Repeatable. |
|
|
130
|
+
| `--included-cve <CVE-ID>` | CVE to explicitly include. Repeatable. |
|
|
131
|
+
|
|
132
|
+
#### Webhooks and assessments
|
|
133
|
+
|
|
134
|
+
| Flag | Description |
|
|
135
|
+
|---|---|
|
|
136
|
+
| `--notify-url <spec>` | Webhook URL to call on engagement updates. Repeatable. Pass a bare URL (`https://hook/`) or a URL with pipe-separated headers (`https://hook/\|Authorization=Bearer abc\|X-Trace=42`). |
|
|
137
|
+
| `--threat-actor-assessment-id <CUID>` | Threat actor assessment to associate with the engagement. Repeatable. |
|
|
138
|
+
|
|
139
|
+
## Examples
|
|
140
|
+
|
|
141
|
+
### External network scan
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
export BLCTL_API_KEY="your-api-key"
|
|
145
|
+
export BLCTL_API_URL="https://tenant.app.breachlock.com"
|
|
146
|
+
export BLCTL_ORGANIZATION_ID="org-cuid"
|
|
147
|
+
|
|
148
|
+
blctl engage \
|
|
149
|
+
--type network \
|
|
150
|
+
--external \
|
|
151
|
+
--name "Weekly perimeter scan" \
|
|
152
|
+
--targets "203.0.113.10,203.0.113.11" \
|
|
153
|
+
--scan-intensity AGGRESSIVE \
|
|
154
|
+
--advanced-network-recon \
|
|
155
|
+
--active-directory-recon
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### External web application scan with authenticated scanning
|
|
159
|
+
|
|
160
|
+
```bash
|
|
161
|
+
export BLCTL_WEB_USERNAME="testuser@example.com"
|
|
162
|
+
export BLCTL_WEB_PASSWORD="s3cr3t"
|
|
163
|
+
export BLCTL_WEB_TOTP_SECRET="BASE32SECRET"
|
|
164
|
+
|
|
165
|
+
blctl engage \
|
|
166
|
+
--type web \
|
|
167
|
+
--external \
|
|
168
|
+
--name "Sprint 42 web scan" \
|
|
169
|
+
--targets "app.example.com" \
|
|
170
|
+
--screenshots \
|
|
171
|
+
--tailored-remediation \
|
|
172
|
+
--severity-threshold MEDIUM
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Internal network scan via deployed agent
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
blctl engage \
|
|
179
|
+
--type network \
|
|
180
|
+
--internal \
|
|
181
|
+
--name "Internal audit Q3" \
|
|
182
|
+
--deployment-id "dep-cuid" \
|
|
183
|
+
--asset-id "asset-cuid-1" \
|
|
184
|
+
--asset-id "asset-cuid-2" \
|
|
185
|
+
--azure-ad-recon \
|
|
186
|
+
--advanced-network-recon
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### Webhook notification with auth header
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
blctl engage \
|
|
193
|
+
--type web \
|
|
194
|
+
--external \
|
|
195
|
+
--name "Nightly scan" \
|
|
196
|
+
--targets "app.example.com" \
|
|
197
|
+
--notify-url "https://hooks.example.com/bl|Authorization=Bearer token123"
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
### CI/CD pipeline (GitHub Actions)
|
|
201
|
+
|
|
202
|
+
```yaml
|
|
203
|
+
- name: Start BreachLock engagement
|
|
204
|
+
env:
|
|
205
|
+
BLCTL_API_KEY: ${{ secrets.BLCTL_API_KEY }}
|
|
206
|
+
BLCTL_API_URL: ${{ secrets.BLCTL_API_URL }}
|
|
207
|
+
BLCTL_ORGANIZATION_ID: ${{ secrets.BLCTL_ORGANIZATION_ID }}
|
|
208
|
+
run: |
|
|
209
|
+
blctl engage \
|
|
210
|
+
--type web \
|
|
211
|
+
--external \
|
|
212
|
+
--name "PR ${{ github.event.number }} scan" \
|
|
213
|
+
--targets "${{ vars.SCAN_TARGET }}" \
|
|
214
|
+
--severity-threshold HIGH \
|
|
215
|
+
--no-learn-findings \
|
|
216
|
+
--no-learn-exploits
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### CI/CD pipeline (GitLab CI)
|
|
220
|
+
|
|
221
|
+
```yaml
|
|
222
|
+
breachlock-scan:
|
|
223
|
+
stage: test
|
|
224
|
+
script:
|
|
225
|
+
- pip install breachlock-blctl
|
|
226
|
+
- |
|
|
227
|
+
blctl engage \
|
|
228
|
+
--type web \
|
|
229
|
+
--external \
|
|
230
|
+
--name "MR $CI_MERGE_REQUEST_IID scan" \
|
|
231
|
+
--targets "$SCAN_TARGET" \
|
|
232
|
+
--severity-threshold HIGH \
|
|
233
|
+
--no-learn-findings \
|
|
234
|
+
--no-learn-exploits
|
|
235
|
+
variables:
|
|
236
|
+
BLCTL_API_KEY: $BLCTL_API_KEY
|
|
237
|
+
BLCTL_API_URL: $BLCTL_API_URL
|
|
238
|
+
BLCTL_ORGANIZATION_ID: $BLCTL_ORGANIZATION_ID
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Store `BLCTL_API_KEY`, `BLCTL_API_URL`, and `BLCTL_ORGANIZATION_ID` as [masked CI/CD variables](https://docs.gitlab.com/ee/ci/variables/) in your project or group settings. `SCAN_TARGET` can be a plain variable.
|
|
242
|
+
|
|
243
|
+
## Output
|
|
244
|
+
|
|
245
|
+
On success, `blctl engage` prints the created engagement as JSON:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"id": "eng-cuid",
|
|
250
|
+
"name": "Weekly perimeter scan",
|
|
251
|
+
...
|
|
252
|
+
}
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
On error, a non-zero exit code is returned and the error is written to stderr.
|
|
256
|
+
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
# blctl
|
|
2
|
+
|
|
3
|
+
Command-line interface for [BreachLock AEV](https://www.breachlock.com/products/adversarial-exposure-validation/), designed for use in CI/CD pipelines. Start network and web application pentest engagements against your infrastructure directly from the terminal or your pipeline scripts.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
- Python 3.11+
|
|
10
|
+
- A [BreachLock AEV](https://www.breachlock.com/products/adversarial-exposure-validation/) subscription with API access enabled on your account
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install breachlock-blctl
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Configuration
|
|
19
|
+
|
|
20
|
+
`blctl` reads credentials and tenant settings from environment variables. Set these before running any commands:
|
|
21
|
+
|
|
22
|
+
| Variable | Description |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `BLCTL_API_KEY` | BreachLock API key (Bearer token) |
|
|
25
|
+
| `BLCTL_API_URL` | Base URL of your AEV tenant (e.g. `https://tenant.app.breachlock.com`) |
|
|
26
|
+
| `BLCTL_ORGANIZATION_ID` | Organization ID (CUID) — required for external engagements |
|
|
27
|
+
|
|
28
|
+
All three can also be passed as explicit flags (`--api-key`, `--api-url`, `--organization-id`), but using environment variables keeps secrets out of shell history and CI logs.
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
### `blctl engage`
|
|
33
|
+
|
|
34
|
+
Starts a pentest engagement against BreachLock AEV and prints the created engagement as JSON.
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
blctl engage --type <network|web> (--external|--internal) --name <name> [OPTIONS]
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
#### Engagement type and direction
|
|
41
|
+
|
|
42
|
+
| Flag | Description |
|
|
43
|
+
|---|---|
|
|
44
|
+
| `--type network` | Network pentest |
|
|
45
|
+
| `--type web` | Web application pentest |
|
|
46
|
+
| `--external` | Scan externally reachable targets (mutually exclusive with `--internal`) |
|
|
47
|
+
| `--internal` | Scan internal targets via a deployed agent (mutually exclusive with `--external`) |
|
|
48
|
+
|
|
49
|
+
#### Target selection
|
|
50
|
+
|
|
51
|
+
| Flag | Description |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `--targets <ip,host,...>` | Comma-separated IPs or hostnames to scan. Each is registered as an external asset before the engagement starts. External only. |
|
|
54
|
+
| `--asset-id <CUID>` | Asset ID to include. Repeatable. For `--external`, combinable with `--targets`. For `--internal`, at least one is required. |
|
|
55
|
+
| `--organization-id <CUID>` | Organization ID. Required for `--external`. Defaults to `$BLCTL_ORGANIZATION_ID`. |
|
|
56
|
+
| `--deployment-id <CUID>` | Deployment ID. Required for `--internal`. |
|
|
57
|
+
|
|
58
|
+
#### Scan controls
|
|
59
|
+
|
|
60
|
+
| Flag | Default | Description |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| `--scan-intensity` | `NORMAL` | `STEALTH`, `QUIET`, `POLITE`, `NORMAL`, `AGGRESSIVE`, or `EXTREME`. Affects host timeout and scan depth. |
|
|
63
|
+
| `--severity-threshold` | `NONE` | Minimum result severity: `NONE`, `LOW`, `MEDIUM`, `HIGH`, `CRITICAL`. |
|
|
64
|
+
| `--confidence-threshold` | `VERY_LOW` | Minimum vulnerability confidence: `VERY_LOW`, `LOW`, `MEDIUM`, `HIGH`, `VERY_HIGH`. |
|
|
65
|
+
|
|
66
|
+
#### Feature flags
|
|
67
|
+
|
|
68
|
+
| Flag | Default | Description |
|
|
69
|
+
|---|---|---|
|
|
70
|
+
| `--exploitation` / `--no-exploitation` | `false` for network, `true` for web | Attempt exploitation. |
|
|
71
|
+
| `--credential-recovery` / `--no-credential-recovery` | `false` | Attempt credential recovery. |
|
|
72
|
+
| `--tailored-remediation` / `--no-tailored-remediation` | `false` | Provide tailored remediation advice. |
|
|
73
|
+
| `--screenshots` / `--no-screenshots` | `false` | Capture screenshots during the engagement. |
|
|
74
|
+
| `--learn-findings` / `--no-learn-findings` | `false` for network, `true` for web | Feed findings into the BreachLock learning pipeline. |
|
|
75
|
+
| `--learn-exploits` / `--no-learn-exploits` | `false` for network, `true` for web | Feed exploits into the BreachLock learning pipeline. |
|
|
76
|
+
|
|
77
|
+
#### Network reconnaissance (network engagements only)
|
|
78
|
+
|
|
79
|
+
| Flag | Default | Description |
|
|
80
|
+
|---|---|---|
|
|
81
|
+
| `--advanced-network-recon` / `--no-advanced-network-recon` | `false` | Run advanced network reconnaissance. |
|
|
82
|
+
| `--advanced-web-server-recon` / `--no-advanced-web-server-recon` | `false` | Run advanced web server reconnaissance. |
|
|
83
|
+
| `--active-directory-recon` / `--no-active-directory-recon` | `false` | Run Active Directory reconnaissance. |
|
|
84
|
+
| `--azure-ad-recon` / `--no-azure-ad-recon` | `false` | Run Azure AD reconnaissance. Only valid with `--type=network --internal`. |
|
|
85
|
+
|
|
86
|
+
#### Web application credentials (web engagements only)
|
|
87
|
+
|
|
88
|
+
Provide these to enable authenticated scanning. `--username` and `--password` must be supplied together, or omitted together for an unauthenticated scan. `--totp-secret` requires both.
|
|
89
|
+
|
|
90
|
+
| Flag | Env var | Description |
|
|
91
|
+
|---|---|---|
|
|
92
|
+
| `--username` | `BLCTL_WEB_USERNAME` | Username the agent uses to log in to the target application. |
|
|
93
|
+
| `--password` | `BLCTL_WEB_PASSWORD` | Password for the above username. Prefer the env var to keep it out of logs. |
|
|
94
|
+
| `--totp-secret` | `BLCTL_WEB_TOTP_SECRET` | Base32 TOTP shared secret for MFA. Prefer the env var. |
|
|
95
|
+
|
|
96
|
+
#### Filtering
|
|
97
|
+
|
|
98
|
+
| Flag | Description |
|
|
99
|
+
|---|---|
|
|
100
|
+
| `--excluded-protocol <id>` | Protocol ID or code to exclude. Repeatable. |
|
|
101
|
+
| `--excluded-finding <id>` | Finding ID or code to exclude. Repeatable. |
|
|
102
|
+
| `--excluded-cve <CVE-ID>` | CVE to exclude. Repeatable. |
|
|
103
|
+
| `--included-cve <CVE-ID>` | CVE to explicitly include. Repeatable. |
|
|
104
|
+
|
|
105
|
+
#### Webhooks and assessments
|
|
106
|
+
|
|
107
|
+
| Flag | Description |
|
|
108
|
+
|---|---|
|
|
109
|
+
| `--notify-url <spec>` | Webhook URL to call on engagement updates. Repeatable. Pass a bare URL (`https://hook/`) or a URL with pipe-separated headers (`https://hook/\|Authorization=Bearer abc\|X-Trace=42`). |
|
|
110
|
+
| `--threat-actor-assessment-id <CUID>` | Threat actor assessment to associate with the engagement. Repeatable. |
|
|
111
|
+
|
|
112
|
+
## Examples
|
|
113
|
+
|
|
114
|
+
### External network scan
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
export BLCTL_API_KEY="your-api-key"
|
|
118
|
+
export BLCTL_API_URL="https://tenant.app.breachlock.com"
|
|
119
|
+
export BLCTL_ORGANIZATION_ID="org-cuid"
|
|
120
|
+
|
|
121
|
+
blctl engage \
|
|
122
|
+
--type network \
|
|
123
|
+
--external \
|
|
124
|
+
--name "Weekly perimeter scan" \
|
|
125
|
+
--targets "203.0.113.10,203.0.113.11" \
|
|
126
|
+
--scan-intensity AGGRESSIVE \
|
|
127
|
+
--advanced-network-recon \
|
|
128
|
+
--active-directory-recon
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### External web application scan with authenticated scanning
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
export BLCTL_WEB_USERNAME="testuser@example.com"
|
|
135
|
+
export BLCTL_WEB_PASSWORD="s3cr3t"
|
|
136
|
+
export BLCTL_WEB_TOTP_SECRET="BASE32SECRET"
|
|
137
|
+
|
|
138
|
+
blctl engage \
|
|
139
|
+
--type web \
|
|
140
|
+
--external \
|
|
141
|
+
--name "Sprint 42 web scan" \
|
|
142
|
+
--targets "app.example.com" \
|
|
143
|
+
--screenshots \
|
|
144
|
+
--tailored-remediation \
|
|
145
|
+
--severity-threshold MEDIUM
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Internal network scan via deployed agent
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
blctl engage \
|
|
152
|
+
--type network \
|
|
153
|
+
--internal \
|
|
154
|
+
--name "Internal audit Q3" \
|
|
155
|
+
--deployment-id "dep-cuid" \
|
|
156
|
+
--asset-id "asset-cuid-1" \
|
|
157
|
+
--asset-id "asset-cuid-2" \
|
|
158
|
+
--azure-ad-recon \
|
|
159
|
+
--advanced-network-recon
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Webhook notification with auth header
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
blctl engage \
|
|
166
|
+
--type web \
|
|
167
|
+
--external \
|
|
168
|
+
--name "Nightly scan" \
|
|
169
|
+
--targets "app.example.com" \
|
|
170
|
+
--notify-url "https://hooks.example.com/bl|Authorization=Bearer token123"
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
### CI/CD pipeline (GitHub Actions)
|
|
174
|
+
|
|
175
|
+
```yaml
|
|
176
|
+
- name: Start BreachLock engagement
|
|
177
|
+
env:
|
|
178
|
+
BLCTL_API_KEY: ${{ secrets.BLCTL_API_KEY }}
|
|
179
|
+
BLCTL_API_URL: ${{ secrets.BLCTL_API_URL }}
|
|
180
|
+
BLCTL_ORGANIZATION_ID: ${{ secrets.BLCTL_ORGANIZATION_ID }}
|
|
181
|
+
run: |
|
|
182
|
+
blctl engage \
|
|
183
|
+
--type web \
|
|
184
|
+
--external \
|
|
185
|
+
--name "PR ${{ github.event.number }} scan" \
|
|
186
|
+
--targets "${{ vars.SCAN_TARGET }}" \
|
|
187
|
+
--severity-threshold HIGH \
|
|
188
|
+
--no-learn-findings \
|
|
189
|
+
--no-learn-exploits
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### CI/CD pipeline (GitLab CI)
|
|
193
|
+
|
|
194
|
+
```yaml
|
|
195
|
+
breachlock-scan:
|
|
196
|
+
stage: test
|
|
197
|
+
script:
|
|
198
|
+
- pip install breachlock-blctl
|
|
199
|
+
- |
|
|
200
|
+
blctl engage \
|
|
201
|
+
--type web \
|
|
202
|
+
--external \
|
|
203
|
+
--name "MR $CI_MERGE_REQUEST_IID scan" \
|
|
204
|
+
--targets "$SCAN_TARGET" \
|
|
205
|
+
--severity-threshold HIGH \
|
|
206
|
+
--no-learn-findings \
|
|
207
|
+
--no-learn-exploits
|
|
208
|
+
variables:
|
|
209
|
+
BLCTL_API_KEY: $BLCTL_API_KEY
|
|
210
|
+
BLCTL_API_URL: $BLCTL_API_URL
|
|
211
|
+
BLCTL_ORGANIZATION_ID: $BLCTL_ORGANIZATION_ID
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
Store `BLCTL_API_KEY`, `BLCTL_API_URL`, and `BLCTL_ORGANIZATION_ID` as [masked CI/CD variables](https://docs.gitlab.com/ee/ci/variables/) in your project or group settings. `SCAN_TARGET` can be a plain variable.
|
|
215
|
+
|
|
216
|
+
## Output
|
|
217
|
+
|
|
218
|
+
On success, `blctl engage` prints the created engagement as JSON:
|
|
219
|
+
|
|
220
|
+
```json
|
|
221
|
+
{
|
|
222
|
+
"id": "eng-cuid",
|
|
223
|
+
"name": "Weekly perimeter scan",
|
|
224
|
+
...
|
|
225
|
+
}
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
On error, a non-zero exit code is returned and the error is written to stderr.
|