[AAP-65701] Add nginx log markers for direct API access detection#318
Merged
jamesmarshall24 merged 3 commits intoansible:mainfrom Feb 17, 2026
Conversation
4b242c4 to
c34c681
Compare
jamesmarshall24
approved these changes
Feb 13, 2026
Contributor
|
This PR is broken, fixed with: |
Add map directives for X-Trusted-Proxy and X-DAB-JW-TOKEN headers to all three nginx config templates (eda-api, eda-event-stream, eda-ui). These markers allow detection of direct component access vs gateway-proxied requests in nginx access logs. Changes to all nginx configs: - Add map directives to detect trusted-proxy and dab-jwt headers - Add log_format with rid=$request_id and marker variables - Set access_log to /dev/stdout with main format - Set error_log to /dev/stderr with warn level - Remove per-location log file directives in favor of http-level config The upstream default ingress_type is already 'none' so no route removal changes are needed in defaults. Relates-to: AAP-65701, ANSTRAT-1840
c34c681 to
e53c1a9
Compare
The event-stream nginx config previously included req_len=$request_length in its log_format for debugging event-stream payloads. This was inadvertently dropped when adding the proxy detection markers. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
jamesmarshall24
approved these changes
Feb 17, 2026
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.



What is being changed?
Add nginx log markers to all three EDA nginx config templates to enable detection of direct component access vs gateway-proxied requests:
eda-api.configmap.yaml.j2(API server nginx)eda-event-stream.configmap.yaml.j2(Event stream nginx)eda.configmap.yaml.j2(UI nginx)Why is this change needed?
As part of ANSTRAT-1840 (Remove direct API access to platform components in AAP 2.7), we need visibility into whether requests to EDA are arriving through the AAP gateway (with
X-Trusted-ProxyandX-DAB-JW-TOKENheaders) or directly.The nginx log markers allow operators to detect and audit direct component access using log analysis tools.
How does this change address the issue?
Each nginx config template now includes:
mapdirectives that detect the presence ofX-Trusted-ProxyandX-DAB-JW-TOKENheaderslog_formatthat appendsrid=$request_id,$trusted_proxy_present, and$dab_jwt_presentmarkersaccess_log /dev/stdout main;anderror_log /dev/stderr warn;for consistent loggingThe upstream default
ingress_type: noneis already correct for AAP deployments (no direct routes created).Does this change introduce any new dependencies, blockers or breaking changes?
No new dependencies. This is additive to the log format. Compatible with PR #317 (AAP-65231) which also adds
rid=$request_idand stdout/stderr logging.How it can be tested?
trusted-proxy dab-jwt- -Relates-to: AAP-65701, ANSTRAT-1840