Make services GroupIDs must also be target of APE checks #1193
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
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1193
Loading…
Reference in a new issue
No description provided.
Delete branch "aarifullin/frostfs-node:feat/groupids_target"
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?
Groups
util function to retrieve actor's groupIDsClose #1190
c1ae4640ad
to6feb58978c
6feb58978c
to9ab5801c29
@ -37,0 +37,4 @@
// Groups return the actor's group ids from frostfsid contract.
func Groups(frostFSIDClient frostfsidcore.SubjectProvider, pk *keys.PublicKey) ([]string, error) {
subj, err := frostFSIDClient.GetSubjectExtended(pk.GetScriptHash())
We have cache in
frostfsIDClient
that's why we can freely invokeGroups
function along withFormFrostfsIDRequestProperties
?Sorry, I don't get your point. Do you mean we can retrieve groups after
FormFrostfsIDRequestProperties
? Yes, we can but this requires some hurtful refactor in all services. For me that was easier to perform some duplication as the cache is used@ -171,1 +176,4 @@
}
rt.Groups = make([]policyengine.Target, len(groups))
for i := range groups {
rt.Groups[i] = policyengine.GroupTarget(groups[i])
As I know, group target must be
<ns>:<gropuID>
rather than just<groupID>
Didn't think about that - fixed
@ -167,2 +169,4 @@
return fmt.Errorf("failed to get group ids: %w", err)
}
if prm.BearerToken != nil && !prm.BearerToken.Impersonate() {
I'm not sure the following question relates to this PR but still.
Why do we check only container target (
policyengine.NewRequestTargetWithContainer
) in case of APE chains from bearer token? As I understand user can set any target inAPEOverride
This is great that you've asked this. Because I was wondering can be other targets used in BT? In some sense I "inherited" this scheme from eACL tables in BT where eACL table's target was only container. Let's discuss
Probably we should ask @fyrchik @alexvanin
The current implementation was indeed intended to serve as a replacement for EACL.
For namespaces there are some security considerations:
Another thing is that overriding namespace rules in isolation is probably not that useful, we would like to probably combine that with other overrides.
I've just meant that if we allow form APE chain with any target in bearer token we should be able process such token in node
Yes,
sdk
freely sets a target forAPEOverride
within a bearer token butsdk
doesn't care would a service that uses this token should allow or deny such target. The question is do we really or will we want to override other targets with BT9ab5801c29
to63c28f0052