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
    - https://api.slack.com/messaging/webhooks
  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: 490a0046304402207f7906686c06d0e302e2f15ef92ee153d7b13ee8fd0c44e518fd8d47ada1add402207569b066870468d123f685fb4e81d046d6ba53b968db2529e9ef86d1ff0effc6:922c64590222798bb761d5b6d8e72950