Skip to content

Commit

Permalink
PA-6959 obfuscate sensitive data from command (#58)
Browse files Browse the repository at this point in the history
* PA-6959 obfuscate sensitive data from command

* nit formatting
  • Loading branch information
SOOS-JAlvarez committed Dec 12, 2022
1 parent 5ca4509 commit 14cd718
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.16
1.0.17
13 changes: 12 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,17 @@ def __make_soos_start_analysis_request__(self, command: str) -> DASTStartAnalysi
log("projectName and scanMode are required", LogLevel.ERROR)
sys.exit(1)

# Obfuscate sensitive data
obfuscated_command = command
if self.auth_bearer_token is not None:
obfuscated_command = obfuscated_command.replace(self.auth_bearer_token, "********")
if self.auth_password is not None:
obfuscated_command = obfuscated_command.replace(self.auth_password, "********")
if self.auth_username is not None:
obfuscated_command = obfuscated_command.replace(self.auth_username, "********")
if self.oauth_token_url is not None:
obfuscated_command = obfuscated_command.replace

param_values: dict = dict(
projectName=self.project_name,
name=datetime.now().strftime("%m/%d/%Y, %H:%M:%S"),
Expand All @@ -447,7 +458,7 @@ def __make_soos_start_analysis_request__(self, command: str) -> DASTStartAnalysi
appVersion=self.app_version,
toolName=self.dast_analysis_tool,
toolVersion=self.dast_analysis_tool_version,
commandLine=command,
commandLine=obfuscated_command,
scanMode=self.scan_mode,
commitHash=self.commit_hash,
branch=self.branch_name,
Expand Down

0 comments on commit 14cd718

Please sign in to comment.