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

[docs][chore] warning for using localhost in security-best-practices #9444

Merged
merged 7 commits into from
Mar 6, 2024

Conversation

Sanket-0510
Copy link
Contributor

Description:
warning and alert for using localhost which might go under DNS resolution and end up with an unexpected IP, risking security.

Link to tracking Issue: #9338

Documentation: Added Waring and risk alert in https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/security-best-practices.md

@Sanket-0510 Sanket-0510 requested a review from a team as a code owner January 31, 2024 17:28
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

I think this should be under the 'Safeguards against denial of service attacks' section.

I also don't think we should word it as a warning and make it seem like localhost is the right option to use: it is the right option to use for many use cases, even if there may be use cases where it's not the right thing to do.

Instead, we should state that if localhost resolves to something other than 127.0.0.1/::1, you can use these explicitly isntead

@Sanket-0510
Copy link
Contributor Author

Sanket-0510 commented Jan 31, 2024

I think this should be under the 'Safeguards against denial of service attacks' section.

I also don't think we should word it as a warning and make it seem like localhost is the right option to use: it is the right option to use for many use cases, even if there may be use cases where it's not the right thing to do.

Instead, we should state that if localhost resolves to something other than 127.0.0.1/::1, you can use these explicitly isntead

will this be fine @mx-psi ?

If 'localhost' resolves to a different IP due to DNS then explicitly use these IPs instead:
IPv4: 127.0.0.1
IPv6: ::1
IPv6 Reminder:
In IPv6 setups, ensure your system supports both IPv4 and IPv6 loopback addresses to avoid issues.

Best Practice:
For clarity and safety, consider explicitly mentioning the IP (127.0.0.1) instead of relying solely on 'localhost,' especially in sensitive setups. Keep things consistent across different networks.

@Sanket-0510 Sanket-0510 changed the title warning for using localhost in security-best-practices [chore] warning for using localhost in security-best-practices Jan 31, 2024
@Sanket-0510
Copy link
Contributor Author

@mx-psi this is stale from last week, could you please review this PR.

@mx-psi
Copy link
Member

mx-psi commented Feb 6, 2024

@Sanket-0510 Apologies, I likely won't have time to review until the end of the week

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.90%. Comparing base (f11c5bb) to head (5fac17a).
Report is 70 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9444      +/-   ##
==========================================
+ Coverage   90.70%   90.90%   +0.20%     
==========================================
  Files         347      348       +1     
  Lines       18199    18382     +183     
==========================================
+ Hits        16507    16710     +203     
+ Misses       1369     1348      -21     
- Partials      323      324       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Sanket-0510 Sanket-0510 changed the title [chore] warning for using localhost in security-best-practices warning for using localhost in security-best-practices Feb 8, 2024
@mx-psi
Copy link
Member

mx-psi commented Feb 9, 2024

[...]

Best Practice:
For clarity and safety, consider explicitly mentioning the IP (127.0.0.1) instead of relying solely on 'localhost,' especially in sensitive setups. Keep things consistent across different networks.

I disagree that this is a 'best practice': this is an edge case and we should document it as an edge case.

@Sanket-0510 Sanket-0510 changed the title warning for using localhost in security-best-practices [docs] warning for using localhost in security-best-practices Feb 18, 2024
@Sanket-0510 Sanket-0510 changed the title [docs] warning for using localhost in security-best-practices [docs][chore] warning for using localhost in security-best-practices Feb 20, 2024
Copy link
Contributor

github-actions bot commented Mar 6, 2024

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Mar 6, 2024
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

I would just go with this for now. We can add more info in the future, but I think this is straight to the point and gives the minimal information needed

docs/security-best-practices.md Outdated Show resolved Hide resolved
Co-authored-by: Pablo Baeyens <pbaeyens31+github@gmail.com>
Copy link
Member

@mx-psi mx-psi left a comment

Choose a reason for hiding this comment

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

Thanks for bearing with me on this and apologies for the delay in replying (I went on vacation for a couple weeks 😄). Let's go with this for now and see how people respond :)

@Sanket-0510
Copy link
Contributor Author

Thanks for bearing with me on this and apologies for the delay in replying (I went on vacation for a couple weeks 😄). Let's go with this for now and see how people respond :)

No worries, I hope you had a great vacation 😊. Yes now this looks to the point and is short also. ✨✨

@mx-psi mx-psi merged commit 2832cd5 into open-telemetry:main Mar 6, 2024
46 of 47 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants