id: renovate-config-exposure

info:
  name: Renovate Configuration Exposure
  author: ritikchaddha
  severity: info
  description: |
    Detects exposed Renovate configuration files that may contain sensitive tokens or credentials.
  reference:
    - https://github.com/renovatebot/renovate
    - https://docs.renovatebot.com/configuration-options/
  metadata:
    verified: true
    max-request: 5
  tags: exposure,config,renovate

http:
  - method: GET
    path:
      - "{{BaseURL}}/renovate.json"
      - "{{BaseURL}}/renovate.json5"
      - "{{BaseURL}}/.github/renovate.json"
      - "{{BaseURL}}/.github/renovate.json5"
      - "{{BaseURL}}/.gitlab/renovate.json"
      - "{{BaseURL}}/.gitlab/renovate.json5"
      - "{{BaseURL}}/.renovaterc"
      - "{{BaseURL}}/.renovaterc.json"
      - "{{BaseURL}}/.renovaterc.json5"

    stop-at-first-match: true
    matchers-condition: and
    matchers:
      - type: word
        words:
          - 'extends":'
          - 'packageRules":'
          - 'hostRules":'
          - 'registryAliases":'
        condition: or

      - type: word
        part: header
        words:
          - "application/json"
          - "text/plain"

      - type: status
        status:
          - 200
# digest: 490a00463044022068c12b930a1535c0479bc356ab1fe7e4b6c112d822da218fad8774904c088fb202207dd7846e63b89da91758ee925c47f3a0bf7a3751fb82f3d1bb99ff3a865fbc84:922c64590222798bb761d5b6d8e72950