Commit Graph
24 Commits
Author SHA1 Message Date
Cody Rose 041f07e9df Move verify flag into detectableChunk (#4558)
Chunk.Verify is an odd field - it originally conveys whether a source is going to run with verification, but then, at a certain point in the scanning pipeline, is mutated such that it instead indicates whether the chunk should be scanned with verification - which is not solely dependent on the source's verify flag. This is unnecessarily difficult to understand and maintain. This commit separates those two pieces of information into two flags:

- Chunk.Verify has been renamed to Chunk.SourceVerify
- It is no longer mutated; instead "should this chunk's secrets be verified?" is now captured by a new field on detectableChunk
2026-02-27 10:05:52 -05:00
Nabeel Alam 75c18f2523 Added Additional Metrics and Job ID in the Docker Source (#4547)
* Added new metrics and a Job ID column in Docker source

* Fixed typo in new docker images enumerated metric

* removed job_id from histogram metric
2025-12-03 16:37:51 +05:00
Nabeel Alam d416a804d5 Added API Call Metrics to Docker Source (#4552)
* Added instrumented transport to docker source api calls to include API call metric emissions

* removed once used variable assignment and setting with transport directly
2025-12-03 16:37:38 +05:00
Kashif Khan 20dccb6395 Scan all images under a namespace for Docker remote registries (#4514)
* Scan all images under a namespace for Docker remote registries

* improvements

* Resolved charlie's comment

* added logs

* formatted error messages
2025-11-06 15:08:28 +05:00
Kashif KhanandShahzad Haider ec61ad98fd Updated Docker source with new test cases and README (#4481)
Co-authored-by: Shahzad Haider <76992801+shahzadhaider1@users.noreply.github.com>
2025-10-16 11:00:44 +05:00
Stephen Aghaulor eafb8c5f6a Add support for docker daemon as a source (#4306)
Now you can scan an image directly after building it with docker build by using the docker:// prefix. This is ideal for local development and CI/CD pipelines that want to ensure images do not contain leaked secrets before pushing to an image registry.

This resolves "Add support for scanning images from the Docker daemon" #4275.

This reverts commit 562dd7242b, which reverted the original version of this change that had some issues with its tests that we did not notice until after we merged it.
2025-07-15 14:21:41 -04:00
ahravandKashif Khan d0b1fbadfe [perf] - Optimize Chunk Size Handling for Improved I/O and Memory Efficiency (#3134)
* optimize chunking

* use file size for Docker

* refactor: update chunk size reference in Jenkins test case

- Changed the reference from sources.ChunkSize to sources.DefaultChunkSize for clarity and consistency in the TestJenkinsVariousSizes function.
- Reformatted struct field declarations for improved readability.

---------

Co-authored-by: Kashif Khan <70996046+kashifkhan0771@users.noreply.github.com>
2025-07-08 12:37:21 -07:00
Cody Rose 562dd7242b Revert "Added support for scanning images from the docker daemon (#4276)" (#4291)
This reverts commit d7450942da.
2025-07-03 14:38:04 -04:00
Stephen Aghaulor d7450942da Added support for scanning images from the docker daemon (#4276)
- Now you can scan an image directly after building it with `docker build` by using the `docker://` prefix.
  This is ideal for local development and CI/CD pipelines that want to ensure images do not contain leaked secrets before pushing to an image registry.
- Resolves #4275
2025-07-03 13:22:00 -04:00
Tanner Jones 053617c834 feat(docker): implement exclude paths functionality (#4057)
Description:
Add support for excluding paths in Docker source scanning:

Add ExcludePaths field to Docker protobuf
Implement path exclusion logic in docker.go
Add comprehensive test coverage for exact and wildcard path matching
Update engine to pass exclude paths configuration
Add CLI support for --exclude-paths flag
The implementation supports:

Exact path matching (e.g., /var/log/test)
Wildcard path matching (e.g., /var/log/test/*)
Multiple exclude paths
Tests ensure proper handling of:

Exact path exclusions
Wildcard exclusions
Edge cases and similar paths
References:
https://github.com/trufflesecurity/trufflehog/issues/2216?utm_source=chatgpt.com
2025-06-06 14:29:22 -04:00
Martin Locklear 4fd8aa8a5b Remove unnecessarily verbosity call when logging error (#4097)
Errors are always logged, and do not have a verbosity.  This call can be removed.

Relevant docs:

https://github.com/go-logr/logr/commit/f8fce6ada1c095494b8f84f8e367fc849c736794#diff-792a9b98675a458cdbd537bf51c36acec5d9f0bf8eea4ad2ba441cf54be5017dR58
2025-04-29 09:20:57 -04:00
Richard Gomez 23afcd77ee Log skipped files on debug level (#3383) 2024-10-07 20:39:06 -07:00
ahrav ddb7211ded [chore] - set custom transport for the Docker client (#3156)
* set custom transport for docker

* fix lint
2024-08-02 08:51:59 -07:00
ahrav fba1a8b410 [perf] - Leverage pgzip for Parallel decompression (#3149) 2024-08-02 04:11:10 -07:00
ahrav 048ec26c92 move concurrency (#3135) 2024-07-31 18:58:18 -07:00
James Telfer 0024b6ce77 feat: support docker image history scanning (#2882)
* feat: support docker image history scanning

* refactor: collapse error handling into return

Style suggestion from review feedback.

* fix: associate layers with history entries

Where possible, add the associated layer to the history entry record. This may help tracing any issues discovered.

This also changes the entry reference format to `image-metadata:history:%d:created-by` which _may_ be more self-explanatory.
2024-05-28 14:07:43 -07:00
Miccah dbcb888063 Update Source interface to use SourceID and JobID types (#1774)
The previous implementation used int64 for both, which can be mixed up
easily. Using distinct types adds a layer of type safety checked by the
compiler.
2023-09-14 11:28:24 -07:00
Miccah 72b6a9ec6b Add a SourceType constant to all source packages (#1768) 2023-09-12 17:23:25 -07:00
ahrav 2a9f34962d Add optional param to Chunks (#1747)
* Add interface for targeted chunking.

* use optional args.

* update Chunks method signature.

* update tests.

* fix test.

* update QueryCriteria type.
2023-09-07 09:03:37 -07:00
ahrav abb131e502 [chore] - update Docker source (#1708)
* Add concurrency and common chunker.

* lint.

* address comments.
2023-09-05 07:40:38 -07:00
ahrav 2b1b1b5ad0 Add jobID to chunk. (#1721) 2023-08-29 12:02:30 -07:00
joeleonjr fa9469cfc7 Docker scanning by digest (#1615)
* added functionality to scan docker images with digests instead of tags

* cleaned import statement

* added unit test for baseAndTag parsing + remote digest scan
2023-08-11 16:53:12 -05:00
Miccah f3152b6885 Implement SourceUnitUnmarshaller for all sources (#1416)
* Implement CommonSourceUnitUnmarshaller

* Add SourceUnitUnmarshaller to all sources using

All sources, with the exception of git, will use the CommonSourceUnit as
they only contain a single type of unit to scan.

* Fix method comments to adhere to Go's style guide
2023-06-23 11:15:51 -05:00
Dustin Decker e856a6890d 🎉 Add Docker image scanning 🎉 (#1412)
* Add Docker source

* Add metrics

* Add test

* Add debugging, address PR comments, fix path output

* review suggestions
2023-06-22 08:02:25 -07:00