mirror of
https://github.com/lunchcat/sif.git
synced 2026-07-28 22:40:54 -07:00
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).
35 lines
714 B
YAML
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
|