Skip to content

Commit

Permalink
Merge pull request #434 from DataDog/s.obregoso/improve_shady_links
Browse files Browse the repository at this point in the history
Adding new link domains to shady-links
  • Loading branch information
sobregosodd authored Aug 5, 2024
2 parents 8e1f717 + 6b7d25e commit a08610a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
16 changes: 10 additions & 6 deletions guarddog/analyzer/sourcecode/shady-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,26 @@ rules:
- pattern-not-regex: ^\s*"""(.|\n)*?"""\s*$

# Exclude local IPv4 sometimes used in tests
- pattern-not-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?(?:192\.168|10\.\d{1,3}|172\.(?:1[6-9]|2\d|3[0-1])|127\.\d{1,3})\.\d{1,3}\.\d{1,3}|0\.0\.0\.0|localhost)
- pattern-not-regex: (https?:\/\/[^\n\[\/\?#"']*?(?:192\.168|10\.\d{1,3}|172\.(?:1[6-9]|2\d|3[0-1])|127\.\d{1,3})\.\d{1,3}\.\d{1,3}|0\.0\.0\.0|localhost)

# Exclude public IPv4 sometimes used in tests
- pattern-not-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?(?:1\.1\.1\.1|8\.8\.8\.8))
- pattern-not-regex: (https?:\/\/[^\n\[\/\?#"']*?(?:1\.1\.1\.1|8\.8\.8\.8))

# ignore discord allowed
- pattern-not-regex: https?:\/\/discord.com\/(invite|oauth2\/authorize)

- patterns:
- pattern: ("...")
- pattern-either:
# complete domains
- pattern-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?(bit\.ly|discord\.com|workers\.dev|transfer\.sh|filetransfer\.io|sendspace\.com|appdomain\.cloud|backblazeb2\.com\|paste\.ee|ngrok\.io|termbin\.com|localhost\.run|webhook\.site|oastify\.com|burpcollaborator\.me)\/)
- pattern-regex: (https?:\/\/[^\n\[\/\?#"']*?(bit\.ly|discord\.com|workers\.dev|transfer\.sh|filetransfer\.io|sendspace\.com|appdomain\.cloud|backblazeb2\.com\|paste\.ee|ngrok\.io|termbin\.com|localhost\.run|webhook\.site|oastify\.com|burpcollaborator\.me)\/)
- pattern-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?(oast\.(pro|live|site|online|fun|me)|api\.telegram\.org|rentry\.co)\/)
# top-level domains
- pattern-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?\.(link|xyz|tk|ml|ga|cf|gq|pw|top|club|mw|bd|ke|am|sbs|date|quest|cd|bid|cd|ws|icu|cam|uno|email|stream)\/)
- pattern-regex: (https?:\/\/[^\n\[\/\?#"']*?\.(link|xyz|tk|ml|ga|cf|gq|pw|top|club|mw|bd|ke|am|sbs|date|quest|cd|bid|cd|ws|icu|cam|uno|email|stream)\/)
# IPv4
- pattern-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))
- pattern-regex: (https?:\/\/[^\n\[\/\?#"']*?(?:\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}))
# IPv6
- pattern-regex: (http[s]?:\/\/[^\n\[\/\?#"']*?(?:\[(([A-Fa-f0-9]{1,4}:){0,7}|:):?[A-Fa-f0-9]{1,4}(:[A-Fa-f0-9]{1,4}){0,7})\])
- pattern-regex: (https?:\/\/[^\n\[\/\?#"']*?(?:\[(([A-Fa-f0-9]{1,4}:){0,7}|:):?[A-Fa-f0-9]{1,4}(:[A-Fa-f0-9]{1,4}){0,7})\])
paths:
exclude:
- "*/test/*"
Expand Down
4 changes: 4 additions & 0 deletions tests/analyzer/sourcecode/shady-links.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,3 +169,7 @@ def f():
# ruleid: shady-links
trackingServiceUrl = 'https://b.alt-h7-eoj8gqk1.workers.dev/track'

def f():
# ok: shady-links
trackingServiceUrl = 'https//discord.com/invite/u9zUjWbbQ'

0 comments on commit a08610a

Please sign in to comment.