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

Fix code scanning alert no. 1: Flask app is run in debug mode #29

Merged
merged 1 commit into from
Dec 3, 2024

Conversation

PANDATD
Copy link
Owner

@PANDATD PANDATD commented Dec 3, 2024

Fixes https://github.com/PANDATD/crime-reporting-system/security/code-scanning/1

To fix the problem, we need to ensure that the Flask application does not run in debug mode in a production environment. The best way to achieve this is by using an environment variable to control the debug mode. This way, we can set the debug mode to True during development and False during production.

  1. Import the os module to access environment variables.
  2. Use an environment variable to determine the debug mode.
  3. Update the app.run call to use this environment variable.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Signed-off-by: MR. TEJAS DIXIT <[email protected]>
@PANDATD PANDATD marked this pull request as ready for review December 3, 2024 10:45
@PANDATD PANDATD merged commit 9d4bec9 into main Dec 3, 2024
1 of 2 checks passed
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