Sandor Molnar created KNOX-3603:
-----------------------------------

             Summary: KnoxIDF: Refuse delegated tokens at client revocation and 
enable/disable
                 Key: KNOX-3603
                 URL: https://issues.apache.org/jira/browse/KNOX-3603
             Project: Apache Knox
          Issue Type: Improvement
          Components: KnoxIDF
            Reporter: Sandor Molnar
            Assignee: Sandor Molnar
             Fix For: 3.1.0


*Problem*
KNOX-3600 refuses a delegated token (an {{ActorChainPrincipal}} on the subject, 
from an {{act}} claim) at {{/knoxidf/api/v1/client/register}}. The other client 
endpoints {{RegistrationResource}} inherits from {{TokenResource}} have no such 
check: {{revoke}}, {{revokeTokens}}, {{enable}}, {{enableTokens}}, {{disable}} 
and {{disableTokens}}. They act when the caller's effective principal is the 
token's user or creator, and accept a bare token id. So whoever holds a user's 
delegated token ({{sub}} = user, {{act}} = itself) can revoke or disable any of 
that user's tokens whose ids it knows, on any topology that serves these paths 
and trusts the issuer of the delegated token.

*Fix*
In {{RegistrationResource}}, override those six methods: if 
{{delegatedCallerDenied()}}, reject with {{access_denied}} and audit 
{{reason=delegated_caller_denied}}, as {{registerClient}} does.
* Reuse {{knoxidf.client.registration.delegated.callers.denied}} (default 
{{true}}): one switch decides whether delegated tokens may manage clients.
* Only the actor chain is checked, as in KNOX-3600. Callers without one 
(Shiro/LDAP, passcodes, non-delegated JWTs) are unaffected.

*Tests*
* Delegated subject: each of the six methods is rejected and audited, and the 
token's state is unchanged.
* With the param set to {{false}}: a delegated subject can revoke and disable.
* Non-delegated subject: revokes and disables its own token.




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to