Files
sif/modules/recon/harbor-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

40 lines
734 B
YAML

# Harbor API Exposure Detection Module
id: harbor-api-exposure
info:
name: Harbor API Exposure
author: sif
severity: medium
description: Detects an exposed Harbor registry through its unauthenticated systeminfo endpoint
tags: [harbor, registry, container, api, exposure, recon]
type: http
http:
method: GET
paths:
- "{{BaseURL}}/api/v2.0/systeminfo"
matchers:
- type: status
status:
- 200
- type: word
part: body
words:
- "\"harbor_version\""
- type: word
part: body
words:
- "\"auth_mode\""
extractors:
- type: regex
name: harbor_version
part: body
regex:
- '"harbor_version"\s*:\s*"([^"]+)"'
group: 1