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