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

[FIX] Check pKIExpirationPeriod & pKIOverlapPeriod #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AetherBlack
Copy link

It's possible with the following script to generate a Template Certificate without pKIExpirationPeriod & pKIOverlapPeriod properties.

$ADSI = [ADSI]"LDAP://CN=Certificate Templates,CN=Public Key Services,CN=Services,$((Get-ADRootDSE).namingContexts[1])"
$pki = $ADSI.Create("pKICertificateTemplate", "CN=pKIExpirationPeriod ")
$pki.put("msPKI-Certificate-Name-Flag", 1)
$pki.put("pKIExtendedKeyUsage", @("1.3.6.1.5.5.7.3.2"))
$pki.setInfo()

pKIExpirationPeriod

In this case, certipy will crash :

certipy

If you try to do the same thing with the GUI, this will not work :

Protection

This PR aims to check the value of these two properties and set it to zero if there are not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant