-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NSFS | NC | add option to set account supplemental groups #8552
base: master
Are you sure you want to change the base?
Conversation
702fd42
to
9abd913
Compare
f2ee5e0
to
6f7239b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added my comments (without the native files).
I would list things that you can add in this PR:
- Tests for the noobaa-cli that combines the supplemental groups with the
--from_file
flag. - Tests for the noobaa-cli that combines the supplemental groups with the
--anonymous
flag - Update the
S3Ops.md
about permission - currently only UID, GID is mentioned.
src/test/unit_tests/jest_tests/test_nc_nsfs_account_cli.test.js
Outdated
Show resolved
Hide resolved
src/test/unit_tests/jest_tests/test_nc_nsfs_account_cli.test.js
Outdated
Show resolved
Hide resolved
08a66b9
to
406c2ed
Compare
406c2ed
to
b07ff70
Compare
a0b9986
to
5ebbbc7
Compare
5ebbbc7
to
b306fb3
Compare
e0d6ef0
to
599225f
Compare
b948756
to
cbb9118
Compare
3ec6ddd
to
1ef9a41
Compare
0e324bf
to
87ed095
Compare
- `uid/gid/user` - An account's access key is mapped to a file system uid/gid (or user). Before performing any file system operation, NooBaa switches to the account's UID/GID, ensuring that accounts access to buckets and objects is enforced by the file system. | ||
- `uid/gid/user` - An account's access key is mapped to a file system uid/gid (or user). Before performing any file system operation, NooBaa switches to the account's UID/GID, ensuring that accounts access to buckets and objects is enforced by the file system. | ||
|
||
- `supplemental_groups` - In addition to the account main GID, an account can have supplementary group IDs that are used to determine permissions for accessing files. These GIDs are validated against a files group (GID) permissions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra space
- `supplemental_groups` - In addition to the account main GID, an account can have supplementary group IDs that are used to determine permissions for accessing files. These GIDs are validated against a files group (GID) permissions. | |
- `supplemental_groups` - In addition to the account main GID, an account can have supplementary group IDs that are used to determine permissions for accessing files. These GIDs are validated against a files group (GID) permissions. |
if (!_groups.empty()) { | ||
_groups.push_back(_gid); | ||
std::swap(_groups.front(), _groups.back()); | ||
MUST_SYS(setgroups(_groups.size(), &_groups[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a comment about this change?
//TODO on mac new directories are created with the parents directory GID and not with the process GID. manually change the gid | ||
fs.promises.chown(full_path_non_root1, NON_ROOT2_FS_CONFIG.uid, NON_ROOT2_FS_CONFIG.gid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it here and not after the nb_native().fs.mkdir
?
Why the fs.promises.chown
is on full_path_non_root1
and not full_path_non_root2
?
Signed-off-by: nadav mizrahi <[email protected]>
87ed095
to
246a0e3
Compare
Explain the changes
supplemental groups are additional groups an account can be part of besides his main group (gid). add option to set a users supplemental groups through the nsfs cli. see
Supplementary group IDs
in https://man7.org/linux/man-pages/man7/credentials.7.html. having addition groups allows account to access files and directory that allow access to one of the accounts supplemental groups (similar to main group access ). supplementary group IDs are used mainly for adding permissions. for other purposes the accounts main GID will be used (for example determining the group of a file created by the account). note that this enables access only on file system level, s3 commands will still require bucket policy permissions. in the same manner account will still be block from accessing the file system even if it has bucket policy permissionsnsfs_account_config
Issues: Fixed #7274
Testing Instructions:
sudo npx jest test_nc_nsfs_account_cli.test.js
sudo npx jest test_nc_nsfs_anonymous_cli.test.js
sudo node ./node_modules/mocha/bin/mocha src/test/unit_tests/test_nsfs_access.js
sudo NC_CORETEST=true node ./node_modules/mocha/bin/mocha src/test/unit_tests/test_nsfs_integration.js