Documentation
¶
Overview ¶
Package gcs provides a Google Cloud Storage bucket scan source.
GCSSource implements the source.Source interface, listing and downloading objects from a GCS bucket and emitting them as chunks for secret scanning.
Package gcs provides a Google Cloud Storage bucket scan source.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GCSSource ¶
type GCSSource struct {
// contains filtered or unexported fields
}
GCSSource scans objects in a Google Cloud Storage bucket for leaked secrets.
func New ¶
New creates a new GCSSource for the given bucket. Use functional options to configure prefix filtering, max file size, etc.
func (*GCSSource) Chunks ¶
Chunks lists objects in the GCS bucket and sends their contents over a channel. The channel is closed when all objects have been processed or the context is cancelled.
type Option ¶
type Option func(*GCSSource)
Option configures a GCSSource.
func WithBufferSize ¶
WithBufferSize sets the channel buffer size for the chunk channel.
func WithExcludePaths ¶
WithExcludePaths sets glob patterns for object names to exclude from scanning. Patterns are matched against each object's name (the object's path within the bucket), mirroring filesystem.WithExcludePaths semantics.
func WithMaxFileSize ¶
WithMaxFileSize sets the maximum object size to download and scan. Objects larger than this value are skipped. Values less than or equal to zero are ignored, preserving the default.
func WithPrefix ¶
WithPrefix limits the scan to objects matching the given key prefix.
func WithProject ¶
WithProject sets the GCP project ID for the storage client.