Skip to content

ext_authz: Track Fail Open & ProcessingEffects in ExtAuthzLoggingInfo#43558

Merged
tyxia merged 13 commits intoenvoyproxy:mainfrom
melginaldi:extauthz-observability
Feb 25, 2026
Merged

ext_authz: Track Fail Open & ProcessingEffects in ExtAuthzLoggingInfo#43558
tyxia merged 13 commits intoenvoyproxy:mainfrom
melginaldi:extauthz-observability

Conversation

@melginaldi
Copy link
Copy Markdown
Contributor

@melginaldi melginaldi commented Feb 19, 2026

Commit Message: Track fail open behavior and processing effects to request headers as part of ExtAuthzLoggingInfo to match parity with ext_proc filter.
Additional Description: This information will be used by ServiceExtensions for debugging/enhanced monitoring. This functionality was added to the ext_proc filter in #41295 and #41691, these bits are to keep parity with the ext_proc filter. last_req_processing_effect will hold the value of the last mutation event the filter completed on the request headers, whether successful or not. Therefore if 5 headers were successfully added but the 6 was invalid and the filter stopped processing any further mutations, the value of last_processing_effect will be InvalidMutationRejected.

Risk Level:Low
Testing:Tested in unit/integration tests
Release Notes: Added new tracking bit last_req_processing_effect and failed_open to ExtAuthzLoggingInfo Filter State to track mutation events and failed_open occurrences.
Docs Changes: N/A
Platform Specific Features: N/A

/assign @tyxia

Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43558 was opened by melginaldi.

see: more, trace.

Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
@melginaldi melginaldi changed the title Track Fail Open in ExtAuthzLoggingInfo Track Fail Open & ProcessingEffects in ExtAuthzLoggingInfo Feb 19, 2026
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
@melginaldi melginaldi marked this pull request as ready for review February 23, 2026 14:39
@melginaldi
Copy link
Copy Markdown
Contributor Author

/assign @tyxia

Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Copy link
Copy Markdown
Member

@tyxia tyxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. Fleshing out some comments...

/wait

Comment thread source/extensions/filters/http/ext_authz/ext_authz.cc Outdated
Comment thread source/extensions/filters/http/ext_authz/ext_authz.h Outdated
Comment thread source/extensions/filters/http/ext_authz/ext_authz.h Outdated
}

// Use this to track if there are any modifications to the request headers.
bool req_header_mutations = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need similar tracking for response header?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. I would prefer to only track request header mutations. I have changes the name of the field to match this expectation and update the code to only care about changes to the request headers.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think your ext_proc changes are tracking both? processHeaderMutation handles both request and response path.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They were. I don't need both but I am happy to add the functionality of both for others

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, I don't have strong opinion and i am fine that you only focus on request mutation in this PR.

Forward looking, if we want to handle both, should we rename MutationApplied to RequestMutationApplied . I guess this also depends on how you are going to differentiate it in ext_proc. I think it is totally doable but it probably requires some extra plumbing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ext_proc, I had two different fields. One was called encode_processing_effects and the other decode_processing_effect which then tracked the header request effect separate from the response.

This way the enum value can be MutationApplied for both and it is clear which path is taken.
I could change the field name in this PR to match and call it decode_processing_effect_. Thoughts?

Copy link
Copy Markdown
Member

@tyxia tyxia Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even if you have decode and encode effect, they are eventually mapped down to enum below which only has
MutationApplied, Would the consumer(i.e., access log) be able to differentiate this? if not, I meant differentiate it have RequestMutationApplied and Response* there

enum class Effect : uint8_t {
// No processing effect. This is the default value except for body request/responses with body
// processing mode
// FULL_DUPLEX_STREAMED. In this case MutationApplied if the default.
None,
// The processor response sent a mutation that successfully modified the body or headers.
// This is the default value for body requests/responses using
// FULL_DUPLEX_STREAMED processing mode.
MutationApplied,
// The processor response sent a mutation that was attempted to modify the headers or trailers
// but was not applied due to invalid name or value.
InvalidMutationRejected,
// The processor response sent a mutation that was attempted to modify the headers or trailers
// but was not applied due to size limit exceeded.
MutationRejectedSizeLimitExceeded,
// The processor response sent a mutation that was attempted to modify the headers or trailers
// but was not applied due to failure.
MutationFailed,
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the consumer could differentiate if the request path or response path had any mutations with the current enum. The req_processing_effect field reflects what mutations happened to the request headers, regardless of which direction/message caused these effects.

So for example, in OnComplete if the only effects are adding headers to the response then req_processing_effect will be None. Even though the request header message added these headers, the mutation did not occur to the request headers themself, so the effect is None.

The goal is to understand which part of the HTTP request message were mutated not which messages requested the mutations. Does this make sense?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG.

in the next PR, please address or add to TODO for response mutation tracking

Comment thread source/extensions/filters/http/ext_authz/ext_authz.cc Outdated
@tyxia tyxia changed the title Track Fail Open & ProcessingEffects in ExtAuthzLoggingInfo ext_authz: Track Fail Open & ProcessingEffects in ExtAuthzLoggingInfo Feb 23, 2026
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Copy link
Copy Markdown
Member

@tyxia tyxia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, Thanks!

@melginaldi I guess you will also need to test this change e2e (for example, with consumer) Have that been done?

Please also address the response mutation track (or a todo) in the future PR. I will merge this PR since CI is not stable at the moment

}

