NIFI-15710 Always allow node identities to read connectors#10998
NIFI-15710 Always allow node identities to read connectors#10998mcgilman merged 13 commits intoapache:NIFI-15258from
Conversation
|
Will review... |
Co-authored-by: Matt Gilman <matt.c.gilman@gmail.com>
…rts against known node identities
|
@mcgilman I have updated this PR based on our conversation to pick the best approach: SummaryWhen The existing implementation did exact string matching of TLS certificate DNS SANs against node API addresses, which fails with wildcard certificates (e.g. Changes:
Security Review: Wildcard SAN Matching + Proxied Entities Chain CheckWhat the code does
The four gates (all must pass)
Attack surface analysisAttack 1: Token/OIDC-authenticated user sends direct request
Attack 2: mTLS-authenticated user with their own client cert
Attack 3: User request replicated through the cluster (normal flow)
Attack 4: User spoofs
Attack 5: User spoofs both
Attack 6: Cluster node sends request with
Attack 7:
Attack 8:
Wildcard matching correctnessThe implementation: if (clientIdentity.startsWith("*.")) {
final String wildcardSuffix = clientIdentity.substring(1); // ".foo.bar"
for (final String nodeAddress : nodeApiAddresses) {
final int firstDot = nodeAddress.indexOf('.');
if (firstDot > 0 && nodeAddress.substring(firstDot).equals(wildcardSuffix)) {
Edge cases
Impact on
|
| if (clusterNodeRequest) { | ||
| logger.debug("Bypassing authorization for cluster node request on Connector [{}]", id); |
There was a problem hiding this comment.
Is this same bypass needed for the connector asset endpoints to support synchronization.
There was a problem hiding this comment.
I'll look into this.
There was a problem hiding this comment.
Good catch, it is needed, and I added it along with test cases
exceptionfactory
left a comment
There was a problem hiding this comment.
Thanks for the detailed explanation of the cluster node request handling and changes @kevdoran, the approach looks good.
Summary
NIFI-15710
Tracking
Please complete the following tracking steps prior to pull request creation.
Issue Tracking
Pull Request Tracking
NIFI-00000NIFI-00000VerifiedstatusPull Request Formatting
mainbranchVerification
Please indicate the verification steps performed prior to pull request creation.
Build
./mvnw clean install -P contrib-checkLicensing
LICENSEandNOTICEfilesDocumentation