Skip to content

Commit

Permalink
Merge pull request #4 from raulcabello/bug
Browse files Browse the repository at this point in the history
bug: iterate over the matches to see if any match was found
  • Loading branch information
raulcabello authored Oct 21, 2022
2 parents 2057a49 + b671468 commit 90341eb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "env-variable-secrets-scanner-policy"
version = "0.1.1"
version = "0.1.2"
authors = ["raulcabello <[email protected]>"]
edition = "2018"

Expand All @@ -17,4 +17,4 @@ serde_json = "1.0"
encoding = "0.2.33"
base64 = "0.13.0"
#TODO replace once rusty-hog-scanner is available upstream
rusty_hog_scanner = { git = "https://github.com/raulcabello/rusty-hog/", revision="fcc529f901ea043825d88a6caf66a35159844764" }
rusty_hog_scanner = { git = "https://github.com/raulcabello/rusty-hog/", revision="981052cc194b25b881acc089e806799d58d97637" }
14 changes: 8 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,14 @@ fn scan_text(

for (_, new_line) in lines.enumerate() {
let results = secret_scanner.matches(new_line);
for (reason, _) in results {
findings.insert(EnvVarFinding {
reason: reason.to_string(),
key: key.to_string(),
container: container.to_string(),
});
for (reason, matches) in results {
for _ in matches {
findings.insert(EnvVarFinding {
reason: reason.to_string(),
key: key.to_string(),
container: container.to_string(),
});
}
}
}

Expand Down

0 comments on commit 90341eb

Please sign in to comment.