Skip to content

update/fix PROXY_DEPTH default value, add 'diagnostics' endpoint #1193

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

Merged
merged 2 commits into from
Jun 13, 2023

Conversation

melange396
Copy link
Collaborator

(...and also some cleanup in admin endpoint file)

turns out... the default value for PROXY_DEPTH set in #1191 is not high enough for the CC API servers and is likely not high enough for the AWS API servers. iirc, the old value of "2" came from some testing on the staging setup, which is apparently not close enough to the configuration of either of the prod setups.

this change updates the value to match CC, which should be sufficient for AWS. this change also adds a new endpoint (api.delphi/epidata/admin/diagnostics) which gives more visibility into the proxy chain of a running system (and maybe other things in the future). it is only accessible with an admin token.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

_require_admin()
log_info_with_request("diagnostics", headers=request.headers)
response_text = f"request path: {request.headers.get('X-Forwarded-For', 'idk')}"
return make_response(response_text, 200, {'content-type': 'text/plain'})

Check failure

Code scanning / SonarCloud

Endpoints should not be vulnerable to reflected cross-site scripting (XSS) attacks

<!--SONAR_ISSUE_KEY:AYiiiasClPkNFakDi1W--->Change this code to not reflect user-controlled data. <p>See more on <a href="https://sonarcloud.io/project/issues?id=cmu-delphi_delphi-epidata&issues=AYiiiasClPkNFakDi1W-&open=AYiiiasClPkNFakDi1W-&pullRequest=1193">SonarCloud</a></p>
Copy link
Contributor

@dmytrotsko dmytrotsko left a comment

Choose a reason for hiding this comment

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

👍

@melange396 melange396 merged commit 9def265 into dev Jun 13, 2023
@melange396 melange396 deleted the proxy_depth_default_update_and_diags branch June 13, 2023 14:11
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.

2 participants