Stop logging bearer tokens in the DA proxy
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 79/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- csharp
- Domain
- observability, security
Research direction
Start in src/oed-feedpoller/Services/DaEventFeedProxyService.cs and inspect the three logging statements in DaEventFeedProxyService.ProxyRequest. Remove the two bearer token logs and ensure the headers log excludes Authorization or omits headers. Done when those statements cannot log bearer tokens; consider whether existing token telemetry should be purged.
Written by the indexing model from the issue text.
Description
DaEventFeedProxyService.ProxyRequest writes bearer tokens to Application Insights at Information level.
Affected log statements in src/oed-feedpoller/Services/DaEventFeedProxyService.cs:
"Proxying request to {Url} with {Headers}": serializes all incoming request headers, includingAuthorization."Proxying request to {Url} with {BearerToken}": logsoutgoingRequest.Headers.Authorization."Proxying response to {Url} with {BearerToken}": logsincomingResponse.RequestMessage.Headers.Authorization, i.e. the token actually sent to DA (Maskinporten token with thedomstol*scopes when the handler adds it).
Anyone with read access to the App Insights resource can read valid DA tokens for as long as they live.
Suggested fix
- Remove the two
{BearerToken}log statements. - Log only non-sensitive headers (or none) in the
{Headers}statement. - Consider whether existing telemetry containing tokens should be purged.
- Dominant language
- No language data
- Stars
- 5
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Altinn/oed
-
Hjelpetekst - bankOpenDesignfix
Difficulty 1/5 Under an hour Newbie friendliness 64/100
-
Festet gravplassOpenDesignfix
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
-
Designfix
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
metaskirando
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
VictoriaMetrics/VictoriaLogs#1965 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 2 days
-
enhancement returning contributor
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day