Skip to content

Fix: API tracking persists client IP, User-Agent and query strings for every request and exposes them via unauthenticated /api/tracking endpoints - #329

Open
WesternConcrete wants to merge 2 commits into
masterfrom
devin/1788592118-api-tracking-pii
Open

WesternConcrete wants to merge 2 commits into
masterfrom
devin/1788592118-api-tracking-pii

Conversation

@WesternConcrete

@WesternConcrete WesternConcrete commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Finding: API tracking persists client IP, User-Agent and query strings for every request and exposes them via unauthenticated /api/tracking endpoints (NS compliance gap)
Repo: COG-GTM/ftgo-monolith

Fix approach: stop collecting the identifying fields, bound retention, and put an auth boundary in front of the read API.

  • ApiRequestLog / ApiTrackingInterceptor: drop remoteAddr, userAgent, queryString; the entity now records only correlation id, method, URI, status, duration, error message and timestamp. New Flyway V3__remove_pii_from_api_request_log.sql drops the three columns.
  • ApiRequestLogRetentionJob (@Scheduled, hourly by default) deletes rows older than ftgo.api-tracking.retention-days (default 7) via ApiRequestLogRepository.deleteOlderThan; ApiTrackingConfiguration gains @EnableScheduling.
  • ApiTrackingSecurityConfiguration (new spring-boot-starter-security dep in ftgo-common): /api/tracking/** requires HTTP Basic auth, everything else stays permitAll; CSRF disabled / stateless so the existing JSON APIs and end-to-end tests are unaffected. Credentials come from Spring Boot's spring.security.user.name/password (a random password is generated and logged if unset) — nothing is committed.

Note: local Gradle build could not be verified in this session because Maven Central returned HTTP 429 (rate limited) for all artifact downloads; relying on CI.

Link to Devin session: https://app.devin.ai/sessions/2aa54ffd887c442a8c8a716040545202
Open in Devin Desktop: https://app.devin.ai/desktop/session/2aa54ffd887c442a8c8a716040545202?variant=devin
Requested by: @WesternConcrete


Devin Review

…d retention purge and basic-auth on /api/tracking

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

… X-Correlation-ID format

Co-Authored-By: Wes Convery <2wconvery@gmail.com>
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.

1 participant