Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eab_profile_subject_check #202

Open
DMBrosig opened this issue Feb 6, 2025 · 6 comments
Open

eab_profile_subject_check #202

DMBrosig opened this issue Feb 6, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@DMBrosig
Copy link

DMBrosig commented Feb 6, 2025

Hi,

in V0.36 with EAB against MS-AD config like example

"linux":
{
"hmac": "xxxx",
"cahandler":
{
"template_name": "WebserverACME",
"subject":
{
"commonName": "*",
"organizationName": "blabla",
"organizationalUnitName": "blabla",
"countryName": "DE",
"stateOrProvinceName": "Mecklenburg-Vorpommern",
"localityName": "blabla"
}
}
}
}

bring error

Helper.eab_profile_subject_check() failed for: ['commonName', 'organizationName', 'organizationalUnitName', 'countryName', 'stateOrProvinceName', 'localityName']

../tools/eab_chk.py -c acme_srv.cfg show everything is fine. The template_name was taken from config file, subject data not.

What's wrong?

Best regards
Dirk

@grindsa grindsa added the bug Something isn't working label Feb 6, 2025
@grindsa
Copy link
Owner

grindsa commented Feb 6, 2025

Hi Dirk,

can you please enable debug mode (debug = True in acme_srv.cfg) replace the issue and share the debug log?

If you prefer to share via Email please send it [email protected]

Thx G.

@DMBrosig
Copy link
Author

DMBrosig commented Feb 6, 2025

Hi G.

debug was on, log to syslog...

Feb 6 09:37:10 HOTacme bash[23702]: EABhandler.eab_kid_get() ended with: linux
Feb 6 09:37:10 HOTacme bash[23702]: EABhandler._eab_profile_get() ended with: True
Feb 6 09:37:10 HOTacme bash[23702]: Helper.eab_profile_string_check(): string: key: template_name, value: WebserverACME
Feb 6 09:37:10 HOTacme bash[23702]: Helper.eab_profile_string_check(): ignore string attribute: key: template_name value: WebserverACME
Feb 6 09:37:10 HOTacme bash[23702]: Helper.eab_profile_string_check() ended
Feb 6 09:37:10 HOTacme bash[23702]: Helper.eab_profile_subject_check()
Feb 6 09:37:10 HOTacme bash[23702]: Helper.csr_subject_get()
Feb 6 09:37:10 HOTacme bash[23702]: Helper.cert_load()
Feb 6 09:37:10 HOTacme bash[23702]: Helper.b64_url_recode()
Feb 6 09:37:10 HOTacme bash[23702]: Helper.build_pem_file()
Feb 6 09:37:10 HOTacme bash[23702]: Helper.csr_subject_get() ended
Feb 6 09:37:10 HOTacme bash[23702]: Helper.eab_profile_subject_check() failed for: ['commonName', 'organizationName', 'organizationalUnitName', 'countryName', 'stateOrProvinceName', 'localityName']
Feb 6 09:37:10 HOTacme bash[23702]: Helper.eab_profile_subject_check() ended with: Profile subject check failed
Feb 6 09:37:10 HOTacme bash[23702]: Helper.header_info_lookup(template)
Feb 6 09:37:10 HOTacme bash[23702]: Helper.header_info_get()

Is this enough?

BR Dirk

@grindsa
Copy link
Owner

grindsa commented Feb 6, 2025

Thx .. this is helpful.

Another question: what is the subject of the CSR? Can you send me the output of openssl req -text -noout -in <csr.pem>?

/G.

@DMBrosig
Copy link
Author

DMBrosig commented Feb 6, 2025

It is complete empty without alternative name.

Certificate Request:
Data:
Version: 1 (0x0)
Subject:
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (4096 bit)
Modulus:
00:ca:55:19:ea:12:56:84:13:ae:30:27:61:0e:0c:...
Exponent: 65537 (0x10001)
Attributes:
Requested Extensions:
X509v3 Subject Alternative Name:
DNS:name.domain.de
Signature Algorithm: sha256WithRSAEncryption
Signature Value:
26:fd:7e:0f:f2:2c:d0:d4:6c:97:25:25:70:45:6b:6a:31:c4:...
/Dirk

@grindsa
Copy link
Owner

grindsa commented Feb 6, 2025

Thank you once again. The reason for the failed check is that your EAB profile mandates the presence of certain subject attributes (such as O, OU, L, C), which are missing in your CSR.

Perhaps the description of the subject-profiling feature needs improvement. The main aim of this feature is not to set subject attributes (as modifying a CSR would break the signature, which is impossible for transit devices like acme2certifier) but rather to check the attributes from a submitted CSR against pre-defined values from your profile file.

It seems you would like to enforce certain attributes to be set in the certificate. If this is the case, I suggest doing this via a template on the CA server itself.

Or did I misunderstand your intention?

Best regards, G.

@DMBrosig
Copy link
Author

DMBrosig commented Feb 6, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants