Validate token issuer #528
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
6 participants
Notifications
Due date
No due date set.
Depends on
#175 Use gate key in owner ID field of the produced objects
TrueCloudLab/frostfs-s3-gw
Reference: TrueCloudLab/frostfs-node#528
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:fix/check_session_issuer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add token issuer against object owner validation.
Closes TrueCloudLab/frostfs-sdk-go#117
dd8761af02
toe832c9154f
e832c9154f
toab88cfa039
We must enable this validation only for objects with new version in the version field of the object. Otherwise replication process may be broken in existing networks.
And node should not accept objects with older versions unless they are sent by container nodes (SYSTEM group during replication), probably.
/cc @fyrchik, @realloc
Please explain.
Replicator uses remoteSender: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/support/v0.36/pkg/services/replicator/process.go#L57
Remote sender creates remote target with node's private key: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/support/v0.36/pkg/services/object/put/remote.go#L108
So this condition
token == nil
will be true, so nothing changes.Let me check that. Session token is a part of the object header, not the part of the object request (unlike bearer token), so I am expecting to see
token != nil
. I might be wrong, though.@dstepanov-yadro I got
token != nil
andtoken.AssertAuthKey(&key) == true
during replication.It means that stored objects may fail
!token.Issuer().Equals(ownerID)
check in incoming release and therefore fail replication.Steps to reproduce:
validateSignatureKey()
REP 2 SELECT 4 FROM *
placement policydocker stop
one of those nodesobject.Put
request.frostfs-node
5a4054ee
ab88cfa039
to320a769e01
320a769e01
to348bd68a7a
Added verification that the signer is either an inner ring node or a container node. Also config parameter added to enable/disable this check.
7ea3816469
tofb1c8026f9
LGTM, DNT. See the comment and let's wait for TrueCloudLab/frostfs-s3-gw#175 before merge so we don't break integration.
@ -110,6 +110,7 @@ object:
put:
pool_size_remote: 100 # number of async workers for remote PUT operations
pool_size_local: 200 # number of async workers for local PUT operations
skip_session_token_issuer_verification: true # session token issuer verification will be skipped if true
Are we going to enable it in the current active prod environments?
I thought more of different behavior for this flag:
SYSTEM
group (for running environments to keep compatibility)./cc @fyrchik
It's already done:
@ -161,3 +192,4 @@
return nil
}
func (v *FormatValidator) isIROrContainerNode(obj *objectSDK.Object, signerKey []byte) (bool, error) {
We already have role calculation in the acl service: https://git.frostfs.info/TrueCloudLab/frostfs-node/src/branch/master/pkg/services/object/acl/v2/classifier.go#L27
Can we reuse it somehow?
Done:
sender_classifier
moved toobject/core
package, ACL service and format validator now using it.fb1c8026f9
tod8b00eec92
dkirillov referenced this pull request from TrueCloudLab/frostfs-s3-gw2023-08-07 08:52:26 +00:00
Actually we can safely merge this PR before PRs in gate because the problem occurs only when client cut being used. Currently gates don't use this feature.
@ -383,2 +433,4 @@
}
}
// WithLockSource return option to set Inner Ring source.
WithLockSource -> WithInnerRing
fixed
@ -385,0 +440,4 @@
}
}
// WithLockSource return option to set Netmap source.
WithLockSource -> WithNetmapSource
fixed
@ -385,0 +447,4 @@
}
}
// WithLockSource return option to set Containers source.
WithLockSource -> WithContainersSource
fixed
fea83d546b
to515dc1eece
515dc1eece
to03d446b637
03d446b637
to5793f5fab7
5793f5fab7
to55b82e744b
@ -159,0 +172,4 @@
}
if v.verifyTokenIssuer {
signerIsIROrContainerNode, err := v.isIROrContainerNode(obj, binKey)
Are we looking at the object or request signature here?