armory / dinghy

Pipelines as code for Spinnaker
Apache License 2.0
31 stars 12 forks source link

feat(permissions): write access check #170

Closed kkotula closed 2 years ago

kkotula commented 2 years ago

In this PR I try to address lack of permissions validation in dinghy.

The problem: Each application may have a set of user's roles required to either WRITE or READ or EXECUTE or variation of all of the above. It is possible that user X cannot modify an application using deck due to missing write permission, however nothing prevents the user of changing application's permissions in dinghyfile and pushing that to a repository. In such case application level permissions will be overridden with values from dinghyfile. It is considered by many of our clients as a security issue.

The solution: The solution is fairly simple - before updating application's attributes, we need to ask Fiat about user X's roles and compare them with application's permissions. If user has write access, they can change application's attributes. If they don't, an error is returned. New feature is not enabled by default. To enable it, clients need to set flag userWritePermissionsCheckEnabled to true.

armory-jenkins commented 2 years ago

The title of this Pull Request needs to be changed to match the format:

<type>(<scope>): <subject>

See more details here: https://www.spinnaker.io/community/contributing/submitting/#commit-message-conventions

Some common examples are:

feat(armory.io): add docs.armory.io
fix(parser): grammar and spelling
style(loadingPage): made it super pretty!
refactor(helpMessages): changed order to make more sense
coveralls commented 2 years ago

Coverage Status

Coverage increased (+0.6%) to 54.968% when pulling 6161329b589db3a3712acefa7e89a6cde583d594 on feat(permissions)/write_access_check into d8697fabf1e860c5ce3684a927b162dd32e59e77 on master.

armory-jenkins commented 2 years ago

The title of this Pull Request needs to be changed to match the format:

<type>(<scope>): <subject>

See more details here: https://www.spinnaker.io/community/contributing/submitting/#commit-message-conventions

Some common examples are:

feat(armory.io): add docs.armory.io
fix(parser): grammar and spelling
style(loadingPage): made it super pretty!
refactor(helpMessages): changed order to make more sense