-
Notifications
You must be signed in to change notification settings - Fork 29
Main controller in docker #44
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
Conversation
-cflupdatehandler.py -dflupdatehandler.py -actions.py -communications.py -forwarder.py -messages.py -propagator.py -externalconnectionservice.py -nebuladiscoveryservice.py
-situationalawareness.py -sareasoner.py -sanetwork.py -neighborpolicy.py -sacommand.py -federationconnector.py
-addonmanager.py -eventmanager.py -nebulaevents.py -aggregator.py
-engine.py -connection.py -staticarbitatrionpolicy.py -distcandidateselector.py -fccandidateselector.py -ringcandidateselector.py -stdcandidateselector.py -defaultmodelhandler stdmodelhandler.py
- all neighborpolicies
return JSONResponse({"message": "Login successful"}, status_code=200) | ||
except Exception as e: | ||
logging.exception(f"Login error for user {user}: {str(e)}") | ||
return JSONResponse({"message": "Login failed", "error": str(e)}, status_code=401) |
Check warning
Code scanning / CodeQL
Information exposure through an exception Medium
Stack trace information
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 2 months ago
To fix the issue, the application should return a generic error message to the user instead of including the exception details in the response. The exception details should be logged using logging.exception
for debugging purposes. This ensures that sensitive information is not exposed to external users while still allowing developers to diagnose issues.
The changes will be made in the nebula_login
function:
- Replace the
error
field in the JSON response with a generic message, such as"An internal error occurred"
. - Ensure that the exception details are logged using
logging.exception
.
-
Copy modified line R1144
@@ -1143,3 +1143,3 @@ | ||
logging.exception(f"Login error for user {user}: {str(e)}") | ||
return JSONResponse({"message": "Login failed", "error": str(e)}, status_code=401) | ||
return JSONResponse({"message": "An internal error occurred"}, status_code=401) | ||
|
No description provided.