Skip to content

Chunking can split secrets, causing them to be undetected. #1651

@rgmz

Description

@rgmz

Thanks for the answer. The second problem is that out of 60 keys that are in regex101, gitleaks detects 50. Although the regex is the same: https://regex101.com/r/PmAzy3/1

docker run -v /yourpath:/path/ zricethezav/gitleaks:latest detect -c /path/original.toml -s/path/keys.txt --no-git -v -l trace

изображение

Originally posted by @almaz045 in #1631 (comment)

This looks like an issue with chunking. If I manually increase the chunk size, the number of secrets detected changes. FYI @zricethezav

chunkSize = 10 * 1_000 // 10kb

# 20kb
8:37AM INF scan completed in 80.9ms
8:37AM WRN leaks found: 55

# 50kb
8:38AM INF scan completed in 82.4ms
8:38AM WRN leaks found: 58

# 100kb
8:38AM INF scan completed in 80.7ms
8:38AM WRN leaks found: 59

Related

I believe #1435 seems partially related to this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions