id: prometheus-config

info:
  name: Prometheus Config API Endpoint Discovery
  author: geeknik
  severity: info
  description: A Prometheus config API endpoint was discovered. The config endpoint returns the loaded Prometheus configuration file along with the addresses of targets and alerting/discovery services alongside the credentials required to access them. Usually, Prometheus replaces the passwords in the credentials config configuration field with the placeholder <secret> (although this still leaks the username).
  reference:
    - https://jfrog.com/blog/dont-let-prometheus-steal-your-fire/
  metadata:
    max-request: 1
  tags: prometheus,config,misconfig,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/api/v1/status/config"

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200

      - type: word
        words:
          - '"status": "success":'
          - '"data":'
          - '"yaml":'
        condition: and

      - type: word
        part: header
        words:
          - 'application/json'
# digest: 4b0a00483046022100d34401b6628b1611c36e6f2c29db112e807ec87d92abd04b416eb1e43035b25b022100b71e83a5b18575f7ce87b9f92a5304e40e9f4081c2edff9135fe9beb1f970425:922c64590222798bb761d5b6d8e72950