Skip to content

Commit c873e1c

Browse files
committed
Removed ghp false positive
1 parent 9cd79a7 commit c873e1c

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/scans/tools/secret_tool.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,22 @@ impl SecretTool {
9090
if json_output["SourceMetadata"]["Data"]["Filesystem"]["file"]
9191
.as_str()
9292
.unwrap()
93-
.contains(".git/config")
93+
.contains(".git/")
9494
{
95-
println!("[+] Skipping .git/config file...");
95+
println!("[+] Skipping .git/ file...");
9696
continue;
9797
}
98-
// if "Raw" is in json_output and not null then check if it contains environment variables
98+
// Check if "Raw" is in json_output and not null
9999
if json_output["Raw"].is_string() && !json_output["Raw"].is_null() {
100-
if count_env_variables(&json_output["Raw"].as_str().unwrap()) > 0 {
100+
// Clone the string to create an owned String, extending its lifetime
101+
let raw_value = json_output["Raw"].as_str().unwrap().to_string();
102+
103+
// Check if it contains environment variables
104+
if count_env_variables(&raw_value) > 0 {
101105
continue;
102106
}
103107
}
104-
results.push(json_output);
108+
results.push(json_output.clone());
105109
}
106110
// ## iterate into each results and implement checks for specific DetectorName
107111
let mut new_results: Vec<Value> = Vec::new();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy