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

Hardening suggestions for codemodder-python / secure-sonar #390

Closed
wants to merge 1 commit into from

Conversation

pixeebot[bot]
Copy link
Contributor

@pixeebot pixeebot bot commented Mar 18, 2024

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

@pixeebot pixeebot bot requested a review from clavedeluna March 18, 2024 16:23
@pixeebot pixeebot bot requested a review from clavedeluna as a code owner March 18, 2024 16:23
random.sample(["a", "b"], 1) # Sensitive
random.choice(["a", "b"]) # Sensitive
random.choices(["a", "b"]) # Sensitive
secrets.SystemRandom().getrandbits(1)
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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
Copy link
Contributor Author

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.

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
5 Security Hotspots

See analysis details on SonarCloud

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

Successfully merging this pull request may close these issues.

1 participant