Skip to content

Add '/metrics' to commonPaths in auth middleware#1299

Draft
sthwang-metal wants to merge 1 commit intoflatcar:mainfrom
sthwang-metal:patch-1
Draft

Add '/metrics' to commonPaths in auth middleware#1299
sthwang-metal wants to merge 1 commit intoflatcar:mainfrom
sthwang-metal:patch-1

Conversation

@sthwang-metal
Copy link

@sthwang-metal sthwang-metal commented Jan 27, 2026

Skip Auth for /metrics endpoint

Currently can't the /metrics endpoint without auth. This change makes this consistent with the middlewareSkipper configured here:

return custommiddleware.MatchesOneOfPatterns(c.Request().URL.Path, "/health", "/metrics", "/config", "/v1/update", "/flatcar/*", "/assets/*")

How to use

Spin up nebraska and go to /metrics endpoint without auth (like with curl)

Testing done

[Describe the testing you have done before submitting this PR. Please include both the commands you issued as well as the output you got.]

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

@ervcz
Copy link
Collaborator

ervcz commented Jan 28, 2026

Thanks for the PR @sthwang-metal! Could you share a bit more about the use case you want to cover?

Since /metrics exposes internal data (app versions, DB stats, potentially business insights), I would prefer keeping it protected by default. However, I can imagine a scenario where this is useful and justified, for example:

If your Prometheus instance runs in the same private network (e.g., same VPC or Kubernetes cluster) as Nebraska:

  • You could set a flag like public-metrics: true.
  • Ensure your firewall/Ingress blocks external access to /metrics.
  • Let Prometheus access /metrics over the internal network without auth.

To support this safely, could you please make it configurable (opt-in)?

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