souleyez 2.27.0__py3-none-any.whl → 2.32.0__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.
Potentially problematic release.
This version of souleyez might be problematic. Click here for more details.
- souleyez/__init__.py +1 -1
- souleyez/core/tool_chaining.py +60 -16
- souleyez/docs/README.md +2 -2
- souleyez/docs/user-guide/configuration.md +1 -1
- souleyez/docs/user-guide/scope-management.md +683 -0
- souleyez/engine/background.py +38 -1
- souleyez/engine/result_handler.py +167 -10
- souleyez/integrations/wazuh/config.py +141 -18
- souleyez/main.py +222 -1
- souleyez/plugins/nuclei.py +2 -1
- souleyez/plugins/searchsploit.py +21 -18
- souleyez/security/scope_validator.py +615 -0
- souleyez/storage/database.py +59 -20
- souleyez/storage/hosts.py +87 -2
- souleyez/storage/migrations/_026_add_engagement_scope.py +87 -0
- souleyez/storage/migrations/_027_multi_siem_persistence.py +119 -0
- souleyez/storage/migrations/__init__.py +6 -0
- souleyez/storage/schema.sql +44 -4
- souleyez/ui/interactive.py +825 -233
- {souleyez-2.27.0.dist-info → souleyez-2.32.0.dist-info}/METADATA +9 -3
- {souleyez-2.27.0.dist-info → souleyez-2.32.0.dist-info}/RECORD +25 -21
- {souleyez-2.27.0.dist-info → souleyez-2.32.0.dist-info}/WHEEL +0 -0
- {souleyez-2.27.0.dist-info → souleyez-2.32.0.dist-info}/entry_points.txt +0 -0
- {souleyez-2.27.0.dist-info → souleyez-2.32.0.dist-info}/licenses/LICENSE +0 -0
- {souleyez-2.27.0.dist-info → souleyez-2.32.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,683 @@
|
|
|
1
|
+
# Engagement Scope Management Guide
|
|
2
|
+
|
|
3
|
+
**Version:** 2.27.0
|
|
4
|
+
**Last Updated:** January 2026
|
|
5
|
+
|
|
6
|
+
SoulEyez includes a comprehensive scope validation system to ensure scanning activities remain within authorized boundaries. This guide covers scope definitions, enforcement modes, validation behavior, and audit logging.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Table of Contents
|
|
11
|
+
|
|
12
|
+
1. [Overview](#overview)
|
|
13
|
+
2. [Why Scope Management?](#why-scope-management)
|
|
14
|
+
3. [Getting Started](#getting-started)
|
|
15
|
+
4. [Scope Entry Types](#scope-entry-types)
|
|
16
|
+
5. [Enforcement Modes](#enforcement-modes)
|
|
17
|
+
6. [Managing Scope](#managing-scope)
|
|
18
|
+
7. [Interactive UI](#interactive-ui)
|
|
19
|
+
8. [CLI Commands](#cli-commands)
|
|
20
|
+
9. [Host Scope Status](#host-scope-status)
|
|
21
|
+
10. [Audit Trail](#audit-trail)
|
|
22
|
+
11. [Tool Chaining Behavior](#tool-chaining-behavior)
|
|
23
|
+
12. [Best Practices](#best-practices)
|
|
24
|
+
13. [Troubleshooting](#troubleshooting)
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## Overview
|
|
29
|
+
|
|
30
|
+
SoulEyez Scope Management provides:
|
|
31
|
+
|
|
32
|
+
- **Structured scope definitions** (CIDR ranges, domains, URLs, hostnames)
|
|
33
|
+
- **Three enforcement modes** (Off, Warn, Block)
|
|
34
|
+
- **Automatic target validation** before job execution
|
|
35
|
+
- **Exclusion rules** for explicitly denied targets
|
|
36
|
+
- **Host scope status tracking** for visual indicators
|
|
37
|
+
- **Complete audit trail** for compliance
|
|
38
|
+
- **Non-breaking defaults** for existing engagements
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Why Scope Management?
|
|
43
|
+
|
|
44
|
+
During penetration testing engagements, it's critical to stay within authorized boundaries. Scanning unauthorized targets can lead to:
|
|
45
|
+
|
|
46
|
+
- **Legal liability** for unauthorized access
|
|
47
|
+
- **Contract violations** with clients
|
|
48
|
+
- **Accidental impact** on production systems
|
|
49
|
+
- **Compliance failures** in regulated industries
|
|
50
|
+
|
|
51
|
+
SoulEyez Scope Management prevents these issues by:
|
|
52
|
+
|
|
53
|
+
1. **Validating every target** before scanning
|
|
54
|
+
2. **Blocking or warning** on out-of-scope targets
|
|
55
|
+
3. **Automatically handling** tool chaining boundaries
|
|
56
|
+
4. **Creating audit trails** for compliance documentation
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## Getting Started
|
|
61
|
+
|
|
62
|
+
### Default Behavior
|
|
63
|
+
|
|
64
|
+
By default, **no scope validation occurs**. This ensures backward compatibility:
|
|
65
|
+
|
|
66
|
+
- Existing engagements work unchanged
|
|
67
|
+
- New engagements without defined scope are fully permissive
|
|
68
|
+
- Scope validation only activates when you explicitly add scope entries
|
|
69
|
+
|
|
70
|
+
### Quick Setup
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
# 1. Add scope entries
|
|
74
|
+
$ souleyez scope add "Client Pentest" --cidr 192.168.1.0/24
|
|
75
|
+
$ souleyez scope add "Client Pentest" --domain "*.example.com"
|
|
76
|
+
|
|
77
|
+
# 2. Set enforcement mode
|
|
78
|
+
$ souleyez scope enforcement "Client Pentest" warn
|
|
79
|
+
|
|
80
|
+
# 3. Test a target
|
|
81
|
+
$ souleyez scope validate "Client Pentest" 192.168.1.100
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## Scope Entry Types
|
|
87
|
+
|
|
88
|
+
### CIDR Ranges
|
|
89
|
+
|
|
90
|
+
Define network ranges using CIDR notation:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
# Single subnet
|
|
94
|
+
$ souleyez scope add "Engagement" --cidr 192.168.1.0/24
|
|
95
|
+
|
|
96
|
+
# Large network
|
|
97
|
+
$ souleyez scope add "Engagement" --cidr 10.0.0.0/8
|
|
98
|
+
|
|
99
|
+
# Single IP (as /32)
|
|
100
|
+
$ souleyez scope add "Engagement" --cidr 192.168.1.100/32
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
**Matching behavior:**
|
|
104
|
+
- IP `192.168.1.50` matches `192.168.1.0/24`
|
|
105
|
+
- IP `192.168.2.50` does NOT match `192.168.1.0/24`
|
|
106
|
+
|
|
107
|
+
### Domains
|
|
108
|
+
|
|
109
|
+
Define domain patterns with optional wildcards:
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
# Wildcard subdomain
|
|
113
|
+
$ souleyez scope add "Engagement" --domain "*.example.com"
|
|
114
|
+
|
|
115
|
+
# Exact domain
|
|
116
|
+
$ souleyez scope add "Engagement" --domain "example.com"
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**Matching behavior:**
|
|
120
|
+
- `*.example.com` matches `app.example.com`, `deep.sub.example.com`, `example.com`
|
|
121
|
+
- `example.com` matches only `example.com` exactly
|
|
122
|
+
- Matching is case-insensitive
|
|
123
|
+
|
|
124
|
+
### URLs
|
|
125
|
+
|
|
126
|
+
Define specific URL prefixes:
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Web application
|
|
130
|
+
$ souleyez scope add "Engagement" --url "https://app.example.com"
|
|
131
|
+
|
|
132
|
+
# API endpoint
|
|
133
|
+
$ souleyez scope add "Engagement" --url "https://api.example.com/v2"
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Matching behavior:**
|
|
137
|
+
- Host is extracted for validation
|
|
138
|
+
- Port numbers are handled correctly
|
|
139
|
+
- URLs like `https://app.example.com/path/to/resource` match the scope
|
|
140
|
+
|
|
141
|
+
### Hostnames
|
|
142
|
+
|
|
143
|
+
Define exact hostnames or IP addresses:
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
# Exact hostname
|
|
147
|
+
$ souleyez scope add "Engagement" --hostname "webserver.local"
|
|
148
|
+
|
|
149
|
+
# Specific IP
|
|
150
|
+
$ souleyez scope add "Engagement" --hostname "192.168.1.100"
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Enforcement Modes
|
|
156
|
+
|
|
157
|
+
| Mode | Behavior | Use Case |
|
|
158
|
+
|------|----------|----------|
|
|
159
|
+
| **off** | No validation (default) | Development, testing, legacy engagements |
|
|
160
|
+
| **warn** | Allow but log warning | Production with monitoring, gradual rollout |
|
|
161
|
+
| **block** | Reject out-of-scope targets | Production, strict compliance requirements |
|
|
162
|
+
|
|
163
|
+
### Setting Enforcement Mode
|
|
164
|
+
|
|
165
|
+
```bash
|
|
166
|
+
# Turn off validation (default)
|
|
167
|
+
$ souleyez scope enforcement "Engagement" off
|
|
168
|
+
|
|
169
|
+
# Enable warnings only
|
|
170
|
+
$ souleyez scope enforcement "Engagement" warn
|
|
171
|
+
|
|
172
|
+
# Enable strict blocking
|
|
173
|
+
$ souleyez scope enforcement "Engagement" block
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### How Each Mode Works
|
|
177
|
+
|
|
178
|
+
**Off Mode:**
|
|
179
|
+
- All targets allowed
|
|
180
|
+
- No warnings added to jobs
|
|
181
|
+
- No scope validation occurs
|
|
182
|
+
|
|
183
|
+
**Warn Mode:**
|
|
184
|
+
- All targets allowed
|
|
185
|
+
- Warning added to job metadata
|
|
186
|
+
- Logged to audit trail
|
|
187
|
+
- Visible in job details
|
|
188
|
+
|
|
189
|
+
**Block Mode:**
|
|
190
|
+
- In-scope targets allowed
|
|
191
|
+
- Out-of-scope targets rejected with error
|
|
192
|
+
- Job creation prevented
|
|
193
|
+
- Logged to audit trail
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Managing Scope
|
|
198
|
+
|
|
199
|
+
### Adding Scope Entries
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Add with description
|
|
203
|
+
$ souleyez scope add "Engagement" --cidr 192.168.1.0/24 --desc "Corporate LAN"
|
|
204
|
+
|
|
205
|
+
# Add exclusion (deny rule)
|
|
206
|
+
$ souleyez scope add "Engagement" --cidr 192.168.1.0/24 --exclude --desc "Production server"
|
|
207
|
+
|
|
208
|
+
# Multiple entries
|
|
209
|
+
$ souleyez scope add "Engagement" --cidr 10.0.0.0/8
|
|
210
|
+
$ souleyez scope add "Engagement" --domain "*.target.com"
|
|
211
|
+
$ souleyez scope add "Engagement" --url "https://webapp.target.com"
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Listing Scope
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
$ souleyez scope list "Engagement"
|
|
218
|
+
|
|
219
|
+
Engagement Scope: Client Pentest
|
|
220
|
+
Enforcement Mode: block
|
|
221
|
+
|
|
222
|
+
ID Type Value Excluded Description
|
|
223
|
+
── ──── ───── ──────── ───────────
|
|
224
|
+
1 cidr 192.168.1.0/24 No Corporate LAN
|
|
225
|
+
2 domain *.example.com No Target domain
|
|
226
|
+
3 hostname 192.168.1.1 Yes Gateway - excluded
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Removing Scope Entries
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
# Remove by ID
|
|
233
|
+
$ souleyez scope remove "Engagement" 3
|
|
234
|
+
Removed scope entry 3
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Testing Validation
|
|
238
|
+
|
|
239
|
+
Before running scans, test if targets are in scope:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
$ souleyez scope validate "Engagement" 192.168.1.100
|
|
243
|
+
|
|
244
|
+
Target: 192.168.1.100
|
|
245
|
+
Result: IN SCOPE
|
|
246
|
+
Matched: cidr 192.168.1.0/24 (Corporate LAN)
|
|
247
|
+
|
|
248
|
+
$ souleyez scope validate "Engagement" 10.0.0.50
|
|
249
|
+
|
|
250
|
+
Target: 10.0.0.50
|
|
251
|
+
Result: OUT OF SCOPE
|
|
252
|
+
Reason: Target '10.0.0.50' does not match any scope entry
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Interactive UI
|
|
258
|
+
|
|
259
|
+
Access scope management from the engagement menu:
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
📊 Engagement Management
|
|
263
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
264
|
+
[i] Info [h] Hosts [f] Findings
|
|
265
|
+
[c] Credentials [j] Jobs [r] Reports
|
|
266
|
+
[s] Scope [a] Attack Surface
|
|
267
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
268
|
+
[b] Back to menu
|
|
269
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
270
|
+
Select option:
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Scope Management Menu
|
|
274
|
+
|
|
275
|
+
```
|
|
276
|
+
🎯 Scope Management: Client Pentest
|
|
277
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
278
|
+
Enforcement Mode: block
|
|
279
|
+
|
|
280
|
+
Current Scope Entries:
|
|
281
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
282
|
+
ID Type Value Excluded Description
|
|
283
|
+
── ──── ───── ──────── ───────────
|
|
284
|
+
1 cidr 192.168.1.0/24 Corporate LAN
|
|
285
|
+
2 domain *.example.com Target domain
|
|
286
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
287
|
+
|
|
288
|
+
[a] Add scope entry [r] Remove entry
|
|
289
|
+
[e] Change enforcement [t] Test target
|
|
290
|
+
[h] Revalidate hosts [l] View log
|
|
291
|
+
[b] Back
|
|
292
|
+
|
|
293
|
+
Select option:
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Host Scope Indicators
|
|
297
|
+
|
|
298
|
+
In the hosts view, scope status is shown with indicators:
|
|
299
|
+
|
|
300
|
+
```
|
|
301
|
+
📡 Discovered Hosts (12 total)
|
|
302
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
303
|
+
IP Hostname OS Status
|
|
304
|
+
── ── ──────── ── ──────
|
|
305
|
+
[S] 192.168.1.10 webserver.local Ubuntu 22.04 up
|
|
306
|
+
[S] 192.168.1.11 dbserver.local Ubuntu 22.04 up
|
|
307
|
+
[!] 10.0.0.50 external.other Unknown up
|
|
308
|
+
[?] 172.16.0.1 router.internal - up
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
| Indicator | Meaning |
|
|
312
|
+
|-----------|---------|
|
|
313
|
+
| `[S]` | In scope - target matches scope entries |
|
|
314
|
+
| `[!]` | Out of scope - target outside defined scope |
|
|
315
|
+
| `[?]` | Unknown - no scope defined or not yet validated |
|
|
316
|
+
|
|
317
|
+
---
|
|
318
|
+
|
|
319
|
+
## CLI Commands
|
|
320
|
+
|
|
321
|
+
### Command Reference
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# Add scope entries
|
|
325
|
+
souleyez scope add <engagement> --cidr <range>
|
|
326
|
+
souleyez scope add <engagement> --domain <pattern>
|
|
327
|
+
souleyez scope add <engagement> --url <url>
|
|
328
|
+
souleyez scope add <engagement> --hostname <host>
|
|
329
|
+
souleyez scope add <engagement> --exclude --cidr <range> # Exclusion
|
|
330
|
+
|
|
331
|
+
# Options for add:
|
|
332
|
+
# --desc TEXT Optional description
|
|
333
|
+
# --exclude Mark as exclusion (deny rule)
|
|
334
|
+
|
|
335
|
+
# List scope
|
|
336
|
+
souleyez scope list <engagement>
|
|
337
|
+
|
|
338
|
+
# Remove scope entry
|
|
339
|
+
souleyez scope remove <engagement> <scope_id>
|
|
340
|
+
|
|
341
|
+
# Set enforcement mode
|
|
342
|
+
souleyez scope enforcement <engagement> [off|warn|block]
|
|
343
|
+
|
|
344
|
+
# Validate a target
|
|
345
|
+
souleyez scope validate <engagement> <target>
|
|
346
|
+
|
|
347
|
+
# Revalidate all hosts
|
|
348
|
+
souleyez scope revalidate <engagement>
|
|
349
|
+
|
|
350
|
+
# View validation log
|
|
351
|
+
souleyez scope log <engagement> [--limit N] [--action ACTION]
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Examples
|
|
355
|
+
|
|
356
|
+
```bash
|
|
357
|
+
# Complete scope setup for a pentest
|
|
358
|
+
$ souleyez scope add "Client Pentest" --cidr 10.10.0.0/16 --desc "Client internal network"
|
|
359
|
+
$ souleyez scope add "Client Pentest" --domain "*.client.com" --desc "Client web properties"
|
|
360
|
+
$ souleyez scope add "Client Pentest" --cidr 10.10.1.0/24 --exclude --desc "Production - do not scan"
|
|
361
|
+
$ souleyez scope enforcement "Client Pentest" block
|
|
362
|
+
|
|
363
|
+
# View what's configured
|
|
364
|
+
$ souleyez scope list "Client Pentest"
|
|
365
|
+
|
|
366
|
+
# Test before scanning
|
|
367
|
+
$ souleyez scope validate "Client Pentest" 10.10.2.50
|
|
368
|
+
$ souleyez scope validate "Client Pentest" 10.10.1.50 # Should fail
|
|
369
|
+
|
|
370
|
+
# Check audit log
|
|
371
|
+
$ souleyez scope log "Client Pentest" --limit 20
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
---
|
|
375
|
+
|
|
376
|
+
## Host Scope Status
|
|
377
|
+
|
|
378
|
+
When hosts are discovered or imported, they're automatically checked against the scope.
|
|
379
|
+
|
|
380
|
+
### Status Values
|
|
381
|
+
|
|
382
|
+
| Status | Meaning |
|
|
383
|
+
|--------|---------|
|
|
384
|
+
| `in_scope` | Host matches a scope entry |
|
|
385
|
+
| `out_of_scope` | Host doesn't match any scope entry |
|
|
386
|
+
| `unknown` | No scope defined for engagement |
|
|
387
|
+
|
|
388
|
+
### Revalidating Hosts
|
|
389
|
+
|
|
390
|
+
After modifying scope entries, revalidate all hosts:
|
|
391
|
+
|
|
392
|
+
```bash
|
|
393
|
+
$ souleyez scope revalidate "Client Pentest"
|
|
394
|
+
|
|
395
|
+
Revalidating hosts for: Client Pentest
|
|
396
|
+
Updated: 15 hosts
|
|
397
|
+
In scope: 12
|
|
398
|
+
Out of scope: 3
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
Or in the interactive UI:
|
|
402
|
+
|
|
403
|
+
```
|
|
404
|
+
[h] Revalidate hosts
|
|
405
|
+
|
|
406
|
+
Revalidating 15 hosts against current scope...
|
|
407
|
+
|
|
408
|
+
Results:
|
|
409
|
+
Updated: 15
|
|
410
|
+
In scope: 12
|
|
411
|
+
Out of scope: 3
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
---
|
|
415
|
+
|
|
416
|
+
## Audit Trail
|
|
417
|
+
|
|
418
|
+
Every scope validation decision is logged for compliance.
|
|
419
|
+
|
|
420
|
+
### Viewing the Log
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
$ souleyez scope log "Client Pentest"
|
|
424
|
+
|
|
425
|
+
Validation Log: Client Pentest (Last 50 entries)
|
|
426
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
427
|
+
Time Target Result Action Job
|
|
428
|
+
──── ────── ────── ────── ───
|
|
429
|
+
2026-01-09 10:30:15 192.168.1.100 in_scope allowed 142
|
|
430
|
+
2026-01-09 10:28:03 10.0.0.50 out_of_scope blocked -
|
|
431
|
+
2026-01-09 10:25:41 app.example.com in_scope allowed 141
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### Filtering the Log
|
|
435
|
+
|
|
436
|
+
```bash
|
|
437
|
+
# Show only blocked entries
|
|
438
|
+
$ souleyez scope log "Client Pentest" --action blocked
|
|
439
|
+
|
|
440
|
+
# Limit results
|
|
441
|
+
$ souleyez scope log "Client Pentest" --limit 100
|
|
442
|
+
```
|
|
443
|
+
|
|
444
|
+
### Log Entry Details
|
|
445
|
+
|
|
446
|
+
Each log entry includes:
|
|
447
|
+
|
|
448
|
+
| Field | Description |
|
|
449
|
+
|-------|-------------|
|
|
450
|
+
| `engagement_id` | Which engagement |
|
|
451
|
+
| `job_id` | Associated job (if any) |
|
|
452
|
+
| `target` | Target that was validated |
|
|
453
|
+
| `validation_result` | `in_scope`, `out_of_scope`, `no_scope_defined` |
|
|
454
|
+
| `action_taken` | `allowed`, `blocked`, `warned` |
|
|
455
|
+
| `matched_scope_id` | Which scope entry matched (if any) |
|
|
456
|
+
| `user_id` | User who initiated the action |
|
|
457
|
+
| `created_at` | Timestamp |
|
|
458
|
+
|
|
459
|
+
---
|
|
460
|
+
|
|
461
|
+
## Tool Chaining Behavior
|
|
462
|
+
|
|
463
|
+
When auto-chaining discovers new targets, scope validation is applied automatically.
|
|
464
|
+
|
|
465
|
+
### How It Works
|
|
466
|
+
|
|
467
|
+
1. Parent job discovers new targets (e.g., Nmap finds hosts)
|
|
468
|
+
2. Chain rules attempt to create child jobs
|
|
469
|
+
3. **Each target is validated against scope**
|
|
470
|
+
4. Out-of-scope targets are silently skipped
|
|
471
|
+
5. In-scope targets proceed normally
|
|
472
|
+
|
|
473
|
+
### Example Output
|
|
474
|
+
|
|
475
|
+
```
|
|
476
|
+
🔗 Auto-chaining from nmap...
|
|
477
|
+
✓ Enqueued: gobuster → 192.168.1.10
|
|
478
|
+
✓ Enqueued: gobuster → 192.168.1.11
|
|
479
|
+
⚠️ Skipped (out of scope): 10.0.0.50
|
|
480
|
+
✓ Enqueued: nikto → 192.168.1.10
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
### Key Behaviors
|
|
484
|
+
|
|
485
|
+
- **Silent skip**: Out-of-scope targets don't cause errors
|
|
486
|
+
- **Chain continues**: Other targets in the chain still process
|
|
487
|
+
- **Logged**: Skipped targets are logged in the audit trail
|
|
488
|
+
- **Parent unaffected**: Parent job completes normally
|
|
489
|
+
|
|
490
|
+
---
|
|
491
|
+
|
|
492
|
+
## Best Practices
|
|
493
|
+
|
|
494
|
+
### Before Starting an Engagement
|
|
495
|
+
|
|
496
|
+
1. **Define scope before scanning**
|
|
497
|
+
```bash
|
|
498
|
+
$ souleyez scope add "Engagement" --cidr 10.0.0.0/8
|
|
499
|
+
$ souleyez scope enforcement "Engagement" warn # Start with warn
|
|
500
|
+
```
|
|
501
|
+
|
|
502
|
+
2. **Document scope sources**
|
|
503
|
+
```bash
|
|
504
|
+
$ souleyez scope add "Engagement" --cidr 10.0.0.0/8 --desc "Per SOW Section 2.1"
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
3. **Add exclusions explicitly**
|
|
508
|
+
```bash
|
|
509
|
+
$ souleyez scope add "Engagement" --cidr 10.0.1.0/24 --exclude --desc "Production - client request"
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### During the Engagement
|
|
513
|
+
|
|
514
|
+
1. **Test before large scans**
|
|
515
|
+
```bash
|
|
516
|
+
$ souleyez scope validate "Engagement" 10.0.5.1
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
2. **Review warnings regularly**
|
|
520
|
+
```bash
|
|
521
|
+
$ souleyez scope log "Engagement" --action warned
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
3. **Upgrade to block mode when confident**
|
|
525
|
+
```bash
|
|
526
|
+
$ souleyez scope enforcement "Engagement" block
|
|
527
|
+
```
|
|
528
|
+
|
|
529
|
+
### For Compliance
|
|
530
|
+
|
|
531
|
+
1. **Export audit logs** for client reports
|
|
532
|
+
```bash
|
|
533
|
+
$ souleyez scope log "Engagement" --limit 1000
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
2. **Include scope in deliverables**
|
|
537
|
+
- Document what was in scope
|
|
538
|
+
- Document what was excluded
|
|
539
|
+
- Reference enforcement mode used
|
|
540
|
+
|
|
541
|
+
3. **Use block mode** for regulated industries
|
|
542
|
+
- Healthcare (HIPAA)
|
|
543
|
+
- Finance (PCI-DSS)
|
|
544
|
+
- Government (FedRAMP)
|
|
545
|
+
|
|
546
|
+
### Enforcement Mode Guidelines
|
|
547
|
+
|
|
548
|
+
| Scenario | Recommended Mode |
|
|
549
|
+
|----------|------------------|
|
|
550
|
+
| Learning/testing the feature | `off` |
|
|
551
|
+
| First engagement with scope | `warn` |
|
|
552
|
+
| Established workflow | `block` |
|
|
553
|
+
| Compliance-sensitive | `block` |
|
|
554
|
+
| Bug bounty (broad scope) | `warn` |
|
|
555
|
+
| Internal red team | `block` |
|
|
556
|
+
|
|
557
|
+
---
|
|
558
|
+
|
|
559
|
+
## Troubleshooting
|
|
560
|
+
|
|
561
|
+
### "Target is out of scope"
|
|
562
|
+
|
|
563
|
+
The target doesn't match any scope entry and enforcement is set to `block`.
|
|
564
|
+
|
|
565
|
+
**Solutions:**
|
|
566
|
+
1. Add the target to scope:
|
|
567
|
+
```bash
|
|
568
|
+
$ souleyez scope add "Engagement" --cidr 10.0.0.0/24
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
2. Check existing scope:
|
|
572
|
+
```bash
|
|
573
|
+
$ souleyez scope list "Engagement"
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
3. Temporarily switch to warn mode:
|
|
577
|
+
```bash
|
|
578
|
+
$ souleyez scope enforcement "Engagement" warn
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### Hosts showing `[?]` unknown status
|
|
582
|
+
|
|
583
|
+
No scope is defined for the engagement.
|
|
584
|
+
|
|
585
|
+
**Solution:**
|
|
586
|
+
Add scope entries to enable status tracking:
|
|
587
|
+
```bash
|
|
588
|
+
$ souleyez scope add "Engagement" --cidr 192.168.0.0/16
|
|
589
|
+
$ souleyez scope revalidate "Engagement"
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
### Tool chaining skipping valid targets
|
|
593
|
+
|
|
594
|
+
Targets may appear valid but aren't matching scope patterns.
|
|
595
|
+
|
|
596
|
+
**Debug steps:**
|
|
597
|
+
1. Test the target directly:
|
|
598
|
+
```bash
|
|
599
|
+
$ souleyez scope validate "Engagement" <target>
|
|
600
|
+
```
|
|
601
|
+
|
|
602
|
+
2. Check for typos in scope entries:
|
|
603
|
+
```bash
|
|
604
|
+
$ souleyez scope list "Engagement"
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
3. Verify domain patterns:
|
|
608
|
+
- `*.example.com` - includes subdomains
|
|
609
|
+
- `example.com` - exact match only
|
|
610
|
+
|
|
611
|
+
### Scope validation slowing down jobs
|
|
612
|
+
|
|
613
|
+
Scope validation adds minimal overhead (< 1ms per target). If experiencing slowness:
|
|
614
|
+
|
|
615
|
+
1. Check database performance
|
|
616
|
+
2. Reduce scope entry count if possible
|
|
617
|
+
3. Use broader CIDR ranges instead of many /32s
|
|
618
|
+
|
|
619
|
+
### Warnings not appearing in job metadata
|
|
620
|
+
|
|
621
|
+
Ensure enforcement mode is set to `warn`:
|
|
622
|
+
```bash
|
|
623
|
+
$ souleyez scope enforcement "Engagement" warn
|
|
624
|
+
```
|
|
625
|
+
|
|
626
|
+
If set to `off`, no validation occurs.
|
|
627
|
+
|
|
628
|
+
---
|
|
629
|
+
|
|
630
|
+
## Quick Reference
|
|
631
|
+
|
|
632
|
+
### Common Commands
|
|
633
|
+
|
|
634
|
+
```bash
|
|
635
|
+
# Setup
|
|
636
|
+
souleyez scope add <eng> --cidr <range> # Add network
|
|
637
|
+
souleyez scope add <eng> --domain "<pattern>" # Add domain
|
|
638
|
+
souleyez scope add <eng> --exclude --cidr <r> # Add exclusion
|
|
639
|
+
souleyez scope enforcement <eng> [off|warn|block]
|
|
640
|
+
|
|
641
|
+
# Manage
|
|
642
|
+
souleyez scope list <eng> # List entries
|
|
643
|
+
souleyez scope remove <eng> <id> # Remove entry
|
|
644
|
+
souleyez scope validate <eng> <target> # Test target
|
|
645
|
+
|
|
646
|
+
# Hosts
|
|
647
|
+
souleyez scope revalidate <eng> # Update all hosts
|
|
648
|
+
|
|
649
|
+
# Audit
|
|
650
|
+
souleyez scope log <eng> # View log
|
|
651
|
+
souleyez scope log <eng> --action blocked # Filter blocked
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
### Scope Types Quick Reference
|
|
655
|
+
|
|
656
|
+
| Type | Example | Matches |
|
|
657
|
+
|------|---------|---------|
|
|
658
|
+
| `cidr` | `192.168.1.0/24` | Any IP in range |
|
|
659
|
+
| `domain` | `*.example.com` | Subdomains + base |
|
|
660
|
+
| `domain` | `example.com` | Exact match only |
|
|
661
|
+
| `url` | `https://app.example.com` | Host extraction |
|
|
662
|
+
| `hostname` | `server.local` | Exact match |
|
|
663
|
+
|
|
664
|
+
### Enforcement Quick Reference
|
|
665
|
+
|
|
666
|
+
| Mode | Out-of-scope targets |
|
|
667
|
+
|------|---------------------|
|
|
668
|
+
| `off` | Allowed, no logging |
|
|
669
|
+
| `warn` | Allowed + warning logged |
|
|
670
|
+
| `block` | Rejected with error |
|
|
671
|
+
|
|
672
|
+
---
|
|
673
|
+
|
|
674
|
+
## Related Documentation
|
|
675
|
+
|
|
676
|
+
- [Auto-Chaining Guide](./auto-chaining.md) - How tool chaining works
|
|
677
|
+
- [Getting Started](./getting-started.md) - Initial setup
|
|
678
|
+
- [RBAC Guide](./rbac.md) - User permissions
|
|
679
|
+
- [Security Best Practices](../security/best-practices.md) - Security guidelines
|
|
680
|
+
|
|
681
|
+
---
|
|
682
|
+
|
|
683
|
+
*For support, contact support@souleyez.com or visit github.com/cyber-soul-security/souleyez*
|