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

Change existing AWS service connection authentication from access & secret key to OIDC #564

Open
swansonaj opened this issue Aug 30, 2024 · 5 comments

Comments

@swansonaj
Copy link

Is your feature request related to a problem? Please describe.
I tried to modify an existing AWS service connection to switch from access & secret key authentication to OIDC authentication. Using the service connection editor I cleared the access key and checked the "Use OIDC" checkbox (note that I could do nothing with the secret key because it is already empty according to the UI). I then re-ran a pipeline that was using the service connection and received this error:

"##[error]Error: Need to define or omit both "Access Key ID" and "Secret Access Key", not just one."

I strongly suspect this is because I was only able to clear the access key field while the secret key remained unchanged.

Describe the solution you'd like
It would be very helpful if the service connection UI had some technique for clearing the secret key or if the runtime just logged a message that OIDC authentication is being used because incomplete access key/secret key credentials were configured in the service connection.

Describe alternatives you've considered
I considered asking customers to create a new service connection that uses OIDC but then they also have to modify all of their pipelines to use the new service connection. It would be much easier if I could provide instructions to them on how to modify their existing service connections.

Additional context
Organizationally, I work for group that sets standards for our whole enterprise so I am looking for the most efficient way to convert our whole enterprise to use OIDC for AWS service connections.

@shillam
Copy link

shillam commented Oct 16, 2024

@swansonaj did you ever find any workaround to clear this? We are looking to do the same switch to using OIDC

@ROunofF
Copy link
Contributor

ROunofF commented Nov 19, 2024

Unfortunately the UI to edit this isn't something add-ons controls... Looks like they are treating the "empty" field on the secret as don't change it...

I wonder if there is programmatically a way to clean the secret ?

Otherwise, recreating it could potentially be the only options :(

@swansonaj
Copy link
Author

@swansonaj did you ever find any workaround to clear this? We are looking to do the same switch to using OIDC

No workaround to date

@swansonaj
Copy link
Author

Unfortunately the UI to edit this isn't something add-ons controls... Looks like they are treating the "empty" field on the secret as don't change it...

I wonder if there is programmatically a way to clean the secret ?

Otherwise, recreating it could potentially be the only options :(

Thanks for checking. Since the UI path is a dead end could you consider the other suggestion I made as I do think it is under control of this add-on:

"or if the runtime just logged a message that OIDC authentication is being used because incomplete access key/secret key credentials were configured in the service connection."

In other words why do you have to "omit" both the access key AND secret key in order for OIDC to be used. Imo, its pretty obvious that OIDC is the desired authentication if the access key is omitted and the OIDC flag is checked.

@ROunofF
Copy link
Contributor

ROunofF commented Nov 21, 2024

I just did a test and it seems you can remove those fields via the az tool (or API), this may be a viable approach...

Anyway, I had issue getting my first PUT to work but I was able to do a get and set the value to an empty string "":

# Get the endpoints json 
az devops invoke --http-method GET --area service-endpoints --organization https://contoso.visualstudio.com/ --area serviceendpoint --resource endpoints --api-version 7.1 --route-parameters project=Test endpointId=XYZ-XYZ-XYZ —out-file endpoint.json

# Set username and password empty
cat endpoints.json | jq '.authorization.parameters.password |= "" | .authorization.parameters.username |= ""' > endpoints_cleaned.json

# Put to update the service connections
az devops invoke --http-method PUT --area service-endpoints --organization https://contoso.visualstudio.com --area serviceendpoint --resource endpoints --api-version 7.1 --route-parameters endpointId=XYZ-XYZ-XYZ  --in-file endpoints_cleaned.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants