Skip to content

Commit

Permalink
Split WireGuard rules (Private/Preshared Key)
Browse files Browse the repository at this point in the history
  • Loading branch information
gemesa committed Dec 15, 2023
1 parent 8a7b0cd commit 7e43b57
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
source: crates/noseyparker-cli/tests/rules/mod.rs
expression: stdout
---
115 rules and 3 rulesets: no issues detected
116 rules and 3 rulesets: no issues detected

Original file line number Diff line number Diff line change
Expand Up @@ -462,14 +462,18 @@ expression: stdout
},
{
"id": "np.wireguard.1",
"name": "WireGuard PrivateKey/PresharedKey"
"name": "WireGuard Private Key"
},
{
"id": "np.wireguard.2",
"name": "WireGuard Preshared Key"
}
],
"rulesets": [
{
"id": "default",
"name": "Nosey Parker default rules",
"num_rules": 95
"num_rules": 96
},
{
"id": "np.assets",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,12 @@ expression: stdout
np.twilio.1 Twilio API Key
np.twitter.1 Twitter Client ID
np.twitter.2 Twitter Secret Key
np.wireguard.1 WireGuard PrivateKey/PresharedKey
np.wireguard.1 WireGuard Private Key
np.wireguard.2 WireGuard Preshared Key

Ruleset ID Ruleset Name Rules
─────────────────────────────────────────────────────────
default Nosey Parker default rules 95
default Nosey Parker default rules 96
np.assets Nosey Parker asset detection rules 15
np.hashes Nosey Parker password hash rules 5

21 changes: 16 additions & 5 deletions crates/noseyparker/data/default/builtin/rules/wireguard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,30 @@

rules:

- name: WireGuard PrivateKey/PresharedKey
- name: WireGuard Private Key
id: np.wireguard.1

pattern: |
(?x)
PrivateKey|PresharedKey\s*=\s*
([A-Za-z0-9+/]{43}={1})
pattern: PrivateKey\s*=\s*([A-Za-z0-9+/]{43})

examples:
- |
[Interface]
Address = 10.200.200.3/32
PrivateKey = AsaFot43bfs1fEWjvtty+rGcjh3rP1H6sug1l3u19ix=
DNS = 8.8.8.8
references:
- https://www.wireguard.com/quickstart/
- https://manpages.debian.org/testing/wireguard-tools/wg.8.en.html
- https://gist.github.com/lanceliao/5d2977f417f34dda0e3d63ac7e217fd6

- name: WireGuard Preshared Key
id: np.wireguard.2

pattern: PresharedKey\s*=\s*([A-Za-z0-9+/]{43}=)

examples:
- |
[Peer]
PublicKey = [Server's public key]
PresharedKey = uRsfsZ2Ts1rach4Zv3hhwcx6wa5fuIo2u3w7sa+7j81=
Expand All @@ -25,4 +35,5 @@ rules:
references:
- https://www.wireguard.com/quickstart/
- https://manpages.debian.org/testing/wireguard-tools/wg.8.en.html
- https://gist.github.com/lanceliao/5d2977f417f34dda0e3d63ac7e217fd6
3 changes: 2 additions & 1 deletion crates/noseyparker/data/default/builtin/rulesets/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,5 @@ rulesets:
- np.telegram.1 # Telegram Bot Token
- np.twilio.1 # Twilio API Key
- np.twitter.2 # Twitter Secret Key
- np.wireguard.1 # WireGuard PrivateKey/PresharedKey
- np.wireguard.1 # WireGuard Private Key
- np.wireguard.2 # WireGuard Preshared Key

0 comments on commit 7e43b57

Please sign in to comment.