// Use this to track if there are any modifications to the request headers.
bool req_header_mutations = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG.

in the next PR, please address or add to TODO for response mutation tracking

@tyxia tyxia merged commit ea62072 into envoyproxy:main Feb 25, 2026
28 checks passed
bmjask pushed a commit to bmjask/envoy that referenced this pull request Mar 14, 2026
…envoyproxy#43558)

Commit Message: Track fail open behavior and processing effects to
request headers as part of ExtAuthzLoggingInfo to match parity with
ext_proc filter.
Additional Description: This information will be used by
ServiceExtensions for debugging/enhanced monitoring. This functionality
was added to the ext_proc filter in envoyproxy#41295 and envoyproxy#41691, these bits are to
keep parity with the ext_proc filter. last_req_processing_effect will
hold the value of the last mutation event the filter completed on the
request headers, whether successful or not. Therefore if 5 headers were
successfully added but the 6 was invalid and the filter stopped
processing any further mutations, the value of last_processing_effect
will be InvalidMutationRejected.

Risk Level:Low
Testing:Tested in unit/integration tests
Release Notes: Added new tracking bit last_req_processing_effect and
failed_open to ExtAuthzLoggingInfo Filter State to track mutation events
and failed_open occurrences.
Docs Changes: N/A
Platform Specific Features: N/A

/assign @tyxia

---------

Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
Signed-off-by: bjmask <11672696+bjmask@users.noreply.github.com>
bvandewalle pushed a commit to bvandewalle/envoy that referenced this pull request Mar 17, 2026
…envoyproxy#43558)

Commit Message: Track fail open behavior and processing effects to
request headers as part of ExtAuthzLoggingInfo to match parity with
ext_proc filter.
Additional Description: This information will be used by
ServiceExtensions for debugging/enhanced monitoring. This functionality
was added to the ext_proc filter in envoyproxy#41295 and envoyproxy#41691, these bits are to
keep parity with the ext_proc filter. last_req_processing_effect will
hold the value of the last mutation event the filter completed on the
request headers, whether successful or not. Therefore if 5 headers were
successfully added but the 6 was invalid and the filter stopped
processing any further mutations, the value of last_processing_effect
will be InvalidMutationRejected.


Risk Level:Low
Testing:Tested in unit/integration tests
Release Notes: Added new tracking bit last_req_processing_effect and
failed_open to ExtAuthzLoggingInfo Filter State to track mutation events
and failed_open occurrences.
Docs Changes: N/A
Platform Specific Features: N/A

/assign @tyxia

---------

Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
fishcakez pushed a commit to fishcakez/envoy that referenced this pull request Mar 25, 2026
…envoyproxy#43558)

Commit Message: Track fail open behavior and processing effects to
request headers as part of ExtAuthzLoggingInfo to match parity with
ext_proc filter.
Additional Description: This information will be used by
ServiceExtensions for debugging/enhanced monitoring. This functionality
was added to the ext_proc filter in envoyproxy#41295 and envoyproxy#41691, these bits are to
keep parity with the ext_proc filter. last_req_processing_effect will
hold the value of the last mutation event the filter completed on the
request headers, whether successful or not. Therefore if 5 headers were
successfully added but the 6 was invalid and the filter stopped
processing any further mutations, the value of last_processing_effect
will be InvalidMutationRejected.


Risk Level:Low
Testing:Tested in unit/integration tests
Release Notes: Added new tracking bit last_req_processing_effect and
failed_open to ExtAuthzLoggingInfo Filter State to track mutation events
and failed_open occurrences.
Docs Changes: N/A
Platform Specific Features: N/A

/assign @tyxia

---------

Signed-off-by: Melissa Ginaldi <mginaldi@google.com>
krinkinmu pushed a commit to grnmeira/envoy that referenced this pull request Apr 20, 2026
…envoyproxy#43558)

Commit Message: Track fail open behavior and processing effects to
request headers as part of ExtAuthzLoggingInfo to match parity with
ext_proc filter.
Additional Description: This information will be used by
ServiceExtensions for debugging/enhanced monitoring. This functionality
was added to the ext_proc filter in envoyproxy#41295 and envoyproxy#41691, these bits are to
keep parity with the ext_proc filter. last_req_processing_effect will
hold the value of the last mutation event the filter completed on the
request headers, whether successful or not. Therefore if 5 headers were
successfully added but the 6 was invalid and the filter stopped
processing any further mutations, the value of last_processing_effect
will be InvalidMutationRejected.


Risk Level:Low
Testing:Tested in unit/integration tests
Release Notes: Added new tracking bit last_req_processing_effect and
failed_open to ExtAuthzLoggingInfo Filter State to track mutation events
and failed_open occurrences.
Docs Changes: N/A
Platform Specific Features: N/A

/assign @tyxia

---------

Signed-off-by: Melissa Ginaldi <mginaldi@google.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.

2 participants