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

Authenticate to AWS with dedicated role without AssumeRole permissions #651

Closed
2 tasks
nissanitz opened this issue Mar 5, 2020 · 2 comments · Fixed by #656
Closed
2 tasks

Authenticate to AWS with dedicated role without AssumeRole permissions #651

nissanitz opened this issue Mar 5, 2020 · 2 comments · Fixed by #656
Labels
feature-request All issues for new features that have not been committed to needs-discussion

Comments

@nissanitz
Copy link
Contributor

currently anyone who working with ASW scaler has 2 different ways to authenticate to AWS:
https://github.com/kedacore/keda/blob/2de3a4c2e08ad76d8939357456588259f088c752/pkg/scalers/aws_iam_authorization.go

  1. awsRoleArn - and give to Keda operator assume role permissions (aws-kiam provider)
  2. Configure awsAccessKeyId and awsSecretAccessKey

there is should be another way to authenticate with dedicated role to Keda operator without assume role permissions.

Use-Case

Granting minimum permissions without sts:AssumeRole permissions
for example if we want to work with AWS SQS scaler the role to operator should has this permission:

{
    "Version": "2012-10-17",
    "Statement": [{
        "Effect": "Allow",
        "Action": "sqs:GetQueueAttributes",
        "Resource": "arn:aws:sqs:your_aws_account_number:your_region:your_sqs_queue"
    }]
}

Specification

  • Set new PodIdentityProvider and if configure use default operator role
  • Or if awsAccessKeyId, awsSecretAccessKey or awsRoleArn not configured operator will use default authentication to AWS.
@nissanitz nissanitz added feature-request All issues for new features that have not been committed to needs-discussion labels Mar 5, 2020
@tomkerkhove
Copy link
Member

If we add this this would more a different type of authentication rather than Pod Identity Provider given the pod no longer has an identity but permissions are assigned on KEDA operator itself, no?

@nissanitz
Copy link
Contributor Author

nissanitz commented Mar 6, 2020

True, the implementation may need to contain another property in the ScaledObject resource under Triggers.Metadata to AWS scalers which tells to Keda operator use the permissions which assigned to him. Something like podIdentity if set false use permissions are assigned on KEDA operator itself, if true the behavior will remain as it is today. True is default.

for example

apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
spec:
  triggers:
  - metadata:
      **podIdentity: false**
      awsRegion: <REGION>
      queueLength: <LENGTH>
      queueURL: <URL>
    type: aws-sqs-queue

If that sounds good to you, I can get started to work on PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants