Subject order and missing DC attributes when signing intermediate CA with smallstep (Microsoft CA compatibility issue)
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Accessibilité débutants
- 35/100
- Type d'issue
- Bug
- Clarté
- À clarifier
- Activité
- Calme
- Stack technique
- go
- Domaine
- cryptography, security
Piste de recherche
Start by reproducing the issue with the shown step certificate sign command, the intermediate CA CSR, and the custom template using .Insecure.CR.Subject. Compare the subject order and extensions in the CSR and issued certificate, then inspect the certificate-signing and template handling paths. Done means determining whether CSR subject order can be preserved and documenting or correcting the behavior without breaking the existing subject override.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Hello!
- Vote on this issue by adding a 👍 reaction
- If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)
Issue details
Hi everyone,
I’m currently trying to use a smallstep root CA to sign a Microsoft Windows CA as a subordinate CA, but I’m running into issues with the subject field handling.
Here’s my setup:
I created a CSR for the Microsoft CA.
Then I signed it using my smallstep root CA with:
step certificate sign \ --profile intermediate-ca \ intermediate-ms.csr \ /etc/step-ca/certs/root_ca.crt \ /etc/step-ca/secrets/root_ca_key
Initially, the resulting certificate was missing required extensions like:
CDP (CRL Distribution Point)
AIA (Authority Information Access)
So I created a custom template:
{ "subject": {{ toJson .Insecure.CR.Subject }}, "sans": {{ toJson .SANs }}, "issuingCertificateURL": "http://xxx/root.crt", {{- if typeIs "*rsa.PublicKey" .Insecure.CR.PublicKey }} "keyUsage": ["keyEncipherment", "digitalSignature"], {{- else }} "keyUsage": ["digitalSignature"], {{- end }} "extKeyUsage": ["serverAuth", "clientAuth"], "basicConstraints": { "isCA": true, "maxPathLen": 0 }, "crlDistributionPoints": [ "http://xxx/root.crl" ] }
With this template, the extensions are now correct and accepted.
However, I’m facing a new issue with the subject:
In my CSR (.req), the subject looks like this:
CN=abc, DC=def, DC=ghi
When I use:
"subject": {{ toJson .Insecure.CR.Subject }}
the subject in the issued certificate becomes:
DC=ghi, DC=def, CN=abc
→ so all attributes are present, but the order is reversed.
If I instead use:
"subject": {{ toJson .Subject }}
then the resulting certificate only contains:
CN=abc
which makes sense because the template overrides the subject and only includes the CN.
Problem:
Microsoft CA seems to reject the certificate when the subject order is changed, even though the same attributes are present.
According to the documentation and discussions (e.g. issue #718), I expected .Insecure.CR.Subject to preserve the subject exactly as defined in the CSR — including the order — but that does not seem to be the case.
Questions:
Is the reordering of subject attributes when using .Insecure.CR.Subject expected behavior?
Is there any way to preserve the exact original subject order from the CSR?
Has anyone successfully used smallstep to sign a Microsoft subordinate CA certificate without running into this issue?
Any help would be greatly appreciated — I’m currently stuck on this.
Thanks!
Why is this needed?
The .Insecure.CR.Subject Option in templates doesn't work like it should.
- Langage dominant
- Go
- Étoiles
- 4.3k
- Forks
- 320
- Merge moyen
- 2 j 3 h
- PR mergées (30 j)
- 11
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de smallstep/cli
-
[Bug]: `Match exec "step ssh check-host %h"` causes SSH connections through ProxyJump to hangOuvertebug needs triage
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement needs triage
Difficulté 4/5 3-5 jours Accessibilité débutants 32/100
Les mainteneurs répondent en général sous 1 jour
-
enhancement needs triage
Difficulté 3/5 1-2 jours Accessibilité débutants 57/100
smallstep/cli#1713 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
build s390x and riscv64 binariesOuverteenhancement needs triage
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
smallstep/cli#1710 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: `step ca provisioner add --ca-config` requires `--ca-url`/`--root` even for purely local/offline editsPeut-être pris @vulragrag-star l’a pris il y a 51 jours. Ouvertebug needs triage
Difficulté 4/5 3-5 jours Accessibilité débutants 20/100
smallstep/cli#1705 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de smallstep/cli
Issues similaires
-
agent-butler-finding bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
jordansmall/spindrift#6414 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
Icinga/icinga-kubernetes#294 ·
Les mainteneurs répondent en général sous 4 jours
-
Cluster details: the Control Plane version field has a different border color than its icon boxOuvertekind/design sig/ui
Difficulté 1/5 Moins d'une heure Accessibilité débutants 92/100
kubermatic/dashboard#8449 ·
Les mainteneurs répondent en général sous 1 jour
-
needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
cli/cli#14962 · 1 commentaire · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
Model conformance driftOuvertemodel-drift
Difficulté 2/5 1-3 heures Accessibilité débutants 66/100
Les mainteneurs répondent en général sous 1 jour