Skip to content

auth/aws: AWS CodeCommit IAM authentication#1142

Merged
stefanprodan merged 5 commits intofluxcd:mainfrom
taraspos:taras/aws-codecommit
Apr 13, 2026
Merged

auth/aws: AWS CodeCommit IAM authentication#1142
stefanprodan merged 5 commits intofluxcd:mainfrom
taraspos:taras/aws-codecommit

Conversation

@taraspos
Copy link
Copy Markdown
Contributor

@taraspos taraspos commented Feb 28, 2026

Summary

This PR implements IAM role based authentification for AWS CodeCommit Git HTTPS URLs

Testing

  • Verified locally that generated username and password works AWS CodeCommit repositories.
  • Integration tests succeeding:
    --- PASS: TestGitCloneUsingProvider (25.85s)
        --- PASS: TestGitCloneUsingProvider/controller-level_workload_identity (12.20s)
        --- PASS: TestGitCloneUsingProvider/object-level_workload_identity_(impersonation) (13.65s)
        --- SKIP: TestGitCloneUsingProvider/object-level_workload_identity_(direct_access) (0.00s)
        --- SKIP: TestGitCloneUsingProvider/object-level_workload_identity_(impersonation,_federation) (0.00s)
        --- SKIP: TestGitCloneUsingProvider/object-level_workload_identity_(direct_access,_federation) (0.00s)
    

@taraspos taraspos changed the title codecommit: initial implementation of git provider auth/aws: AWS CodeCommit IAM authentification Mar 5, 2026
@taraspos taraspos marked this pull request as ready for review March 5, 2026 13:18
@taraspos taraspos requested a review from a team as a code owner March 5, 2026 13:18
@taraspos taraspos force-pushed the taras/aws-codecommit branch 4 times, most recently from ba8d4f8 to c69e541 Compare March 5, 2026 13:23
@makkes makkes changed the title auth/aws: AWS CodeCommit IAM authentification auth/aws: AWS CodeCommit IAM authentication Mar 5, 2026
Comment thread auth/go.mod Outdated
@taraspos taraspos requested a review from matheuscscp March 5, 2026 13:48
@taraspos taraspos force-pushed the taras/aws-codecommit branch 3 times, most recently from 304978e to 1043954 Compare March 31, 2026 19:39
Comment thread tests/integration/aws_test.go
@matheuscscp
Copy link
Copy Markdown
Member

@taraspos CI is failing, can you pls take a look?

@taraspos
Copy link
Copy Markdown
Contributor Author

taraspos commented Apr 1, 2026

Seems like setup-envtest released a new version that depends on Go 1.26.0

go: sigs.k8s.io/controller-runtime/tools/setup-envtest@latest: sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20260331165415-bce0ec74ad73 requires go >= 1.26.0 (running go 1.25.8; GOTOOLCHAIN=local)

Not related to my change, but I can raise a PR with a fix. Let me do it in a separate branch.

@matheuscscp
Copy link
Copy Markdown
Member

Seems like setup-envtest released a new version that depends on Go 1.26.0

go: sigs.k8s.io/controller-runtime/tools/setup-envtest@latest: sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20260331165415-bce0ec74ad73 requires go >= 1.26.0 (running go 1.25.8; GOTOOLCHAIN=local)

Not related to my change, but I can raise a PR with a fix. Let me do it in a separate branch.

We just merged #1158, pls rebase and let's see if this gets fixed 🙏

@taraspos

This comment was marked as resolved.

@taraspos taraspos force-pushed the taras/aws-codecommit branch 2 times, most recently from 5ba3c17 to 328d851 Compare April 1, 2026 11:06
Copy link
Copy Markdown
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

Started the review, will continue tomorrow 👌

Comment thread auth/aws/provider.go Outdated
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
@taraspos taraspos force-pushed the taras/aws-codecommit branch from 94eb047 to 9ee13fc Compare April 13, 2026 12:49
@matheuscscp
Copy link
Copy Markdown
Member

Integration tests are running:

@taraspos
Copy link
Copy Markdown
Contributor Author

