[WAF] pass rule is considered as reason for alert

オープン
#4,497 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
静か
技術スタック
go
領域
security

調査の方向性

Start by locating where WAF-matched SecRules are collected into alert reasons and read the related tests. Reproduce the case with the provided pass and deny rules; done means the alert includes only the rule with a disruptive action. The issue does not name files or tests, so first identify the relevant entry point in the repository.

索引モデルが issue の本文から書いたものです。

説明

kind/bug needs/triage os/linux
What happened?

If you have one request matching multiple SecRules, even pass rules will be included in the alert which could be misleading.

What did you expect to happen?

Only include matched SecRules with a disruptive action.

How can we reproduce it (as minimally and precisely as possible)?

Create two rules that will match a specific request, one should be pass and the other deny.

cscli alerts inspect 1015286

################################################################################################

 - ID           : 1015286
 - Date         : 2026-06-02T12:22:06+02:00
 - Machine      : <redacted>
 - Simulation   : false
 - Remediation  : false
 - Kind         : waf
 - Reason       : request_uri: wordpress redirect
 - Events Count : 2
 - Scope:Value  : Ip:<redacted>
 - Country      : SE
 - Begin        : 2026-06-02T12:22:05+02:00
 - End          : 2026-06-02T12:22:05+02:00
 - UUID         : 15c866d7-69ba-4c98-815a-80b38dca473d


 - Context  :
╭───────────────┬──────────────────────────────────────────────────────────────╮
│      Key      │                             Value                            │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ host          │ www.bashult.sk                                          │
│ id            │ 400402                                                       │
│ id            │ 410045                                                       │
│ matched_zones │ REQUEST_URI                                                  │
│ matched_zones │ QUERY_STRING                                                 │
│ method        │ GET                                                          │
│ msg           │ request_uri: wordpress redirect                              │
│ msg           │ query_string: shell command bash                             │
│ name          │ native_rule:400402                                           │
│ name          │ native_rule:410045                                           │
│ uri           │ /wp-login.php?redirect_to=https%3A%2F%2Fwww.bashult.sk%      │
│               │ 2Fwp-admin%2F&reauth=1                                       │
╰───────────────┴──────────────────────────────────────────────────────────────╯
Rules matched:
SecRule REQUEST_URI                         "@rx wp-login\.php\?redirect_to="               "id:400402,phase:2,t:none,t:lowercase,t:urldecode,pass,skipAfter:IGNORE_HTTP_STRING,nolog,msg:'request_uri: wordpress redirect'"
SecRule QUERY_STRING                        "@rx bash "                                             "id:410045,phase:2,t:none,t:urldecode,deny,log,msg:'query_string: shell command bash'"
Anything else we need to know?

No response

Crowdsec version
$ cscli version
version: v1.7.8-debian-pragmatic-amd64-63227459
Codename: alphaga
BuildDate: 2026-05-11_12:36:14
GoVersion: 1.26.2
Platform: linux
libre2: C++
User-Agent: crowdsec/v1.7.8-debian-pragmatic-amd64-63227459-linux
Constraint_parser: >= 1.0, <= 3.0
Constraint_scenario: >= 1.0, <= 3.0
Constraint_api: v1
Constraint_acquis: >= 1.0, < 2.0
Built-in optional components: cscli_setup, datasource_appsec, datasource_cloudwatch, datasource_docker, datasource_file, datasource_http, datasource_journalctl, datasource_k8s-audit, datasource_kafka, datasource_kinesis, datasource_loki, datasource_s3, datasource_syslog, datasource_victorialogs, datasource_wineventlog, db_mysql, db_postgres, db_sqlite
OS version
# On Linux:
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
$ uname -a
Linux <hostname> 5.15.0-143-generic #153-Ubuntu SMP Fri Jun 13 19:10:45 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

</details>


### Enabled collections and parsers

<details>

```console
$ cscli hub list -o raw
Loaded: 163 parsers, 12 postoverflows, 781 scenarios, 10 contexts, 6 appsec-configs, 218 appsec-rules, 163 collections
Unmanaged items: 4 local, 0 tainted
name,status,version,description,type
crowdsecurity/whitelists,enabled,0.3,Whitelist events from private ipv4 addresses,parsers
appsec-waf.yaml,"enabled,local",,,contexts
appsec-waf,"enabled,local",,,appsec-configs
coraza/base-config,"enabled,local",,,appsec-rules
custom/secrules,"enabled,local",,,appsec-rules
Acquisition config
# On Linux:
$ cat /etc/crowdsec/acquis.yaml /etc/crowdsec/acquis.d/*
listen_addr: 127.0.0.1:7422
appsec_config: appsec-waf
name: appsec-waf
source: appsec
log_level: info
routines: 64
labels:
  type: appsec-waf
主要言語
Go
スター
15.1k
フォーク
726
平均マージ
2日 51分
マージ済み PR(30日)
18

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

crowdsecurity/crowdsec のほかの issue

crowdsecurity/crowdsec の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。