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

Disable exposing metrics server on all interfaces #3662

Merged
merged 4 commits into from
Oct 27, 2023

Conversation

michalpristas
Copy link
Contributor

@michalpristas michalpristas commented Oct 26, 2023

What does this PR do?

This PR disables option to configure agent in a way that it will expose monitoring agent on all interfaces.
Empty value for agent.monitoring.http.host is now disabled and is replaced by localhost

Agents upgraded from <8.5 do have empty host due to change in defaults in 8.5. These agents are exposing metrics endpoint on all interfaces not on purpose.

Guard is implemented at the time of configuration unpacking and at the time of server creation to minimize future misbehavior with possible code changes

Fixes: #2509

@michalpristas michalpristas self-assigned this Oct 26, 2023
@michalpristas michalpristas added enhancement New feature or request Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team Team:Elastic-Agent Label for the Agent team skip-changelog backport-v8.11.0 Automated backport with mergify labels Oct 26, 2023
@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 26, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-10-26T10:50:31.863+0000

  • Duration: 28 min 34 sec

Test stats 🧪

Test Results
Failed 0
Passed 6577
Skipped 59
Total 6636

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages.

  • run integration tests : Run the Elastic Agent Integration tests.

  • run end-to-end tests : Generate the packages and run the E2E Tests.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@elasticmachine
Copy link
Contributor

elasticmachine commented Oct 26, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 98.824% (84/85) 👍
Files 66.885% (204/305) 👍
Classes 66.011% (369/559) 👍 0.061
Methods 53.062% (1161/2188) 👍 0.021
Lines 39.417% (13693/34739) 👍 0.057
Conditionals 100.0% (0/0) 💚

@elastic-sonarqube
Copy link

@michalpristas
Copy link
Contributor Author

ci failing on processing failed results 🤦
integ.tests ok

@michalpristas michalpristas marked this pull request as ready for review October 26, 2023 12:59
@michalpristas michalpristas requested a review from a team as a code owner October 26, 2023 12:59
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane)

@pierrehilbert
Copy link
Contributor

I re-ran the processing step that seems to be okay this time

@michalpristas michalpristas changed the title Disable exposing metrics server on all devices Disable exposing metrics server on all interfaces Oct 26, 2023
http:
enabled: true
host: " "`, DefaultHost},
{"default", `enabled: true
Copy link
Member

Choose a reason for hiding this comment

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

[Suggestion]

Suggested change
{"default", `enabled: true
{"default host", `enabled: true

Copy link
Member

@pchila pchila left a comment

Choose a reason for hiding this comment

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

LGTM

@michalpristas michalpristas merged commit 2afea75 into elastic:main Oct 27, 2023
21 checks passed
mergify bot pushed a commit that referenced this pull request Oct 27, 2023
This PR disables option to configure agent in a way that it will expose monitoring agent on all interfaces.
Empty value for agent.monitoring.http.host is now disabled and is replaced by localhost

Agents upgraded from <8.5 do have empty host due to change in defaults in 8.5. These agents are exposing metrics endpoint on all interfaces not on purpose.

Guard is implemented at the time of configuration unpacking and at the time of server creation to minimize future misbehavior with possible code changes

(cherry picked from commit 2afea75)
michalpristas added a commit that referenced this pull request Oct 30, 2023
This PR disables option to configure agent in a way that it will expose monitoring agent on all interfaces.
Empty value for agent.monitoring.http.host is now disabled and is replaced by localhost

Agents upgraded from <8.5 do have empty host due to change in defaults in 8.5. These agents are exposing metrics endpoint on all interfaces not on purpose.

Guard is implemented at the time of configuration unpacking and at the time of server creation to minimize future misbehavior with possible code changes

(cherry picked from commit 2afea75)

Co-authored-by: Michal Pristas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v8.11.0 Automated backport with mergify enhancement New feature or request skip-changelog Team:Elastic-Agent Label for the Agent team Team:Elastic-Agent-Control-Plane Label for the Agent Control Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Agent monitoring server is binding to all interfaces instead of localhost
5 participants