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
Conversation
…d retention purge and basic-auth on /api/tracking Co-Authored-By: Wes Convery <2wconvery@gmail.com>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
… X-Correlation-ID format Co-Authored-By: Wes Convery <2wconvery@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: dropremoteAddr,userAgent,queryString; the entity now records only correlation id, method, URI, status, duration, error message and timestamp. New FlywayV3__remove_pii_from_api_request_log.sqldrops the three columns.ApiRequestLogRetentionJob(@Scheduled, hourly by default) deletes rows older thanftgo.api-tracking.retention-days(default 7) viaApiRequestLogRepository.deleteOlderThan;ApiTrackingConfigurationgains@EnableScheduling.ApiTrackingSecurityConfiguration(newspring-boot-starter-securitydep inftgo-common):/api/tracking/**requires HTTP Basic auth, everything else stayspermitAll; CSRF disabled / stateless so the existing JSON APIs and end-to-end tests are unaffected. Credentials come from Spring Boot'sspring.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