-
Notifications
You must be signed in to change notification settings - Fork 10
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
Hardening suggestions for codemodder-python / secure-sonar #390
Conversation
random.sample(["a", "b"], 1) # Sensitive | ||
random.choice(["a", "b"]) # Sensitive | ||
random.choices(["a", "b"]) # Sensitive | ||
secrets.SystemRandom().getrandbits(1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace random.{func} with more secure secrets library functions.
random.choice(["a", "b"]) # Sensitive | ||
random.choices(["a", "b"]) # Sensitive | ||
secrets.SystemRandom().getrandbits(1) | ||
secrets.SystemRandom().randint(0, 9) # Sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace random.{func} with more secure secrets library functions.
random.choices(["a", "b"]) # Sensitive | ||
secrets.SystemRandom().getrandbits(1) | ||
secrets.SystemRandom().randint(0, 9) # Sensitive | ||
secrets.SystemRandom().random() # Sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace random.{func} with more secure secrets library functions.
secrets.SystemRandom().getrandbits(1) | ||
secrets.SystemRandom().randint(0, 9) # Sensitive | ||
secrets.SystemRandom().random() # Sensitive | ||
secrets.SystemRandom().sample(["a", "b"], 1) # Sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace random.{func} with more secure secrets library functions.
secrets.SystemRandom().randint(0, 9) # Sensitive | ||
secrets.SystemRandom().random() # Sensitive | ||
secrets.SystemRandom().sample(["a", "b"], 1) # Sensitive | ||
secrets.SystemRandom().choice(["a", "b"]) # Sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace random.{func} with more secure secrets library functions.
secrets.SystemRandom().random() # Sensitive | ||
secrets.SystemRandom().sample(["a", "b"], 1) # Sensitive | ||
secrets.SystemRandom().choice(["a", "b"]) # Sensitive | ||
secrets.SystemRandom().choices(["a", "b"]) # Sensitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace random.{func} with more secure secrets library functions.
Quality Gate failedFailed conditions |
I've reviewed the recently opened PR (389 - test to see what sonar indx is) and have identified some area(s) that could benefit from additional hardening measures.
These changes should help prevent potential security vulnerabilities and improve overall code quality.
Thank you for your consideration!
docs | feedback
Powered by: pixeebot