[
https://issues.apache.org/jira/browse/KNOX-3461?focusedWorklogId=1042268&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1042268
]
ASF GitHub Bot logged work on KNOX-3461:
----------------------------------------
Author: ASF GitHub Bot
Created on: 17/Sep/26 08:19
Start Date: 17/Sep/26 08:19
Worklog Time Spent: 10m
Work Description: smolnar82 commented on code in PR #1405:
URL: https://github.com/apache/knox/pull/1405#discussion_r4034630178
##########
gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java:
##########
@@ -131,6 +131,18 @@ public class JWTFederationFilter extends AbstractJWTFilter
{
// Has no effect on a same-subject exchange.
public static final String DELEGATION_ENFORCE_REQUESTED_AUDIENCE_MAX_ONE =
"delegation.enforce.requested.audience.max.one";
+ // Topology provider param (default false/absent). Gates whether a
+ // same-subject token exchange may honor a requested audience/resource at
+ // all. While off (the fail-safe default), the requested audience is ignored
+ // for same-subject exchanges, so a passthrough audience validator cannot
+ // mint an arbitrarily-audienced token without authorization. While on, the
+ // requested audience is honored but must be authorized against the subject
+ // token's own aud claim; any requested value the subject token does not
+ // already carry is rejected. Unlike the delegation.* flags above, this one
+ // affects only same-subject exchanges (delegation exchanges are authorized
+ // by the delegation policy regardless of this flag).
+ public static final String
DELEGATION_SAME_SUBJECT_REQUESTED_AUDIENCE_ENABLED =
"delegation.same.subject.requested.audience.enabled";
Review Comment:
Done.
Issue Time Tracking
-------------------
Worklog Id: (was: 1042268)
Time Spent: 1h 40m (was: 1.5h)
> Same subject validation for requested audience
> ----------------------------------------------
>
> Key: KNOX-3461
> URL: https://issues.apache.org/jira/browse/KNOX-3461
> Project: Apache Knox
> Issue Type: Sub-task
> Components: JWT
> Reporter: Harrison Sheinblatt
> Assignee: Sandor Molnar
> Priority: Major
> Time Spent: 1h 40m
> Remaining Estimate: 0h
>
> When delegation is enabled, we'll want to set the knoxidf audience strategy
> to passthrough so we rely on the delegation policy to authorize a requested
> audience instead of the hardcoded list. But once that's set, then the
> same-subject requested audience is unauthorized at all. So we either need to
> not allow requested audiences just for same-subject exchanges with a setting,
> or add enforcement, or both.
> The simplest thing is to add a setting to skip reading the requested audience
> only for same-subject token exchanges.
> The natural authz is to validate the original subject token has the audience
> requested to allow the requested audience. So if the flag to allow reading
> the audience for same-subject exchange is on, we'd authorize on the subject
> token. If this proves a problem, we can turn it off or figure out a way to
> add more audiences to the user tokens knox issues.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)