Subject order and missing DC attributes when signing intermediate CA with smallstep (Microsoft CA compatibility issue)
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 35/100
- Tipo de issue
- Bug
- Clareza
- Precisa de esclarecimento
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- go
- Domínio
- cryptography, security
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Go
- Estrelas
- 4.3k
- Forks
- 320
- Merge médio
- 2d 3h
- PRs com merge (30d)
- 11
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de smallstep/cli
-
[Bug]: `Match exec "step ssh check-host %h"` causes SSH connections through ProxyJump to hangAbertabug needs triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
Mantenedores costumam responder em até 1 dia
-
enhancement needs triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 32/100
Mantenedores costumam responder em até 1 dia
-
enhancement needs triage
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 57/100
smallstep/cli#1713 · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
enhancement needs triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
smallstep/cli#1710 · 1 comentário · 1 reação ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: `step ca provisioner add --ca-config` requires `--ca-url`/`--root` even for purely local/offline editsTalvez já em andamento @vulragrag-star assumiu há 52 dias. Abertabug needs triage
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 20/100
smallstep/cli#1705 · 1 reação ·
Mantenedores costumam responder em até 1 dia
Todas as issues de smallstep/cli
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
JakeChampion/lang#14392 ·
Mantenedores costumam responder em até 1 dia
-
agent-butler-finding bug
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 84/100
jordansmall/spindrift#6557 ·
Mantenedores costumam responder em até 1 dia
-
[Bug] Custom tool truncation leaves unused stream copies openTalvez já em andamento @OUAO-FRANK assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
Mantenedores costumam responder em até 1 dia
-
[v3] KeyBindingManager calls (Add/Remove) are not converted into a case-insensitive accelerator.KeyAbertaBug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
crmne/hyprmoncfg#114 · 1 comentário ·
Mantenedores costumam responder em até 1 dia