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

New Codemod: Sonar Flask Secure Cookie #969

Merged
merged 5 commits into from
Jan 17, 2025

Conversation

andrecsilva
Copy link
Contributor

Overview

  • Adds a Sonar version of the FlaskSecureCookie codemod

@andrecsilva andrecsilva force-pushed the ISS-2708/python-sonar-secure-cookie branch from 2f6cf76 to 2528368 Compare January 16, 2025 16:59
@andrecsilva andrecsilva marked this pull request as ready for review January 16, 2025 17:10
assert (
cls.codemod.requested_rules[-1] in sonar_results
assert any(
map(lambda x: x in sonar_results, cls.codemod.requested_rules)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

list comp style would be preferable here
any(x in sonar_results for x in cls.codemod.requested_rules)

change_description = "Flask response `set_cookie` call should be called with `secure=True`, `httponly=True`, and `samesite='Lax'`."

def leave_Call(self, original_node, updated_node):
# Try to match the func
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rm comment

@andrecsilva andrecsilva added this pull request to the merge queue Jan 17, 2025
Merged via the queue into main with commit 826e82b Jan 17, 2025
15 checks passed
@andrecsilva andrecsilva deleted the ISS-2708/python-sonar-secure-cookie branch January 17, 2025 10:43
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.

3 participants