You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
circleCiScanToken=circleCiScan.Flag("token", "CircleCI token. Can also be provided with environment variable").Envar("CIRCLECI_TOKEN").Required().String()
dockerScanImages=dockerScan.Flag("image", "Docker image to scan. Use the file:// prefix to point to a local tarball, the docker:// prefix to point to the docker daemon, otherwise an image registry is assumed.").Required().Strings()
198
-
dockerScanToken=dockerScan.Flag("token", "Docker bearer token. Can also be provided with environment variable").Envar("DOCKER_TOKEN").String()
199
-
dockerExcludePaths=dockerScan.Flag("exclude-paths", "Comma separated list of paths to exclude from scan").String()
dockerScanImages=dockerScan.Flag("image", "Docker image to scan. Use the file:// prefix to point to a local tarball, the docker:// prefix to point to the docker daemon, otherwise an image registry is assumed.").Strings()
198
+
dockerScanToken=dockerScan.Flag("token", "Docker bearer token. Can also be provided with environment variable").Envar("DOCKER_TOKEN").String()
199
+
dockerExcludePaths=dockerScan.Flag("exclude-paths", "Comma separated list of paths to exclude from scan").String()
200
+
dockerScanNamespace=dockerScan.Flag("namespace", "Docker namespace (organization or user). For non-Docker Hub registries, include the registry address as well (e.g., ghcr.io/namespace or quay.io/namespace).").String()
201
+
dockerScanRegistryToken=dockerScan.Flag("registry-token", "Optional Docker registry access token. Provide this if you want to include private images within the specified namespace.").String()
travisCiScanToken=travisCiScan.Flag("token", "TravisCI token. Can also be provided with environment variable").Envar("TRAVISCI_TOKEN").Required().String()
Copy file name to clipboardExpand all lines: pkg/sources/docker/README.md
+59-12Lines changed: 59 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,14 +32,15 @@ Docker is a containerization platform that packages applications and their depen
32
32
-**Authentication Support**: Multiple authentication methods for private registries
33
33
-**File Exclusion**: Configure patterns to skip specific files or directories
34
34
-**Size Limits**: Automatically skips files exceeding 50MB to optimize performance
35
+
-**Scan All Images Under a Namespace**: Enables automatic discovery and scanning of all container images under a specified namespace (organization or user) in supported registries such as Docker Hub, Quay, and GHCR. Users no longer need to manually list or specify individual image names. The system retrieves all public images within the namespace, and if a valid registry token is provided includes private images as well. This allows for large-scale, automated scanning across all repositories within an organization.
35
36
36
37
## Configuration
37
38
38
39
### Connection Types
39
40
40
41
The Docker source supports several image reference formats:
41
42
42
-
```go
43
+
```text
43
44
// Remote registry (default)
44
45
"nginx:latest"
45
46
"myregistry.com/myapp:v1.0.0"
@@ -51,6 +52,7 @@ The Docker source supports several image reference formats:
51
52
// Tarball file
52
53
"file:///path/to/image.tar"
53
54
```
55
+
54
56
### Authentication Methods
55
57
56
58
#### 1. Unauthenticated (Public Images)
@@ -159,6 +161,47 @@ docker login quay.io
159
161
cat ~/.docker/config.json
160
162
```
161
163
164
+
---
165
+
166
+
### Namespace Scanning (This feature is currently in beta version and under testing)
167
+
168
+
To scan **all images** under a namespace (organization or user):
169
+
170
+
**CLI Usage:**
171
+
```bash
172
+
# If no registry prefix is provided, Docker Hub is used by default
173
+
trufflehog docker --namespace myorg
174
+
175
+
# For other registries, include the registry prefix (e.g., quay.io, ghcr.io)
This mode automatically enumerates all repositories within the specified namespace before scanning.
200
+
201
+
Note: According to the GHCR documentation, only GitHub Classic Personal Access Tokens (PATs) are currently supported for accessing container packages - including public ones.
| Scan remote image on DockerHub | ✅ Success | `--image <image_name>` | https://hub.docker.com/ | Public images work without authentication |
239
289
| Scan specific tag of image on DockerHub | ✅ Success | `--image <image_name>:<tag_name>` | https://hub.docker.com/ | Tag specification working correctly |
290
+
| Scan all images under namespace | In Progress | `--namespace <namespace>` | DockerHub, Quay, GHCR | Automatically discovers all public images |
240
291
| Scan remote image on Quay.io | ✅ Success | `--image quay.io/prometheus/prometheus` | https://quay.io/search | Public Quay.io registry supported |
| Scan remote image on DockerHub with token | ✅ Success | Generate token using username and password |https://hub.docker.com/|Basic auth with PAT working|
293
+
| Scan remote image on DockerHub with token | ✅ Success | `--token <token>`(Generate token using username and password) | https://hub.docker.com/ | Authenticated scanning for private repos |
0 commit comments