certificates
certificates copied to clipboard
[Bug]: using admin commands fails if root ca has name constraints
Steps to Reproduce
- create a root CA with name constraints permitted: DNS:example.com
- run
step ca init --root=CA.pem --key=CA.key - open ~/.step/config/ca.json, delete provisioners and add
"enableAdmin": truetoauthority - start
step-ca- enter a password for first provisioner
- on a second terminal, run
step ca provisioner add acme --type ACME- when asked for admin name/subject, provide
stepand the password entered while startingstep-ca
- when asked for admin name/subject, provide
Your Environment
- OS - ubuntu 20.04
step-caVersion - Smallstep CA/0.20.0
Expected Behavior
add the provisioner
Actual Behavior
adminHandler.authorizeToken; error verifying x5c certificate chain in token: x509: a root or intermediate certificate is not authorized to sign for this name: DNS name "step" is not permitted by any constraint
Additional Context
A solution for the problem would be to ask for the subject in the CreateAdmin command in the "Create first admin" section (authority/authority.go:584)
When I manually change it in the source code to [email protected] (which apparently fulfills the name constraint), the command succeeds.
Contributing
Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
A temporary workaround here would be to use the default PKI when starting up the CA. Then create a new admin using step ca admin add, and use a name permitted by the desired name constraints. Then replace the PKI with the desired one.