Support secondary keys in FrostFSID contract #1436
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 project
No assignees
2 participants
Notifications
Due date
No due date set.
Depends on
#118 Restrict adding primary key of one subject as additional key of another subject
TrueCloudLab/frostfs-contract
Reference: TrueCloudLab/frostfs-node#1436
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Is your feature request related to a problem? Please describe.
FrostFSID contract supports multiple additional keys for subject. It means, that single subject may operate with different wallet files. Requests signed by these wallet must be handled correctly by node and inner ring.
Describe the solution you'd like
(if necessary) Update frostfs-cli or frostfs-adm to support addition of secondary keys to a subject
Update code of subject fetchers:
GetSubjectByKey
in FormFrostfsIDRequestPropertiesGetSubjectByKey
in GroupsDescribe alternatives you've considered
None.
Additional context
In private installation, there might be service account that exists on all network nodes with different unique wallets. Instead of having multiple subjects in the same service group, it is possible to keep single data-path subject and register several wallets for it.
Similar to TrueCloudLab/frostfs-s3-gw#518
Can we have the same key listed as the main one for one account and as an additional one for another?
If yes, is it what we want?
I think contract allows it.
I would rather restrict it on contract level, but may be there are other opinions. I will create new issue in contract repo.
Contract discussion here: TrueCloudLab/frostfs-contract#118
Restricting it on a contract level is a MUST, otherwise we cannot really rely on it anywhere. This can lead to all kinds of surprising behaviours.
Could you describe the correct behaviour w.r.t to APE rules?
Consider Alice having primary key
key_1
and secondary keyskey_2
andkey_3
.Examples:
Request is signed by
key_2
. Before checking policies, APE identifies thatkey_2
is associated with Alice and her public key fromkey_1
. Node searches for all policies attached to Alice and her groups. If chain rule contains condition with public key ofkey_1
, this condition should not match (*)The same applies to the request that contains bearer token with
allowImpersonate
flag and signed bykey_3
.As for Inner Ring, during container creation, it should verify, that ownerID of container is set to Alice (address of
key_1
) even if request is signed bykey_2
orkey_3
.During all container owner check (if there any),
key_2
andkey_3
signatures must be interpreted askey_1
signature andkey_1
owner.(*) User should be able to make condition to match all it's keys. For me, this is primary case we should implement. S3 / IAM policy converter uses public key condition. It will be broken after secondary key support.
To fix it later, we have to introduce new condition and use it in converter. Also migrate existing rules.
The alternative is to match
public_key=key_1
with any secondary key.@alexvanin, please, look at TrueCloudLab/frostfs-contract#129
It solves the problem for container creation and it seems sufficient for now.