You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
version: "v1.4.5"# pin plugin release for deterministic behaviour
492
-
```
493
-
</details>
378
+
We can't cover all the possible configurations for Traefik in this guide, so please refer to the [official documentation](https://doc.traefik.io/traefik/) for more information.
494
379
495
380
### Directives
496
381
@@ -516,11 +401,51 @@ If the AppSec Component returns `500` status code should the request be blocked.
516
401
517
402
If the AppSec Component is unreachable should the request be blocked.
518
403
519
-
## Validate the stack
404
+
## Testing the AppSec Component + Remediation Component
405
+
406
+
:::note
407
+
We're assuming the web server is installed on the same machine and is listening on port 80. Please adjust your testing accordingly if this is not the case.
408
+
:::
409
+
410
+
if you try to access `http://localhost/.env` from a browser, your request will be blocked, resulting in the display of the following HTML page:
411
+
412
+

413
+
414
+
We can also look at the metrics from `cscli metrics show appsec` it will display:
415
+
- the number of requests processed by the AppSec Component
416
+
- Individual rule matches
417
+
418
+
<details>
419
+
<summary>Example Output</summary>
420
+
421
+
```bash title="sudo cscli metrics show appsec"
422
+
Appsec Metrics:
423
+
╭─────────────────┬───────────┬─────────╮
424
+
│ Appsec Engine │ Processed │ Blocked │
425
+
├─────────────────┼───────────┼─────────┤
426
+
│ 127.0.0.1:7422/ │ 2 │ 1 │
427
+
╰─────────────────┴───────────┴─────────╯
428
+
429
+
Appsec '127.0.0.1:7422/' Rules Metrics:
430
+
╭─────────────────────────────────┬───────────╮
431
+
│ Rule ID │ Triggered │
432
+
├─────────────────────────────────┼───────────┤
433
+
│ crowdsecurity/vpatch-env-access │ 1 │
434
+
╰─────────────────────────────────┴───────────╯
435
+
```
436
+
437
+
</details>
438
+
439
+
### Explanation
440
+
441
+
What happened in the test that we just did is:
520
442
521
-
Follow the [Stack health check](/u/getting_started/health_check) to confirm the
522
-
CrowdSec engine, AppSec Component, and Traefik bouncer are working together as
523
-
expected.
443
+
1. We did a request (`localhost/.env`) to our local webserver
444
+
2. Thanks to the Remediation Component configuration, forwarded the request to `http://127.0.0.1:7422`
445
+
3. Our AppSec Component, listening on `http://127.0.0.1:7422` analyzed the request
446
+
4. The request matches the [AppSec rule to detect .env access](https://app.crowdsec.net/hub/author/crowdsecurity/appsec-rules/vpatch-env-access)
447
+
5. The AppSec Component thus answered with [HTTP 403](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/403) to the Remediation Component, indicating that the request must be blocked
448
+
6. The web server then presented us with the default "request blocked" page.
524
449
525
450
## Integration with the console
526
451
@@ -535,5 +460,6 @@ Once done, all your alerts, including the ones generated by the AppSec Component
535
460
You are now running the AppSec Component on your Crowdsec Security Engine, congrats!
536
461
537
462
As the next steps, you can:
463
+
- [Explore the hub](https://hub.crowdsec.net) to find more rules for your use case
538
464
- Look at the [Rules syntax](/appsec/rules_syntax.md) and [creation process](/appsec/create_rules.md) to create your own and contribute
539
-
- Learn more about AppSec’s advanced capabilities in [Advanced WAF Deployments](/docs/next/appsec/advanced_deployments/)
465
+
- Take a look at [the benchmarks](/appsec/benchmark.md)
0 commit comments