Skip to content

Conversation

@alexwang0311
Copy link
Contributor

Add support to export ACM certificates to Kubernetes TLS Secrets for ACM private and public certificates.

@ack-prow ack-prow bot requested a review from knottnt November 30, 2025 00:41
@ack-prow ack-prow bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 30, 2025
@ack-prow
Copy link

ack-prow bot commented Nov 30, 2025

Hi @alexwang0311. Thanks for your PR.

I'm waiting for a aws-controllers-k8s member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@alexwang0311 alexwang0311 marked this pull request as draft November 30, 2025 01:31
@ack-prow ack-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2025
@alexwang0311 alexwang0311 marked this pull request as ready for review November 30, 2025 01:31
@ack-prow ack-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2025
@ack-prow ack-prow bot requested review from a-hilaly and rushmash91 November 30, 2025 01:31
@michaelhtm
Copy link
Member

/ok-to-test

@ack-prow ack-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 1, 2025
Copy link
Member

@michaelhtm michaelhtm left a comment

Choose a reason for hiding this comment

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

Thanks @alexwang0311
left a few comments below

@ack-prow
Copy link

ack-prow bot commented Dec 1, 2025

@alexwang0311: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
acm-verify-attribution 4d15d96 link false /test acm-verify-attribution
acm-verify-code-gen 4d15d96 link false /test acm-verify-code-gen

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Member

@michaelhtm michaelhtm left a comment

Choose a reason for hiding this comment

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

Thanks again @alexwang0311
/lgtm

@ack-prow ack-prow bot added the lgtm Indicates that a PR is ready to be merged. label Dec 1, 2025
@ack-prow
Copy link

ack-prow bot commented Dec 1, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alexwang0311, michaelhtm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ack-prow ack-prow bot added the approved label Dec 1, 2025
@ack-prow ack-prow bot merged commit 22a7f2b into aws-controllers-k8s:main Dec 1, 2025
6 of 8 checks passed
"Action": [
"acm-pca:IssueCertificate",
"acm-pca:GetCertificate",
"acm-pca:ListPermissions"

Choose a reason for hiding this comment

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

Why is ListPermissions needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://awscli.amazonaws.com/v2/documentation/api/2.1.30/reference/acm-pca/list-permissions.html

Permissions designate which private CA actions can be performed by an AWS service or entity. In order for ACM to automatically renew private certificates, you must give the ACM service principal all available permissions (IssueCertificate , GetCertificate , and ListPermissions ). Permissions can be assigned with the CreatePermission action, removed with the DeletePermission action, and listed with the ListPermissions action.

"type": "string"
},
"endpoint": {
"endpoint_url": {

Choose a reason for hiding this comment

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

I don't understand why we added allow_unsafe_aws_endpoint_urls? What does this do?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was something added by the latest commit from the code generator repo

func generateRandomString(length int) (string, error) {
const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_+-=[]{}|;:,.<>?"
b := make([]byte, length)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
Copy link

@divyansh-gupta divyansh-gupta Dec 2, 2025

Choose a reason for hiding this comment

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

Thoughts on using crypto/rand.Int()? Something like:

num, err := rand.Int(rand.Reader, big.NewInt(int64(len(charset))))

return nil, errors.New("failed to decrypt PEM block")
}

// NOTE: Algorithms supported for an ACM certificate request include: RSA_2048, EC_prime256v1, EC_secp384r1

Choose a reason for hiding this comment

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

Are there plans to add more algorithms? If so, how do we keep this up to date?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants