id: slack-webhook-url

info:
  name: Slack Webhook URL
  author: Ice3man,DhiyaneshDK
  severity: info
  reference:
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/slack-webhook-url.go
    - https://github.com/semgrep/semgrep-rules/blob/develop/generic/secrets/gitleaks/slack-webhook-url.yaml
  metadata:
    max-request: 1
  tags: exposure,token,slack

flow: http(1) && http(2)

http:
  - method: GET
    path:
      - "{{BaseURL}}"

    matchers:
      - type: regex
        part: body
        name: token
        regex:
          - 'https://hooks\\.slack\\.com/services/T[a-zA-Z0-9_]{8}/B[a-zA-Z0-9_]{8}/[a-zA-Z0-9_]{24}'
          - '(https?:\/\/)?hooks.slack.com\/(services|workflows)\/[A-Za-z0-9+\/]{43,46}'
# digest: 4b0a00483046022100a21290ad579e516df0255340482b063154b3a3db895719e3e6f51c1af9314ff2022100e20e6cd410648e57a91219a424cf359f29123cdc40e92081917da723ef64604d:922c64590222798bb761d5b6d8e72950