Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
|
coraza [2026/02/24 11:16] jango |
coraza [2026/02/24 16:12] (aktuell) jango |
||
|---|---|---|---|
| Zeile 16: | Zeile 16: | ||
| cd coraza-spoa | cd coraza-spoa | ||
| - | go run mage.go build | + | sudo go run mage.go build |
| # binary is in build now | # binary is in build now | ||
| Zeile 37: | Zeile 37: | ||
| < | < | ||
| + | [root@vpsv-haproxy1 ~]# cat / | ||
| [coraza] | [coraza] | ||
| spoe-agent coraza-agent | spoe-agent coraza-agent | ||
| - | messages | + | messages |
| option var-prefix coraza | option var-prefix coraza | ||
| - | timeout hello 5s | + | timeout hello 2s |
| - | timeout idle 30s | + | timeout idle 10s |
| - | timeout processing | + | timeout processing |
| use-backend coraza-spoa-backend | use-backend coraza-spoa-backend | ||
| - | spoe-message | + | spoe-message |
| - | args app=str("sample_app") src_ip=src method=method path=path query=query version=req.ver | + | args app=str(sample_app) |
| event on-frontend-http-request | event on-frontend-http-request | ||
| + | [root@vpsv-haproxy1 ~]# | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | root@ubuntuserver: | ||
| + | bind: 0.0.0.0: | ||
| + | |||
| + | # SPOA process logs (daemon-level) | ||
| + | log_level: debug | ||
| + | log_file: /dev/stdout | ||
| + | log_format: console | ||
| + | |||
| + | default_application: | ||
| + | |||
| + | applications: | ||
| + | - name: sample_app | ||
| + | |||
| + | directives: | | ||
| + | ################################################################# | ||
| + | # Base + CRS | ||
| + | ################################################################# | ||
| + | Include @coraza.conf-recommended | ||
| + | Include @crs-setup.conf.example | ||
| + | | ||
| + | SecRule REQUEST_FILENAME " | ||
| + | | ||
| + | Include @owasp_crs/ | ||
| + | |||
| + | SecRuleEngine On | ||
| + | |||
| + | ################################################################# | ||
| + | # Audit logging (WAF events / transactions) | ||
| + | ################################################################# | ||
| + | # RelevantOnly = nur Treffer / relevante Transaktionen loggen | ||
| + | SecAuditEngine RelevantOnly | ||
| + | |||
| + | # Alle Parts für Troubleshooting (später ggf. reduzieren) | ||
| + | SecAuditLogParts ABCEFHIJZ | ||
| + | |||
| + | # JSON ist einfacher zum Auswerten | ||
| + | SecAuditLogFormat JSON | ||
| + | |||
| + | # Eine Datei (einfach fürs Testen) | ||
| + | SecAuditLog / | ||
| + | |||
| + | ################################################################# | ||
| + | # Debug logging (nur vorübergehend!) | ||
| + | ################################################################# | ||
| + | SecDebugLog / | ||
| + | SecDebugLogLevel 3 | ||
| + | |||
| + | ################################################################# | ||
| + | # Optional: mehr Sichtbarkeit beim Testen | ||
| + | ################################################################# | ||
| + | # Wenn du wirklich JEDE Anfrage im Auditlog sehen willst, statt | ||
| + | # RelevantOnly -> On setzen: | ||
| + | # SecAuditEngine On | ||
| + | |||
| + | # HAProxy sendet bei dir aktuell nur Request-Infos | ||
| + | response_check: | ||
| + | |||
| + | # Transaktionscache (ms) | ||
| + | transaction_ttl_ms: | ||
| + | |||
| + | # App-level logs (coraza-spoa intern) | ||
| + | log_level: debug | ||
| + | log_file: /dev/stdout | ||
| + | log_format: console | ||
| + | |||
| + | root@ubuntuserver: | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | backend coraza-spoa-backend | ||
| + | mode tcp | ||
| + | timeout connect 5s | ||
| + | timeout server | ||
| + | server coraza1 172.21.1.170: | ||
| + | | ||
| + | frontend outlook | ||
| + | bind 172.21.1.169: | ||
| + | mode http | ||
| + | log global | ||
| + | log-format " | ||
| + | filter spoe engine coraza config / | ||
| + | http-response set-header X-Coraza-Action %[var(txn.coraza.action)] if { var(txn.coraza.action) -m found } | ||
| + | default_backend outlook | ||
| </ | </ | ||