Skip to content

feat(SP-2487): Implement path obfuscation #29

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 26, 2025

Conversation

isasmendiagus
Copy link
Contributor

WHAT

  • Adds path obfuscation on CLI and Library

See image:
image

@isasmendiagus isasmendiagus requested review from agustingroh and eeisegn and removed request for agustingroh May 22, 2025 14:22
@@ -165,7 +168,7 @@ public void run() {
.hiddenFilesFolders(allHidden).numThreads(numThreads).url(apiUrl).apiKey(apiKey)
.retryLimit(retryLimit).timeout(Duration.ofSeconds(timeoutLimit)).scanFlags(scanFlags)
.sbomType(sbomType).sbom(sbom).snippetLimit(snippetLimit).customCert(caCertPem).proxy(proxy).hpsm(enableHpsm)
.settings(settings)
.settings(settings).obfuscate(obfuscate)
Copy link
Contributor

@agustingroh agustingroh May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add the new attribute in a new line?
i.e
.settings(settings)
.obfuscate(obfuscate)

}
return "";

String result = scanApi.scan(wfp, "", 1);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a constant here?
Suggested:
private final static int ID
private final static int SCANNER_ID

/**
* Resolves the real file path for a given obfuscated path.
* This method is thread-safe and can be called concurrently from multiple threads.
* If the provided path is not found in the obfuscation map, the original path is returned.
Copy link
Contributor

@agustingroh agustingroh May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this comment right?
should be "If the original path is not found in the obfuscation map, the obfuscated path is returned." ?

@agustingroh
Copy link
Contributor

This is a result of path obfuscation:
telegram-cloud-photo-size-1-5008035445023550927-y

All looks good

@isasmendiagus isasmendiagus merged commit 0da24ab into main May 26, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants