id: prometheus-targets

info:
  name: Prometheus targets API endpoint
  author: geeknik
  severity: info
  description: The targets endpoint exposes services belonging to the infrastructure, including their roles and labels. In addition to showing the target machine addresses, the endpoint also exposes metadata labels that are added by the target provider. These labels are intended to contain non-sensitive values, like the name of the server or its description, but various cloud platforms may automatically expose sensitive data in these labels, oftentimes without the developer's knowledge.
  reference:
    - https://jfrog.com/blog/dont-let-prometheus-steal-your-fire/
  metadata:
    max-request: 1
  tags: prometheus,misconfig,vuln

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

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

      - type: word
        part: body
        words:
          - '"status": "success"'
          - '"data":'
          - '"labels":'
        condition: and

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