Skip to content

[AKS] az aks create/update: Add parameter --custom-ca-trust-certificates for custom CA trust certificates#31107

Merged
yanzhudd merged 13 commits intoAzure:devfrom
UtheMan:mikolaj/custom-ca-ga-cli
Apr 10, 2025
Merged

[AKS] az aks create/update: Add parameter --custom-ca-trust-certificates for custom CA trust certificates#31107
yanzhudd merged 13 commits intoAzure:devfrom
UtheMan:mikolaj/custom-ca-ga-cli

Conversation

@UtheMan
Copy link
Contributor

@UtheMan UtheMan commented Mar 21, 2025

Related command

  • az aks create
  • az aks update

Description

Adds --custom-ca-trust-certificates option to enable users to pass custom CAs to their AKS nodes using GA CLI

Testing Guide

History Notes

[AKS] az aks create: Add --custom-ca-trust-certificates parameter to support custom CA trust feature
[AKS] az aks nodepool add: Add --custom-ca-trust-certificates parameter to support custom CA trust feature


This checklist is used to make sure that common guidelines for a pull request are followed.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 21, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️2018-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2019-03-01-hybrid
️✔️3.12
️✔️3.9
️✔️2020-09-01-hybrid
️✔️3.12
️✔️3.9
️✔️latest
️✔️3.12
️✔️3.9

@azure-client-tools-bot-prd
Copy link

Hi @UtheMan,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@azure-client-tools-bot-prd
Copy link

azure-client-tools-bot-prd bot commented Mar 21, 2025

⚠️AzureCLI-BreakingChangeTest
⚠️acs
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter custom_ca_trust_certificates
⚠️ 1006 - ParaAdd aks update cmd aks update added parameter custom_ca_trust_certificates

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 21, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@UtheMan UtheMan changed the title feat: add custom ca certificates to GA CLI [AKS] az aks create/az aks update: Add Custom CA Trust certificates option --custom-ca-trust-certificates Mar 21, 2025
Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

LGTM

Queued live test to validate the change, test passed!

Please fix failed style checks.

/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/_consts.py:227:1: E302 expected 2 blank lines, found 1
/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/_validators.py:838:1: E302 expected 2 blank lines, found 1
/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/_validators.py:843:86: W292 no newline at end of file
/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py:8078:1: W293 blank line contains whitespace
/mnt/vss/_work/1/s/src/azure-cli/azure/cli/command_modules/acs/managed_cluster_decorator.py:8093:18: W291 trailing whitespace

FumingZhang
FumingZhang previously approved these changes Mar 24, 2025
Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

LGTM

@FumingZhang
Copy link
Member

Requeued the live test, test passed!

  • test_aks_create_add_nodepool_with_custom_ca_trust_certificates

FumingZhang
FumingZhang previously approved these changes Mar 24, 2025
@yanzhudd yanzhudd changed the title [AKS] az aks create/az aks update: Add Custom CA Trust certificates option --custom-ca-trust-certificates [AKS] az aks create/update: Add Custom CA Trust certificates option --custom-ca-trust-certificates Mar 24, 2025
"scaleSetPriority": "Regular", "scaleSetEvictionPolicy": "Delete", "spotMaxPrice":
-1.0, "nodeTaints": [], "enableEncryptionAtHost": false, "enableUltraSSD": false,
"enableFIPS": false, "name": "c000003"}], "linuxProfile": {"adminUsername":
"azureuser", "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCL1KGP0wR222Ot/MECoGTmP+Owj+jxfcN8NCbI+FvQ7lYWGmUIgYMCzbLj0+aJAfcjLDT68yM9nEW4w9mK5i99P2va1jCnrh1l5UcstSm38x210xUJE7F0zJRAc8yZ1saYBfdEKZxuwm392AukQHXVxkF2WyZty3J/26m7xYuA7UkLCTAspLCegVO7rqf1mlfANnbFSsx/mq5daLtDEsfYJP49voLhIvrtOvG1iKREtUJ6mDWYtMdj3nZFwJlpPk/8zYsi+9RBNZTiYOpHuvWuVrZ3fHBWDgJAi2A8guDDHdmMJuNXQOuMQFg1jmZI7CB1W4k2ctq22ALPoQ3+upPH
Copy link
Contributor

Choose a reason for hiding this comment

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

They may be scanned as potential secrets, so please replace them with fake ones (refer to this PR: https://github.com/Azure/azure-cli/pull/29951/files).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @yanzhudd , do you mean the SSH public key? Or the certificates from line 113?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I modified the recording to remove the certificates, please let me know if this works @yanzhudd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually this makes the CI checks fail, I reverted the commit for now. The certs passed in the input are dummy fake ones.
@FumingZhang do you maybe know how this should be handled? AKS-RP validation requires valid certificates to be sent in input so if we modify the recording that we compare everything to, it would fail correct?

Copy link
Member

Choose a reason for hiding this comment

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

Actually you can replace the value in recording files, in replay mode, the request won't be sent to ARM/AKS RP, so it's safe to put in any value you want there.

But the problem is, the property is defined with type bytearray and in that case, the value must be base64 encoded, even though I set the literal value to testcert, the encoded value dGVzdGNlcnQ= still looks like a cred and I’m not sure it could pass the test.

See example in latest commit #972a888 in branch fuming/ca-fix-test-0325

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is it okay to leave the test certs as is in this case? Or should they be changed? Not sure what the best way to address this is @FumingZhang / @yanzhudd

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @FumingZhang / @yanzhudd / @yonzhan I used Fuming's suggestion for test data formatting, could you please take another look and let me know if this works? Thanks!

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 25, 2025

Please fix CI issues

@UtheMan UtheMan force-pushed the mikolaj/custom-ca-ga-cli branch from 1518bdd to 284e9dc Compare March 25, 2025 02:44
@UtheMan
Copy link
Contributor Author

UtheMan commented Apr 9, 2025

@yonzhan / @yanzhudd could you please take a look and help with merging? Thanks for your assistance!

@yanzhudd
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@yanzhudd yanzhudd changed the title [AKS] az aks create/update: Add Custom CA Trust certificates option --custom-ca-trust-certificates [AKS] az aks create/update: Add parameter --custom-ca-trust-certificates for custom CA trust certificates Apr 10, 2025
@yanzhudd yanzhudd merged commit 07c9e1c into Azure:dev Apr 10, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants