sosreport / sos

A unified tool for collecting system logs and other debug information
http://sos.rtfd.org
GNU General Public License v2.0
508 stars 544 forks source link

[plugins] Obfuscate proxy credentials in env. settings #3789

Closed pmoravec closed 6 days ago

pmoravec commented 1 week ago

Obfuscate credentials in env.variable settings for e.g. HTTP_PROXY or similar.

Inspired by: #3788 Resolves: #3789


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

pmoravec commented 1 week ago

Trivial reproducer:

echo HTTP_PROXY=http://foouser:barpassword@proxyurl:8080 >> /etc/environment
sos report -o system --batch --build

I am not sure if whole /etc/sysconfig or /etc/default needs such scrubbing - various services can define the proxy there so it is imho better to cover all. BUT if either directory is password-less every time, I am happy to remove it from the postproc.

packit-as-a-service[bot] commented 1 week ago

Congratulations! One of the builds has completed. :champagne:

You can install the built RPMs by following these steps:

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

pmoravec commented 6 days ago

OK, the /etc/sysconfig or /etc/default could also collect the env.variables, worth processing them as well.

jcastill commented 6 days ago

The pylint failure is solved already but checking out this pr doesn't show the commit, so I think you'll have to resync.

pmoravec commented 6 days ago

Good point wrt Apt plugin where I in fact copied the RE from - I just updated the PR accordingly.