taraspos commented Apr 13, 2026

I just found that I forgot to add "codecommit:ListTagsForResource" to the readme, so it might fail because of that 🤔 (unless GHA role have more permissions than the documented ones)

Signed-off-by: Taras <9948629+taraspos@users.noreply.github.com>
@taraspos taraspos force-pushed the taras/aws-codecommit branch from 58a2a91 to 8e83249 Compare April 13, 2026 13:16
@matheuscscp
Copy link
Copy Markdown
Member

I suppose the fix you just pushed should fix this?

https://github.com/fluxcd/pkg/actions/runs/24345069351/job/71083589019

@taraspos
Copy link
Copy Markdown
Contributor Author

taraspos commented Apr 13, 2026

I suppose the fix you just pushed should fix this?

https://github.com/fluxcd/pkg/actions/runs/24345069351/job/71083589019

My fix just updates required permissions in the readme; however, I suspect that you might need to update the IAM role in the AWS account itself in some other way (manually, maybe? or some internal Terraform code).

@taraspos
Copy link
Copy Markdown
Contributor Author

I guess permissions need to be updated in the same way, as they were previously updated here:

@matheuscscp
Copy link
Copy Markdown
Member

I guess permissions need to be updated in the same way, as they were previously updated here:

Cool, I added codecommit:ListTagsForResource to the role used in the GHA workflow and retriggered. Let's see

@taraspos
Copy link
Copy Markdown
Contributor Author

taraspos commented Apr 13, 2026

I guess permissions need to be updated in the same way, as they were previously updated here:

Cool, I added codecommit:ListTagsForResource to the role used in the GHA workflow and retriggered. Let's see

It's not only that one, all of these are needed for integration test to succeed:

                "codecommit:CreateRepository",
                "codecommit:DeleteRepository",
                "codecommit:GetRepository",
                "codecommit:GitPull",
                "codecommit:GitPush",
                "codecommit:ListTagsForResource",
                "codecommit:TagResource",
                "codecommit:UntagResource",

@matheuscscp
Copy link
Copy Markdown
Member

I guess permissions need to be updated in the same way, as they were previously updated here:

Cool, I added codecommit:ListTagsForResource to the role used in the GHA workflow and retriggered. Let's see

It's not only that one, all of these are needed for integration test to succeed:

                "codecommit:CreateRepository",
                "codecommit:DeleteRepository",
                "codecommit:GetRepository",
                "codecommit:GitPull",
                "codecommit:GitPush",
                "codecommit:ListTagsForResource",
                "codecommit:TagResource",
                "codecommit:UntagResource",

Cool, added all of these and retriggered 🤞

@matheuscscp
Copy link
Copy Markdown
Member

The AWS and Azure tests passed! GCP is timing out, but I think it's a generalized issue, the test running from main is probably also going to timeout:

https://github.com/fluxcd/pkg/actions/runs/24342753764/job/71101490831

Might be some GCP issue.

Copy link
Copy Markdown
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

Thanks very much, @taraspos! Very nice contribution!

@stefanprodan stefanprodan added area/git Git and SSH related issues and pull requests area/security Security related issues and pull requests labels Apr 13, 2026
@taraspos
Copy link
Copy Markdown
Contributor Author

taraspos commented Apr 13, 2026

Thanks! I will look into raising source-controller (and other) PR soon!

@matheuscscp
Copy link
Copy Markdown
Member

Thanks! I will look into raising source-controller (and other PR) soon!

And image-automation-controller :) Everything SC does, IAC has to do as well

Copy link
Copy Markdown
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

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

LGTM

@stefanprodan stefanprodan merged commit 214331e into fluxcd:main Apr 13, 2026
16 checks passed
@stefanprodan
Copy link
Copy Markdown
Member

@taraspos we'll let you know here when we'll release the packages, then you can do SC first.

@matheuscscp
Copy link
Copy Markdown
Member

@taraspos auth/v0.41.0 is tagged 🚀

@taraspos taraspos deleted the taras/aws-codecommit branch April 14, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/git Git and SSH related issues and pull requests area/security Security related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants