Files
sif/modules/recon/docker-config-exposure.yaml
T
TigahandGitHub 45f5302e1f feat(modules): add aws, npmrc and docker credential file exposure modules (#195)
modules/recon/aws-credentials-exposure.yaml flags exposed .aws/credentials,
.s3cfg and .boto files on the access and secret key markers, and extracts
the AKIA/ASIA access key id.

modules/recon/npmrc-exposure.yaml flags a .npmrc only when it carries an
auth token or password, not a bare registry config, and extracts the
registry the token belongs to.

modules/recon/docker-config-exposure.yaml flags .docker/config.json and the
legacy .dockercfg on the base64 auth field, and extracts the registry host.

each module ands a negative matcher on the usual html markers so a 200 page
that merely names a key is not a hit, the same guard the env exposure module
uses.

internal/modules/credential_exposure_test.go drives the three modules end to
end through ExecuteHTTPModule and asserts the leak alongside the near misses
a strict review wants pinned: an html doc that only names a key, a plain 200
body, a 404, and a jwt shaped docker auth value, none of which may match.

verify: go test ./internal/modules, each matcher, guard and extractor proven
to bite (break -> red, restore -> green).
2026-06-22 17:24:06 -07:00

48 lines
947 B
YAML

# Docker Config Credential Exposure Detection Module
id: docker-config-exposure
info:
name: Docker Config Credential Exposure
author: sif
severity: high
description: Detects exposed docker config files that leak base64 encoded registry credentials
tags: [docker, registry, credentials, secrets, exposure, recon]
type: http
http:
method: GET
paths:
- "{{BaseURL}}/.docker/config.json"
- "{{BaseURL}}/.dockercfg"
matchers:
- type: status
status:
- 200
- type: regex
part: body
regex:
- '"auth"\s*:\s*"[A-Za-z0-9+/=]{20,}"'
- type: word
part: body
negative: true
condition: or
words:
- "<!DOCTYPE"
- "<!doctype"
- "<html"
- "<HTML"
- "<head>"
- "<title>"
extractors:
- type: regex
name: docker_registry
part: body
regex:
- '"auths"\s*:\s*\{\s*"([^"]+)"'
group: 1