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

Error retreiving certificate templates as part of running audit #13

Open
ssparkgit opened this issue Nov 16, 2021 · 4 comments
Open

Error retreiving certificate templates as part of running audit #13

ssparkgit opened this issue Nov 16, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@ssparkgit
Copy link

ssparkgit commented Nov 16, 2021

When invoking PKIAudit it pulls back my CA information but after the misconfiguration section I get this error.

New-Object : Exception calling ".ctor" with "1" argument(s): "An invalid dn syntax has been specified.
"
At C:\temp\PSPKIAudit-main\PSPKI\3.7.2\Server\Get-CertificateTemplate.ps1:67 char:48
+ ... ach-Object {New-Object PKI.CertificateTemplates.CertificateTemplate $ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

I have made sure that 'Get-CertificateTemplate' pulls results within powershell. I have the AD and CS tools installed and imported running this on a Windows 2016 server.

@KStieers
Copy link

KStieers commented Nov 9, 2022

I'm seeing the same thing... did you ever get it figured out?

@devonbowers
Copy link

Same issue

@leechristensen
Copy link
Member

leechristensen commented Jun 22, 2023

Pinging @Crypt32 since it appears to be an issue in PSPKI dependency. Can easily be reproduced by creating a template with a slash in the name. PSPKI is failing on this line:

https://github.com/PKISolutions/PSPKI/blob/5f8ba9e0b195857294dd8bde4e2da6e716cbd956/PSPKI/Server/Get-CertificateTemplate.ps1#L67

I'm wondering too if LDAP escaping (e.g., for commas, slashes) in the CN may be the issue with #9 and #21 as well. See section 2.4 here for the situations where LDAP escaping may occur in the DNs

@Crypt32
Copy link

Crypt32 commented Jun 22, 2023

@leechristensen can you log a bug in PSPKI repo?

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

5 participants