open-telemetry / open-telemetry/opentelemetry-cpp

Need Authentication and Authorization Mechanisms for Exposed HTTP Endpoint

Open
#307 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area:exporter do-not-stale metrics priority:p2 release:after-ga
Dominant language
C++
Stars
1.4k
Forks
632
Avg merge
1d 13h
Merged PRs (30d)
75

Description

Is your feature request related to a problem?
Yes. In our current implementation of Prometheus Exporter, we take a string parameter to configure the HTTP we want to expose in the constructor. Then the Prometheus server will scrape the metrics data from that HTTP endpoint. However, besides the Prometheus server, anyone else can also send HTTP GET request to that endpoint and scrape data, which will cause two problems:

  1. The metrics data we exported is not secure, because anyone can get the data without permission as simply as visiting the exposed endpoint in the browser.
  2. The data we served is one-time, which means that they can only be scraped once. If someone else takes the data away before a Prometheus pull request comes, Prometheus will not receive that batch of data and results in a data loss.

Describe the solution you'd like
Adding some authentication and authorization mechanism to the HTTP endpoint we exposed, so that only authorized target Prometheus instance can read and fetch the data we exported from the HTTP endpoint.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Prometheus Exporter constructor that accepts the HTTP endpoint configuration and the code serving that endpoint. Define an authentication and authorization approach that permits only the target Prometheus instance to fetch the exported data, then verify that unauthorized requests are rejected without disrupting authorized scrapes.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, prometheus
Domain
api, authentication, authorization, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.