id: puppetdb-detect

info:
  name: PuppetDB Detection
  author: c-sh0
  severity: info
  reference:
    - https://puppet.com/docs/puppetdb/7/api/meta/v1/version.html#pdbmetav1version
  metadata:
    max-request: 1
  tags: puppet,tech,exposure

http:
  - method: GET
    path:
      - "{{BaseURL}}/pdb/meta/v1/version"

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

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

      - type: regex
        part: body
        regex:
          - '"version"\s:\s"([0-9.]+)"'

    extractors:
      - type: regex
        group: 1
        regex:
          - '"version"\s:\s"([0-9.]+)"'
# digest: 4b0a00483046022100aa2a5ee0fe10cf6f55d415c3cf3d22ce885c2d4f8152378dad650a105c63ce8a022100c2be0173caef5e04d1f893d36bbe528e27371a0c091897a1d09d3796cebf457f:922c64590222798bb761d5b6d8e72950