Skip to content
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

feat(auth): Optionally skip authentication for image tagging #3795

Merged
merged 15 commits into from
Sep 27, 2019

Conversation

jervi
Copy link
Contributor

@jervi jervi commented Jun 19, 2019

Adds a new feature flag operations.security.allowUnauthenticatedImageTaggingInAccounts that takes a list of account names, and will skip the authentication check for tagging cloud images in AWS or GCE if the account name matches. The motivation is that if the bakery puts images in a protected account, any tagging stage will fail if the user or service account that triggered the pipeline does not have permissions to write to the account that contains the image, even if the same user just created the image. The feature defaults to disabled to not change the current behaviour.

@jervi jervi force-pushed the allow_unauthenticated_image_tagging branch from 261d38f to 56a0a67 Compare June 20, 2019 10:20
@ajordens
Copy link
Contributor

Not a huge fan of doing it in this spot ... I'd probably lean towards something like the requiresApplicationRestriction() that exists.

Maybe requiresAccountRestriction() and the Image tagging converter could have responsibility for setting it on the description.

It strikes me as heavy handed to pull this into the OperationsController.

jervi added 2 commits July 2, 2019 15:46
Adds a new feature flag operations.security.allowUnauthenticatedImageTaggingInAccounts that takes a list of account names, and will skip the authentication check for tagging cloud images in AWS or GCE if the account name matches. The motivation is that if the bakery puts images in a protected account, any tagging stage will fail if the user or service account that triggered the pipeline does not have permissions to write to the account that contains the image, even if the same user just created the image. The feature defaults to disabled to not change the current behaviour.
Also make the feature more granular by taking a list of accounts instead of just a boolean.
@jervi jervi force-pushed the allow_unauthenticated_image_tagging branch from 56a0a67 to 83e0fbc Compare July 2, 2019 13:46
@jervi
Copy link
Contributor Author

jervi commented Jul 2, 2019

@ajordens Thank you for the review :) I was vacationing last week, so sorry for the slow feedback. I've updated the PR now, would you mind taking another look? I skipped the converter-suggestion, but I can move the functionality there if you like that better.

@@ -68,4 +100,22 @@ class DescriptionAuthorizerSpec extends Specification {
this.names = names
}
}

class TestImageTaggingDescription implements AccountNameable {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I couldn't access the actual implementations because clouddriver-core doesn't depend on the aws or google modules. Do you prefer this test class implementation, or should I depend on the aws and google modules using gradle testImplementation?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this rather than adding the dependency, thanks!

@enrichman
Copy link

enrichman commented Aug 22, 2019

Any update on this? 🙂

@jervi
Copy link
Contributor Author

jervi commented Aug 27, 2019

@spinnaker/reviewers PTAL :)

@@ -68,4 +100,22 @@ class DescriptionAuthorizerSpec extends Specification {
this.names = names
}
}

class TestImageTaggingDescription implements AccountNameable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer this rather than adding the dependency, thanks!

@cfieber cfieber added the ready to merge Approved and ready for a merge label Sep 20, 2019
@cfieber cfieber merged commit 7b4caf6 into spinnaker:master Sep 27, 2019
@jervi jervi deleted the allow_unauthenticated_image_tagging branch September 30, 2019 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Approved and ready for a merge target-release/1.17
Projects
None yet
6 participants