From 67e3603ba4d53cfa34c3aaa4061e004eb31f5782 Mon Sep 17 00:00:00 2001
From: Emma Sax
@@ -99,8 +99,6 @@ Application Options: --commit= Sha of commit to scan or "latest" to scan the last commit of the repository --commits= Comma separated list of a commits to scan --commits-file= Path to file of line separated list of commits to scan - --commit-from= Commit to start scan from - --commit-to= Commit to stop scan --commit-since= Scan commits more recent than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format. --commit-until= Scan commits older than a specific date. Ex: '2006-01-02' or '2006-01-02T15:04:05-0700' format. --depth= Number of commits to scan @@ -154,7 +152,7 @@ gitleaks --path=path/to/local/repo/main.go -v --no-git ``` #### Scan unstaged changes: -If you have unstaged changes are are currently at the root of the repo, you can run `gitleaks` with no `--path` or `--repo-url` specified which will run a scan on your uncommitted changes. Or if you want to specify a +If you have unstaged changes are are currently at the root of the repo, you can run `gitleaks` with no `--path` or `--repo-url` specified which will run a scan on your uncommitted changes. Or if you want to specify a path, you can run: ```bash gitleaks --path=path/to/local/repo -v --unstaged @@ -174,7 +172,7 @@ The rules are written in [TOML](https://github.com/toml-lang/toml) as defined in [[rules]] description = "a string describing one of many rule in this config" - regex = '''one-go-style-regex-for-this-rule''' + regex = '''one-go-style-regex-for-this-rule''' file = '''a-file-name-regex''' path = '''a-file-path-regex''' tags = ["tag","another tag"] @@ -223,11 +221,11 @@ We can also **combine** regular expressions AND entropy: Translating this rule to English, this rule states: "if we encounter a line of code that matches *regex* AND the line falls within the bounds of a [Shannon entropy](https://en.wikipedia.org/wiki/Entropy_(information_theory)) of 4.5 to 4.7, then the line must be a leak" #### Example 3 -Let's compare two lines of code: +Let's compare two lines of code: ``` aws_secret='ABCDEF+c2L7yXeGvUyrPgYsDnWRRC1AYEXAMPLE' ``` -and +and ``` aws_secret=os.getenv('AWS_SECRET_ACCESS_KEY') @@ -250,7 +248,7 @@ The proper Perl regex for AWS secret keys is `(?