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

[Feature Request] for rancher2_logs_collector.sh script to accept seed value for obfuscation purposes #304

Open
jahudson1 opened this issue Aug 28, 2024 · 0 comments

Comments

@jahudson1
Copy link

jahudson1 commented Aug 28, 2024

My recommendation is to add an option to rancher2_logs_collector.sh to allow a user of this script to pass an alphanumeric string to be used as a random seed for the pseudorandom number generator that is used to map sensitive values to obfuscated values. This would be an alternative to a user transferring the hostname_mapping.json and ip_mapping.json files to other nodes via scp to attempt to keep the mappings in sync.

This seed value should not be shared, logged or written down as it should be able to recreate the same XYZ_mapping.json files given the same inputs.

Example of how it could be ran. Any option letter could be used but currently -O appears to be available.

node1> sudo ./rancher2_logs_collector.sh -o -O '8helico33banan1'
node2> sudo ./rancher2_logs_collector.sh -o -O '8helico33banan1'

If it's desirable to keep the seed out of the bash shell history then a special value like -O? could signal that the script needs to interactively ask for the seed as opposed to accepting it from the command line arguments.

node1> sudo ./rancher2_logs_collector.sh -o -O?
What is your seed value? 8helico33banan1
node2> sudo ./rancher2_logs_collector.sh -o -O?
What is your seed value? 8helico33banan1

The petname python library being used currently assigns random to be a copy of the random modules' SystemRandom class but instead you could use random.Random(seed) and pass it a seed value from the parent shell script from the user.

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

No branches or pull requests

1 participant