Skip to content
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

[foreman] Obfuscate http_proxy passwords #3878

Conversation

pmoravec
Copy link
Contributor

production.log can (unintentionally) contain http_proxy URL including credentials. Since the URL can appear on one logline twice, obfuscating the 2nd instance is more tricky than usual.

Also, obfuscate the same password in settings table.

Related: SAT-30137
Closes: #3878


Please place an 'X' inside each '[]' to confirm you adhere to our Contributor Guidelines

  • Is the commit message split over multiple lines and hard-wrapped at 72 characters?
  • Is the subject and message clear and concise?
  • Does the subject start with [plugin_name] if submitting a plugin patch or a [section_name] if part of the core sosreport code?
  • Does the commit contain a Signed-off-by: First Lastname [email protected]?
  • Are any related Issues or existing PRs properly referenced via a Closes (Issue) or Resolved (PR) line?
  • Are all passwords or private data gathered by this PR obfuscated?

production.log can (unintentionally) contain http_proxy URL including
credentials. Since the URL can appear on one logline twice, obfuscating
the 2nd instance is more tricky than usual.

Also, obfuscate the same password in settings table.

Related: SAT-30137
Closes: sosreport#3878

Signed-off-by: Pavel Moravec <[email protected]>
Copy link

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/sosreport-sos-3878
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@arif-ali arif-ali added the Reviewed/Ready for Merge Has been reviewed, ready for merge label Dec 12, 2024
@pmoravec
Copy link
Contributor Author

I dont like the "apply similar-but-not-identical regexp twice" when we are trying to replace one or two instances of the same pattern on a line. But:

  1. the replacement is applied just once (really we cant apply multiple times on one line..?) to the first instance
  2. if I call do_paths_http_sub twice in a row in attempt to replace the 2nd password, the RE matches the obfuscated ******:****** :(

If you come up with some more elegant solution, I will appreciate.

@TurboTurtle TurboTurtle merged commit 1b85b16 into sosreport:main Dec 13, 2024
33 checks passed
pafernanr added a commit to pafernanr/sos that referenced this pull request Dec 13, 2024
Regular expression improvement for
sosreport#3878

Related: SAT-30137
Closes: sosreport#3878

Signed-off-by: Pablo Fernández Rodríguez <[email protected]>
pafernanr added a commit to pafernanr/sos that referenced this pull request Dec 13, 2024
Improve `do_paths_http_sub` function to replace multiple BASIC_AUTH occurrences
on URLs

Related: SAT-30137
Closes: sosreport#3878

Signed-off-by: Pablo Fernández Rodríguez <[email protected]>
arif-ali pushed a commit that referenced this pull request Dec 13, 2024
Improve `do_paths_http_sub` function to replace multiple BASIC_AUTH occurrences
on URLs

Related: SAT-30137
Closes: #3878

Signed-off-by: Pablo Fernández Rodríguez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Reviewed/Ready for Merge Has been reviewed, ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants