Skip to content
This repository has been archived by the owner on Jul 26, 2022. It is now read-only.

feat: add option to assume role #144

Merged
merged 7 commits into from
Sep 27, 2019

Conversation

moolen
Copy link
Member

@moolen moolen commented Aug 9, 2019

This PR solves #143

It adds an option to specify a roleArn on a ExternalSecret CRD. The app will assume a role before retrieving the secret.

I tested it using localstack and AWS.

@moolen
Copy link
Member Author

moolen commented Aug 13, 2019

@silasbw could you please take a look if you have the time?

@silasbw silasbw requested a review from keweilu August 21, 2019 15:31
Copy link
Contributor

@silasbw silasbw left a comment

Choose a reason for hiding this comment

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

hey @moolen, sorry for the delay. It's been vacation season over here.

Looks, good. One question.

lib/poller.js Outdated
* @param {Object} namespace namespace object
* @param {Object} descriptor secret descriptor
*/
async _isPermitted (namespace, descriptor) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do external secrets users need to add annotations to their namespaces if they're using the assume role feature?

Copy link
Member Author

Choose a reason for hiding this comment

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

they don't have to, it's optional. I added a test to verify all testcases.

README.md Outdated Show resolved Hide resolved
moolen added 5 commits August 21, 2019 22:32
add option to restrict the range of assumed roles by
specifying an regular expression on a namespace annotation

Signed-off-by: Moritz Johner <[email protected]>
@moolen
Copy link
Member Author

moolen commented Aug 22, 2019

@silasbw i addressed the issues and rebased, PTAL again.

Copy link
Contributor

@keweilu keweilu left a comment

Choose a reason for hiding this comment

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

few nits

README.md Outdated Show resolved Hide resolved
config/aws-config.js Show resolved Hide resolved
Copy link
Contributor

@keweilu keweilu left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

@mo-saeed
Copy link

mo-saeed commented Sep 16, 2019

Just to mention, This pull request is really important for us.
@silasbw Hope it will get approved, merged and released soon so we can test it.
Thanks @moolen for implementing this !

@anujgpatel
Copy link

Thanks for this feature, do we have a tentative date when this can be released?

@antoniotamer
Copy link

Hi,

I got the impression from the docs in the master branch that role assumption is possible on a per-secret basis is possible. I went ahead and created a role for external-secrets to assume in all of my AWS accounts but it seems external-secrets isn't even trying to assume that role.

See below:

apiVersion: kubernetes-client.io/v1
kind: ExternalSecret
metadata:
  annotations:
  labels:
    clusterColor: black
    env: dev
    gitRepo: manual-test-delete-me
  name: manual-test-delete-me
  namespace: default
secretDescriptor:
  backendType: systemManager
  roleArn: <<a role arn that can be assumed>>
  data:
  - key: /glooe/license-key
    name: license-key

I'm running external-secrets 1.5.0. Do we need to wait on a release for this feature to be usable?

anarcher pushed a commit to anarcher/kubernetes-external-secrets that referenced this pull request Oct 30, 2019
* feat: add option to assume role when retrieving secrets

Signed-off-by: Moritz Johner <[email protected]>

* feat: restrict iam roles per namespace

add option to restrict the range of assumed roles by
specifying an regular expression on a namespace annotation

Signed-off-by: Moritz Johner <[email protected]>

* chore: add test to verify assume-role access control

* docs: add policy for secrets manager

* docs: add assume-role limits per ns

Signed-off-by: Moritz Johner <[email protected]>

* docs: fix spelling

Signed-off-by: Moritz Johner <[email protected]>

* chore: remove stupid code
Flydiverny pushed a commit to Flydiverny/kubernetes-external-secrets that referenced this pull request Nov 3, 2019
* feat: add option to assume role when retrieving secrets

Signed-off-by: Moritz Johner <[email protected]>

* feat: restrict iam roles per namespace

add option to restrict the range of assumed roles by
specifying an regular expression on a namespace annotation

Signed-off-by: Moritz Johner <[email protected]>

* chore: add test to verify assume-role access control

* docs: add policy for secrets manager

* docs: add assume-role limits per ns

Signed-off-by: Moritz Johner <[email protected]>

* docs: fix spelling

Signed-off-by: Moritz Johner <[email protected]>

* chore: remove stupid code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants