Update ConfigCommand to check site and system permissions#3012
Update ConfigCommand to check site and system permissions#3012cshannon wants to merge 1 commit intoapache:mainfrom
Conversation
The ConfigCommand has been updated to handle security exceptions for users that don't have access to site/system configs and will instead just print the default config and the override of either namespace or table property. This is part 2 of apache#3010
|
This is a draft/prototype of just using default configs for determining the level of overrides for properties for users that don't have access to site/system configs after the changes in #2994 . It probably still needs a bit of work (hence draft status) but I wanted to get some feedback on what people think and if this is what we want to do to solve the problem or if we want to do something else. I probably won't have a lot of time to work on this again until Friday and next weekend so if someone wants to take this over and polish it up feel free as it's a blocker for 2.1.0, assuming this is the direction we want to go in. If this is not the strategy we want then as I mentioned previously in #3010, the other 2 possibilities would be:
|
ctubbsii
left a comment
There was a problem hiding this comment.
This changed a lot of code, and I don't have time to review all of it, so I'm commenting mostly on what appears to be the intended design.
It seems like the intent is to provide feedback on which configs were able to be read, based on the permissions checks.
The main problem with this is that if you can't read all of them, it becomes impossible for the config command to be able to tell which level a configuration value is being set. (default, site, system, namespace, or table). So, for example, with these changes, the user might be able to see the resolved table configuration, but it won't know that the table property is actually set at the system level, and not in the table's configuration.... everything would look like it was overriding the defaults at the table level.
This PR makes me wonder what the point is of adding the permissions checks on the various configuration getters in our API. What is the end goal? Is it to protect against the user being able to view configuration? Ultimately, I'm wondering if that even matters. Previously, any authenticated user could view the configuration for any table, namespace, etc. I think that might still be okay... the configuration should not be used to hold secrets, and if we lock them down, we run into all sorts of complications, like those this PR is revealing. I think we need to ask what we're trying to protect, and from whom.
| Shell.log.debug( | ||
| "User does not have permission to read system and/or site configuration: {}", | ||
| e.getMessage()); |
There was a problem hiding this comment.
I would put this as a warning rather than debug. This could also be separate messages, with information about what shell command to use to grant the appropriate permission.
|
Closing this as it looks like we will be going with #3015 |
The ConfigCommand has been updated to handle security exceptions for users that don't have access to site/system configs and will instead just print the default config and the override of either namespace or table property.
This is part 2 of #3010