Open evgeniiz321 opened 1 year ago
The problem is that getrangehash needs getrange to operate and it's a valid requirement (consider hashing a part of the large object). So any permission set that allows getrangehash only is useless (see https://github.com/nspcc-dev/neofs-spec/blob/master/01-arch/07-acl.md#extended-acl also). But the deeper problem in fact is that we have an insane ACL system that can't be explained to people and that doesn't add any value despite all of its complexity.
Allowing to GET, but not allowing to GETRANGE is like allowing read()
, but not allowing mmap()
(yeah, this has some difference SECCOMP-wise (RSBAC if anyone remembers), but that's a different problem). Allowing GETRANGEHASH, but not allowing to GET/GETRANGE does not protect data from being read, it just makes it a little harder to do that. There is absolutely zero security added (data can be read with any of these three), just a maintenance burden and configuration headache.
In short, protocol verbs are not the thing users operate with when they think about access. One can set different bits to these different verbs, but they will break in one way or another, so no one even tries (these verbs are configured identically). People usually think in terms of some rwx Unix model, even when they think of S3 actions they expect an action to work on its own, not require anything additional.
Specifically, get/getrange/getrangehash are the same thing. GETRANGE can be deleted completely and be a parameter of GET. GETRANGEHASH is somewhat specific to audit, so it can either be made tied to GET permission or just be available to system nodes with no user access at all (what application needs it?).
In the failure above I generated a bearer token with the following command -
COMMAND: neofs-cli --config /home/runner/work/neofs-node/neofs-node/neofs-testcases/wallet_config.yml acl extended create --cid 'HMVBh53JLaPF38Ztca3TQKfgjPwvFhBto1bSeREjfyiy' --out '/home/runner/work/neofs-node/neofs-node/neofs-testcases/TemporaryDir/TestFilesDir/eacl_table_82a063fd-c6af-4a9c-905f-979d1de560ec.json' --rule 'allow put user' --rule 'allow get user' --rule 'allow head user' --rule 'allow getrange user' --rule 'allow getrangehash user' --rule 'allow search user' --rule 'allow delete user'
RETCODE: 0
STDOUT:
STDERR:
Start / End / Elapsed 20:52:03.805656 / 20:52:03.819742 / 0:00:00.014086
So getrange should be allowed together with getrangehash
Related to https://github.com/nspcc-dev/neofs-testcases/pull/621
Current Behavior
getrange
andgetrangehash
)getrangehash
:In logs there are the following entries at the time of the failure:
Expected Behavior
The command should work with this bearer token. All other commands work ok.
Steps to Reproduce
test_bearer_token_expiration
- allure.tar.gzRegression
(No)
Your Environment
Run on current latest master of neofs-node - 98717120a74c62b328b45f036f770b02685fb9b8