Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Only expose metrics by default in weave-kube #3271

Merged
merged 4 commits into from
Apr 9, 2018
Merged

Only expose metrics by default in weave-kube #3271

merged 4 commits into from
Apr 9, 2018

Conversation

bboreham
Copy link
Contributor

@bboreham bboreham commented Apr 4, 2018

The handler for --status-addr exposes /metrics, /status and /report, and since we listen on 0.0.0.0 by default in weave-kube this could be attacked.

Change the default to only answer /metrics, while retaining compatibility for anyone who set the WEAVE_STATUS_ADDR variable.

@bboreham bboreham added this to the 2.2.2 milestone Apr 4, 2018
@bboreham bboreham changed the base branch from 2.2 to master April 4, 2018 14:01
@bboreham bboreham removed this from the 2.2.2 milestone Apr 4, 2018
@bboreham bboreham requested a review from brb April 4, 2018 14:16
@@ -54,6 +54,12 @@ else
fi
fi

STATUS_OPTS="--metrics-addr=$METRICS_ADDR"
# --status-addr exposes internal information, so only turn it on if asked to.

This comment was marked as abuse.

@@ -474,10 +476,17 @@ func main() {
muxRouter.Methods("GET").Path("/metrics").Handler(metricsHandler(router, allocator, ns, dnsserver))
statusMux := http.NewServeMux()
statusMux.Handle("/", muxRouter)
Log.Println("Listening for metrics requests on", statusAddr)
Log.Println("Listening for status+metrics requests on", statusAddr)

This comment was marked as abuse.

This comment was marked as abuse.

This comment was marked as abuse.

@bboreham bboreham added this to the 2.3 milestone Apr 9, 2018

When installed as a Kubernetes Addon, the router listens for metrics
requests on 0.0.0.0:6782 and the Network Policy Controller listens on
0.0.0.0:6781. No other requests are served on these endpoints.

This comment was marked as abuse.

You can also add `--metrics-addr=X.X.X.X:PORT` to specify an address
to listen for metrics only.


This comment was marked as abuse.


Set it to an empty string to disable.

You can also add `--metrics-addr=X.X.X.X:PORT` to specify an address

This comment was marked as abuse.

@brb brb merged commit ada2af0 into master Apr 9, 2018
damoon pushed a commit to utopia-planitia/kubernetes that referenced this pull request May 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants