hedra 1.0.1 → 2.0.1
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.
- checksums.yaml +4 -4
- data/LICENSE +1 -1
- data/README.md +399 -107
- data/config/example_config.yml +88 -10
- data/lib/hedra/analyzer.rb +74 -8
- data/lib/hedra/baseline.rb +83 -0
- data/lib/hedra/cache.rb +93 -0
- data/lib/hedra/certificate_checker.rb +94 -0
- data/lib/hedra/circuit_breaker.rb +80 -0
- data/lib/hedra/cli.rb +271 -18
- data/lib/hedra/config.rb +1 -1
- data/lib/hedra/exporter.rb +7 -0
- data/lib/hedra/html_reporter.rb +143 -0
- data/lib/hedra/http_client.rb +49 -9
- data/lib/hedra/progress_tracker.rb +45 -0
- data/lib/hedra/rate_limiter.rb +60 -0
- data/lib/hedra/security_txt_checker.rb +93 -0
- data/lib/hedra/version.rb +1 -1
- data/lib/hedra.rb +17 -9
- metadata +12 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 29f821e98e18bbcc4bcf7fbc46ee4fa54f064c64b270af72e16311ab41c751e3
|
|
4
|
+
data.tar.gz: bbe84abcc44aa9e0329a5fac5537465fae853b6f29a0b7a07725f3eb2b9f6b65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1bea6171146693b87f815945d6c572d0336b3035d56eafeb382406f8e74578f408b4c2a1282e6cb3dc2a131d4e03d9606733173f669a5a8f9d1993ae15cb84b5
|
|
7
|
+
data.tar.gz: 0b14d12d73cfa5037ab5481d722ddbf399dbc8a634f9b856748d6b9411d282af66c1ffb14afcafebb7ea695fa92a25dc348bfc793bdee1fba8f04633acfc360b
|
data/LICENSE
CHANGED
data/README.md
CHANGED
|
@@ -1,147 +1,461 @@
|
|
|
1
|
-
# Hedra
|
|
1
|
+
# Hedra
|
|
2
2
|
|
|
3
|
-
[](https://www.ruby-lang.org/)
|
|
4
|
+
[](https://rubygems.org/gems/hedra)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://rubygems.org/gems/hedra)
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
> Security header analyzer with SSL/TLS validation, baseline tracking, and CI/CD integration.
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
<p align="center">
|
|
11
|
+
<img src="logo.png" width="380" alt="Hedra Logo"/>
|
|
12
|
+
</p>
|
|
11
13
|
|
|
14
|
+
## Installation
|
|
12
15
|
```bash
|
|
13
16
|
gem install hedra
|
|
14
17
|
```
|
|
15
18
|
|
|
16
|
-
##
|
|
19
|
+
## Quick Start
|
|
20
|
+
```bash
|
|
21
|
+
hedra scan https://github.com
|
|
22
|
+
hedra audit https://stripe.com --json
|
|
23
|
+
hedra scan -f urls.txt --format html --output report.html
|
|
24
|
+
```
|
|
17
25
|
|
|
18
|
-
|
|
26
|
+
## Commands
|
|
19
27
|
|
|
28
|
+
### scan
|
|
29
|
+
|
|
30
|
+
Scan URLs for security headers with flexible output options.
|
|
20
31
|
```bash
|
|
21
|
-
hedra scan https://
|
|
32
|
+
hedra scan https://github.com
|
|
33
|
+
hedra scan -f urls.txt --concurrency 20
|
|
34
|
+
hedra scan https://stripe.com --cache --rate 10/s
|
|
22
35
|
```
|
|
23
36
|
|
|
24
|
-
|
|
25
|
-
|
|
37
|
+
**Key Options:**
|
|
38
|
+
- `-f, --file FILE` • Read URLs from file
|
|
39
|
+
- `-c, --concurrency N` • Concurrent requests (default: 10)
|
|
40
|
+
- `-t, --timeout N` • Request timeout in seconds (default: 10)
|
|
41
|
+
- `--rate RATE` • Rate limit: 10/s, 100/m, 1000/h
|
|
42
|
+
- `--cache` • Enable response caching
|
|
43
|
+
- `--cache-ttl N` • Cache TTL in seconds (default: 3600)
|
|
44
|
+
- `-o, --output FILE` • Output file
|
|
45
|
+
- `--format FORMAT` • table, json, csv, html (default: table)
|
|
46
|
+
- `--proxy URL` • HTTP/SOCKS proxy
|
|
47
|
+
- `--user-agent STRING` • Custom User-Agent
|
|
48
|
+
- `--save-baseline NAME` • Save results as baseline
|
|
49
|
+
- `--[no-]progress` • Show/hide progress bar
|
|
50
|
+
- `--[no-]check-certificates` • SSL checks (default: enabled)
|
|
51
|
+
- `--[no-]check-security-txt` • RFC 9116 checks
|
|
52
|
+
|
|
53
|
+
### audit
|
|
54
|
+
|
|
55
|
+
Deep security audit with detailed recommendations.
|
|
26
56
|
```bash
|
|
27
|
-
hedra audit https://
|
|
57
|
+
hedra audit https://github.com
|
|
58
|
+
hedra audit https://api.stripe.com --json --output report.json
|
|
28
59
|
```
|
|
29
60
|
|
|
30
|
-
|
|
61
|
+
**Options:**
|
|
62
|
+
- `--json` • JSON output format
|
|
63
|
+
- `-o, --output FILE` • Output file
|
|
64
|
+
- `--proxy URL` • HTTP/SOCKS proxy
|
|
65
|
+
- `--user-agent STRING` • Custom User-Agent
|
|
66
|
+
- `-t, --timeout N` • Request timeout
|
|
67
|
+
- `--[no-]check-certificates` • SSL/TLS validation
|
|
68
|
+
- `--[no-]check-security-txt` • security.txt checks
|
|
31
69
|
|
|
70
|
+
### watch
|
|
71
|
+
|
|
72
|
+
Monitor security headers periodically.
|
|
32
73
|
```bash
|
|
33
|
-
hedra
|
|
74
|
+
hedra watch https://myapp.com --interval 3600
|
|
34
75
|
```
|
|
35
76
|
|
|
36
|
-
|
|
77
|
+
**Options:**
|
|
78
|
+
- `--interval N` • Check interval in seconds (default: 3600)
|
|
79
|
+
|
|
80
|
+
### compare
|
|
37
81
|
|
|
82
|
+
Compare security headers between environments.
|
|
38
83
|
```bash
|
|
39
|
-
|
|
40
|
-
hedra scan -f urls.txt --concurrency 20
|
|
84
|
+
hedra compare https://staging.myapp.com https://myapp.com
|
|
41
85
|
```
|
|
42
86
|
|
|
43
|
-
###
|
|
87
|
+
### ci_check
|
|
44
88
|
|
|
89
|
+
CI/CD-friendly check with exit codes and thresholds.
|
|
45
90
|
```bash
|
|
46
|
-
hedra
|
|
91
|
+
hedra ci_check https://myapp.com --threshold 85
|
|
92
|
+
hedra ci_check -f urls.txt --fail-on-critical
|
|
47
93
|
```
|
|
48
94
|
|
|
49
|
-
|
|
95
|
+
**Options:**
|
|
96
|
+
- `-f, --file FILE` • Read URLs from file
|
|
97
|
+
- `--threshold N` • Minimum score threshold (default: 80)
|
|
98
|
+
- `--fail-on-critical` • Fail on critical issues (default: true)
|
|
50
99
|
|
|
100
|
+
**Exit Codes:**
|
|
101
|
+
- `0` • All checks passed
|
|
102
|
+
- `1` • Score below threshold or critical issues found
|
|
103
|
+
|
|
104
|
+
### baseline
|
|
105
|
+
|
|
106
|
+
Track security posture changes over time.
|
|
51
107
|
```bash
|
|
52
|
-
hedra
|
|
108
|
+
hedra baseline list
|
|
109
|
+
hedra baseline compare production-v1 -f urls.txt
|
|
110
|
+
hedra baseline delete production-v1
|
|
53
111
|
```
|
|
54
112
|
|
|
55
|
-
|
|
113
|
+
### cache
|
|
56
114
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- **Permissions-Policy** - Controls browser features
|
|
63
|
-
- **Cross-Origin-Opener-Policy (COOP)**
|
|
64
|
-
- **Cross-Origin-Embedder-Policy (COEP)**
|
|
65
|
-
- **Cross-Origin-Resource-Policy (CORP)**
|
|
115
|
+
Manage response cache for faster repeated scans.
|
|
116
|
+
```bash
|
|
117
|
+
hedra cache clear
|
|
118
|
+
hedra cache clear-expired
|
|
119
|
+
```
|
|
66
120
|
|
|
67
|
-
|
|
121
|
+
### plugin
|
|
68
122
|
|
|
123
|
+
Extend functionality with custom security checks.
|
|
69
124
|
```bash
|
|
70
|
-
|
|
71
|
-
hedra
|
|
125
|
+
hedra plugin list
|
|
126
|
+
hedra plugin install path/to/plugin.rb
|
|
127
|
+
hedra plugin remove plugin_name
|
|
128
|
+
```
|
|
72
129
|
|
|
73
|
-
|
|
74
|
-
hedra scan https://example.com --proxy http://127.0.0.1:8080
|
|
130
|
+
## Security Checks
|
|
75
131
|
|
|
76
|
-
|
|
77
|
-
hedra scan https://example.com --user-agent "MyBot/1.0"
|
|
132
|
+
### HTTP Headers Analyzed
|
|
78
133
|
|
|
79
|
-
|
|
80
|
-
|
|
134
|
+
| Header | Weight | Purpose |
|
|
135
|
+
|--------|--------|---------|
|
|
136
|
+
| Content-Security-Policy | 25 pts | Prevent XSS and injection attacks |
|
|
137
|
+
| Strict-Transport-Security | 25 pts | Enforce HTTPS connections |
|
|
138
|
+
| X-Frame-Options | 15 pts | Prevent clickjacking |
|
|
139
|
+
| X-Content-Type-Options | 10 pts | Stop MIME-type sniffing |
|
|
140
|
+
| Referrer-Policy | 10 pts | Control referrer information |
|
|
141
|
+
| Permissions-Policy | 5 pts | Manage browser features |
|
|
142
|
+
| Cross-Origin-Opener-Policy | 5 pts | Isolate browsing context |
|
|
143
|
+
| Cross-Origin-Embedder-Policy | 3 pts | Enable cross-origin isolation |
|
|
144
|
+
| Cross-Origin-Resource-Policy | 2 pts | Control resource loading |
|
|
81
145
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
146
|
+
### Additional Validations
|
|
147
|
+
|
|
148
|
+
**SSL/TLS Checks:**
|
|
149
|
+
- Certificate expiry dates
|
|
150
|
+
- Signature algorithm strength
|
|
151
|
+
- Key size validation
|
|
152
|
+
- Chain verification
|
|
153
|
+
|
|
154
|
+
**RFC 9116:**
|
|
155
|
+
- security.txt file presence and format
|
|
156
|
+
|
|
157
|
+
### Scoring System
|
|
158
|
+
|
|
159
|
+
**Base:** 100 points from header weights
|
|
160
|
+
|
|
161
|
+
**Penalties:**
|
|
162
|
+
- Critical issue: -20 points
|
|
163
|
+
- Warning: -10 points
|
|
164
|
+
- Info: -5 points
|
|
85
165
|
|
|
86
166
|
## Configuration
|
|
87
167
|
|
|
88
168
|
Create `~/.hedra/config.yml`:
|
|
89
|
-
|
|
90
169
|
```yaml
|
|
170
|
+
# HTTP settings
|
|
91
171
|
timeout: 10
|
|
92
172
|
concurrency: 10
|
|
93
|
-
user_agent: "Hedra/
|
|
94
|
-
|
|
173
|
+
user_agent: "Hedra/2.0.0"
|
|
174
|
+
follow_redirects: true
|
|
175
|
+
max_retries: 3
|
|
176
|
+
|
|
177
|
+
# Performance
|
|
178
|
+
cache_enabled: false
|
|
179
|
+
cache_ttl: 3600
|
|
180
|
+
rate_limit: "10/s"
|
|
181
|
+
|
|
182
|
+
# Security checks
|
|
183
|
+
check_certificates: true
|
|
184
|
+
check_security_txt: false
|
|
185
|
+
|
|
186
|
+
# Output
|
|
187
|
+
output_format: "table"
|
|
188
|
+
progress_bar: true
|
|
189
|
+
|
|
190
|
+
# Circuit breaker
|
|
191
|
+
circuit_breaker_threshold: 5
|
|
192
|
+
circuit_breaker_timeout: 60
|
|
95
193
|
```
|
|
96
194
|
|
|
97
195
|
## Custom Rules
|
|
98
196
|
|
|
99
|
-
|
|
100
|
-
|
|
197
|
+
Define organization-specific policies in `~/.hedra/rules.yml`:
|
|
101
198
|
```yaml
|
|
102
199
|
rules:
|
|
103
200
|
- header: "X-Custom-Security"
|
|
104
201
|
type: missing
|
|
105
202
|
severity: warning
|
|
106
203
|
message: "Custom security header is missing"
|
|
107
|
-
fix: "Add X-Custom-Security
|
|
204
|
+
fix: "Add X-Custom-Security: enabled"
|
|
205
|
+
|
|
206
|
+
- header: "Server"
|
|
207
|
+
type: pattern
|
|
208
|
+
pattern: "^(Apache|nginx)"
|
|
209
|
+
severity: info
|
|
210
|
+
message: "Server header exposes software version"
|
|
211
|
+
fix: "Remove or obfuscate Server header"
|
|
108
212
|
```
|
|
109
213
|
|
|
110
|
-
|
|
214
|
+
**Rule Types:**
|
|
215
|
+
- `missing` • Header should be present
|
|
216
|
+
- `pattern` • Header value must match regex
|
|
217
|
+
|
|
218
|
+
**Severity Levels:**
|
|
219
|
+
- `critical` • -20 points, immediate action required
|
|
220
|
+
- `warning` • -10 points, should be addressed
|
|
221
|
+
- `info` • -5 points, best practice
|
|
111
222
|
|
|
112
|
-
|
|
223
|
+
## Plugin System
|
|
113
224
|
|
|
225
|
+
Create custom checks in `~/.hedra/plugins/`:
|
|
114
226
|
```ruby
|
|
115
|
-
# ~/.hedra/plugins/
|
|
227
|
+
# ~/.hedra/plugins/corporate_policy.rb
|
|
116
228
|
module Hedra
|
|
117
|
-
class
|
|
229
|
+
class CorporatePolicyPlugin < Plugin
|
|
118
230
|
def self.check(headers)
|
|
119
231
|
findings = []
|
|
120
|
-
|
|
232
|
+
|
|
233
|
+
# Enforce corporate header
|
|
234
|
+
unless headers.key?('x-corp-security')
|
|
235
|
+
findings << {
|
|
236
|
+
header: 'x-corp-security',
|
|
237
|
+
issue: 'Corporate security header missing',
|
|
238
|
+
severity: :critical,
|
|
239
|
+
recommended_fix: 'Add X-Corp-Security: v2'
|
|
240
|
+
}
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
# Check version disclosure
|
|
244
|
+
if headers['server']&.match?(/\d+\.\d+/)
|
|
121
245
|
findings << {
|
|
122
|
-
header: '
|
|
123
|
-
issue: '
|
|
246
|
+
header: 'server',
|
|
247
|
+
issue: 'Server version exposed',
|
|
124
248
|
severity: :warning,
|
|
125
|
-
recommended_fix: '
|
|
249
|
+
recommended_fix: 'Remove version from Server header'
|
|
126
250
|
}
|
|
127
251
|
end
|
|
252
|
+
|
|
128
253
|
findings
|
|
129
254
|
end
|
|
130
255
|
end
|
|
131
256
|
end
|
|
132
257
|
```
|
|
133
258
|
|
|
134
|
-
|
|
135
|
-
|
|
259
|
+
**Management:**
|
|
136
260
|
```bash
|
|
137
|
-
hedra plugin install ~/.hedra/plugins/
|
|
261
|
+
hedra plugin install ~/.hedra/plugins/corporate_policy.rb
|
|
138
262
|
hedra plugin list
|
|
263
|
+
hedra plugin remove corporate_policy
|
|
139
264
|
```
|
|
140
265
|
|
|
141
|
-
##
|
|
266
|
+
## CI/CD Integration
|
|
267
|
+
|
|
268
|
+
### GitHub Actions
|
|
269
|
+
```yaml
|
|
270
|
+
name: Security Headers Check
|
|
271
|
+
|
|
272
|
+
on: [push, pull_request]
|
|
273
|
+
|
|
274
|
+
jobs:
|
|
275
|
+
security-scan:
|
|
276
|
+
runs-on: ubuntu-latest
|
|
277
|
+
steps:
|
|
278
|
+
- uses: actions/checkout@v3
|
|
279
|
+
|
|
280
|
+
- name: Setup Ruby
|
|
281
|
+
uses: ruby/setup-ruby@v1
|
|
282
|
+
with:
|
|
283
|
+
ruby-version: '3.2'
|
|
284
|
+
|
|
285
|
+
- name: Install Hedra
|
|
286
|
+
run: gem install hedra
|
|
287
|
+
|
|
288
|
+
- name: Run Security Check
|
|
289
|
+
run: hedra ci_check ${{ secrets.APP_URL }} --threshold 85
|
|
290
|
+
|
|
291
|
+
- name: Generate HTML Report
|
|
292
|
+
if: always()
|
|
293
|
+
run: hedra scan ${{ secrets.APP_URL }} --output report.html --format html
|
|
294
|
+
|
|
295
|
+
- name: Upload Report
|
|
296
|
+
if: always()
|
|
297
|
+
uses: actions/upload-artifact@v3
|
|
298
|
+
with:
|
|
299
|
+
name: security-report
|
|
300
|
+
path: report.html
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
### GitLab CI
|
|
304
|
+
```yaml
|
|
305
|
+
security_headers:
|
|
306
|
+
image: ruby:3.2
|
|
307
|
+
script:
|
|
308
|
+
- gem install hedra
|
|
309
|
+
- hedra ci_check $APP_URL --threshold 85
|
|
310
|
+
- hedra scan $APP_URL --output report.json --format json
|
|
311
|
+
artifacts:
|
|
312
|
+
reports:
|
|
313
|
+
junit: report.json
|
|
314
|
+
paths:
|
|
315
|
+
- report.json
|
|
316
|
+
only:
|
|
317
|
+
- merge_requests
|
|
318
|
+
- main
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### Jenkins Pipeline
|
|
322
|
+
```groovy
|
|
323
|
+
pipeline {
|
|
324
|
+
agent any
|
|
325
|
+
|
|
326
|
+
stages {
|
|
327
|
+
stage('Security Headers') {
|
|
328
|
+
steps {
|
|
329
|
+
sh 'gem install hedra'
|
|
330
|
+
sh 'hedra ci_check ${APP_URL} --threshold 85'
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
post {
|
|
336
|
+
always {
|
|
337
|
+
sh 'hedra scan ${APP_URL} --output report.html --format html'
|
|
338
|
+
publishHTML([
|
|
339
|
+
reportDir: '.',
|
|
340
|
+
reportFiles: 'report.html',
|
|
341
|
+
reportName: 'Security Report'
|
|
342
|
+
])
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
## Export Formats
|
|
349
|
+
|
|
350
|
+
### Table (Default)
|
|
351
|
+
```bash
|
|
352
|
+
hedra scan https://github.com
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
Clean, colored terminal output with scores and recommendations.
|
|
356
|
+
|
|
357
|
+
### JSON
|
|
358
|
+
```bash
|
|
359
|
+
hedra scan https://stripe.com --output report.json --format json
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Structured data for automation and parsing.
|
|
142
363
|
|
|
364
|
+
### CSV
|
|
143
365
|
```bash
|
|
144
|
-
|
|
366
|
+
hedra scan -f urls.txt --output report.csv --format csv
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
Import into spreadsheets for analysis and tracking.
|
|
370
|
+
|
|
371
|
+
### HTML
|
|
372
|
+
```bash
|
|
373
|
+
hedra scan -f urls.txt --output report.html --format html
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
Interactive report with sorting, filtering, and charts.
|
|
377
|
+
|
|
378
|
+
## Real-World Examples
|
|
379
|
+
|
|
380
|
+
### Basic Security Audit
|
|
381
|
+
```bash
|
|
382
|
+
hedra scan https://myapp.com
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### Production Deployment Check
|
|
386
|
+
```bash
|
|
387
|
+
# Save baseline after deployment
|
|
388
|
+
hedra scan -f production-urls.txt --save-baseline prod-v2.1.0
|
|
389
|
+
|
|
390
|
+
# Compare before next deployment
|
|
391
|
+
hedra baseline compare prod-v2.1.0 -f production-urls.txt
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
### High-Volume Scanning
|
|
395
|
+
```bash
|
|
396
|
+
# Scan 1000 URLs with rate limiting and caching
|
|
397
|
+
hedra scan -f large-list.txt \
|
|
398
|
+
--concurrency 50 \
|
|
399
|
+
--rate 20/s \
|
|
400
|
+
--cache \
|
|
401
|
+
--output results.json \
|
|
402
|
+
--format json
|
|
403
|
+
```
|
|
404
|
+
|
|
405
|
+
### Continuous Monitoring
|
|
406
|
+
```bash
|
|
407
|
+
# Check every hour
|
|
408
|
+
hedra watch https://api.myapp.com --interval 3600
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
### Environment Comparison
|
|
412
|
+
```bash
|
|
413
|
+
hedra compare https://staging.myapp.com https://myapp.com
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### Proxy-Based Testing
|
|
417
|
+
```bash
|
|
418
|
+
# Route through Burp Suite
|
|
419
|
+
hedra scan https://target.com --proxy http://127.0.0.1:8080
|
|
420
|
+
```
|
|
421
|
+
|
|
422
|
+
### Custom User-Agent
|
|
423
|
+
```bash
|
|
424
|
+
hedra scan https://myapp.com --user-agent "Mozilla/5.0 (iPhone; CPU iPhone OS 14_0)"
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
## Performance Tuning
|
|
428
|
+
|
|
429
|
+
### Caching Strategy
|
|
430
|
+
```bash
|
|
431
|
+
# Enable caching for repeated scans
|
|
432
|
+
hedra scan -f urls.txt --cache --cache-ttl 7200
|
|
433
|
+
|
|
434
|
+
# Clear cache when needed
|
|
435
|
+
hedra cache clear
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
### Rate Limiting
|
|
439
|
+
```bash
|
|
440
|
+
# Conservative approach
|
|
441
|
+
hedra scan -f urls.txt --rate 10/s --concurrency 5
|
|
442
|
+
|
|
443
|
+
# Aggressive scanning
|
|
444
|
+
hedra scan -f urls.txt --rate 100/s --concurrency 50
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### Timeout Configuration
|
|
448
|
+
```bash
|
|
449
|
+
# Fast scan for responsive servers
|
|
450
|
+
hedra scan -f urls.txt --timeout 5
|
|
451
|
+
|
|
452
|
+
# Patient scan for slow servers
|
|
453
|
+
hedra scan -f urls.txt --timeout 30
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
## Development
|
|
457
|
+
```bash
|
|
458
|
+
# Clone and setup
|
|
145
459
|
git clone https://github.com/blackstack/hedra.git
|
|
146
460
|
cd hedra
|
|
147
461
|
bundle install
|
|
@@ -149,67 +463,45 @@ bundle install
|
|
|
149
463
|
# Run tests
|
|
150
464
|
bundle exec rspec
|
|
151
465
|
|
|
152
|
-
#
|
|
466
|
+
# Check code style
|
|
153
467
|
bundle exec rubocop
|
|
154
468
|
|
|
155
469
|
# Build gem
|
|
156
470
|
rake build
|
|
471
|
+
gem install pkg/hedra-*.gem
|
|
157
472
|
```
|
|
158
473
|
|
|
159
|
-
##
|
|
160
|
-
|
|
161
|
-
### Table Format
|
|
474
|
+
## Troubleshooting
|
|
162
475
|
|
|
476
|
+
### SSL Certificate Errors
|
|
477
|
+
```bash
|
|
478
|
+
# Skip certificate validation
|
|
479
|
+
hedra scan https://self-signed.badssl.com --no-check-certificates
|
|
163
480
|
```
|
|
164
|
-
https://example.com
|
|
165
|
-
Score: 75/100
|
|
166
|
-
Timestamp: 2025-11-12T10:30:00Z
|
|
167
481
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
│ referrer-policy │ Header is missing │ ● INFO │
|
|
173
|
-
└─────────────────────────────┴──────────────────────────────┴──────────────┘
|
|
482
|
+
### Rate Limiting Issues
|
|
483
|
+
```bash
|
|
484
|
+
# Reduce load on target server
|
|
485
|
+
hedra scan -f urls.txt --concurrency 1 --rate 1/s
|
|
174
486
|
```
|
|
175
487
|
|
|
176
|
-
###
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
"url": "https://example.com",
|
|
181
|
-
"timestamp": "2025-11-12T10:30:00Z",
|
|
182
|
-
"score": 75,
|
|
183
|
-
"headers": {
|
|
184
|
-
"content-security-policy": "default-src 'self'",
|
|
185
|
-
"strict-transport-security": "max-age=31536000"
|
|
186
|
-
},
|
|
187
|
-
"findings": [
|
|
188
|
-
{
|
|
189
|
-
"header": "x-frame-options",
|
|
190
|
-
"issue": "X-Frame-Options header is missing",
|
|
191
|
-
"severity": "warning",
|
|
192
|
-
"recommended_fix": "Add X-Frame-Options: DENY or SAMEORIGIN"
|
|
193
|
-
}
|
|
194
|
-
]
|
|
195
|
-
}
|
|
488
|
+
### Timeout Problems
|
|
489
|
+
```bash
|
|
490
|
+
# Increase timeout for slow servers
|
|
491
|
+
hedra scan https://slow-server.com --timeout 60
|
|
196
492
|
```
|
|
197
493
|
|
|
198
|
-
##
|
|
494
|
+
## Resources
|
|
199
495
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
5. Ensure linting passes (`bundle exec rubocop`)
|
|
205
|
-
6. Commit your changes (`git commit -am 'Add amazing feature'`)
|
|
206
|
-
7. Push to the branch (`git push origin feature/amazing-feature`)
|
|
207
|
-
8. Open a Pull Request
|
|
496
|
+
**GitHub:** https://github.com/blackstack/hedra
|
|
497
|
+
**RubyGems:** https://rubygems.org/gems/hedra
|
|
498
|
+
**Issues:** https://github.com/blackstack/hedra/issues
|
|
499
|
+
**OWASP Headers:** https://owasp.org/www-project-secure-headers/
|
|
208
500
|
|
|
209
501
|
## License
|
|
210
502
|
|
|
211
|
-
MIT License - see [LICENSE](LICENSE)
|
|
503
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
212
504
|
|
|
213
505
|
---
|
|
214
506
|
|
|
215
|
-
Built by [BlackStack](https://github.com/bl4ckstack)
|
|
507
|
+
**Built by [BlackStack](https://github.com/bl4ckstack)** • Securing the web, one header at a time.
|