Files
sif/modules/recon/docker-registry-api-exposure.yaml
T
TigahandGitHub e2f59637ec feat(modules): add docker registry and harbor exposure modules (#218)
modules/recon/docker-registry-api-exposure.yaml flags a Docker registry reachable
anonymously through its /v2/ base, keyed on a 200 paired with the
Docker-Distribution-Api-Version: registry/2.0 response header (the header rides on a
401 too, so the 200 gate is what proves anonymous reach), then extracts the api
version.

modules/recon/harbor-api-exposure.yaml flags an exposed Harbor registry through its
unauthenticated /api/v2.0/systeminfo endpoint, keyed on the harbor_version and
auth_mode fields, then extracts the harbor version.

internal/modules/registry_exposure_test.go drives both modules through
ExecuteHTTPModule and asserts the leak alongside the near misses: docker registry on
a header-less 200 and on a 401 that still carries the header, harbor with one keying
field missing, a plain 200 and a 404.

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

35 lines
714 B
YAML

# Docker Registry API Exposure Detection Module
id: docker-registry-api-exposure
info:
name: Docker Registry API Exposure
author: sif
severity: high
description: Detects a Docker registry reachable anonymously through its v2 api base
tags: [docker, registry, container, api, exposure, recon]
type: http
http:
method: GET
paths:
- "{{BaseURL}}/v2/"
matchers:
- type: status
status:
- 200
- type: regex
part: header
regex:
- 'Docker-Distribution-Api-Version:\s*registry/2\.0'
extractors:
- type: regex
name: docker_registry_api_version
part: header
regex:
- 'Docker-Distribution-Api-Version:\s*(\S+)'
group: 1