id: prometheus-flags

info:
  name: Prometheus flags API endpoint
  author: geeknik
  severity: info
  description: The flags endpoint provides a full path to the configuration file. If the file is stored in the home directory, it may leak a username.
  reference:
    - https://jfrog.com/blog/dont-let-prometheus-steal-your-fire/
  metadata:
    max-request: 1
  tags: prometheus,leak,misconfig

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

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

      - type: word
        words:
          - '"data":'
          - '"config.file":'
        condition: and

      - type: word
        part: header
        words:
          - 'application/json'

    extractors:
      - type: regex
        name: web_admin_enabled
        regex:
          - '\"web\.enable\-admin\-api\"\: \"true\"'
# digest: 4a0a0047304502206bc36d4bf0d8b6f3922395bf894c4a5e55bfa452ffc46b6b31f56ff06fa5c4bf022100e118eed1ca68e744d434d51f58f0a8e74973b11a85d85d0d234a86f1cfe77fee:922c64590222798bb761d5b6d8e72950