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

Exception #1

Closed
xennn opened this issue Jun 18, 2021 · 10 comments · Fixed by #2
Closed

Exception #1

xennn opened this issue Jun 18, 2021 · 10 comments · Fixed by #2

Comments

@xennn
Copy link

xennn commented Jun 18, 2021

Get-AuditCertificateTemplate: C:\git\PSPKIAudit\Code\Invoke-PKIAudit.ps1:101
Line |
101 | $CATemplates = Get-AuditCertificateTemplate @Args
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Exception calling "GetSecurityDescriptor" with "0" argument(s): "Some or all identity references could
| not be translated."

@Crypt32
Copy link

Crypt32 commented Jun 18, 2021

This is a bug in the underlying library, which is already fixed in sources: PKISolutions/pkix.net@73656c5#diff-c03f25716219c8e87ab3cbb2f2c94261bd961fb79487fa708b7b5822aeb8cff9

the root cause of this is that user account who created this template was deleted from AD. And there is a problem when .NET CommonObjectSecurity.GetOwner() throws exception if owner account cannot be resolved, while it handles same case in DACL/SACL. As a temporary workaround (until new PSPKI is released), I can offer compiled updated libraries.

@xennn
Copy link
Author

xennn commented Jun 18, 2021

Thanks for the information. Yes, you are very welcome to make the binaries available.

@Crypt32
Copy link

Crypt32 commented Jun 18, 2021

To all, who face issue with this error, I recommend to update the following files in PowerShell PKI library folder: $PsModulePath\PSPKI\Library, where $PsmodulePath is PSPKI module installation folder. To get module's installation path, just run the following command:

(gmo -li -name pspki).path

ZIP with updated and signed DLLs that resolve this issue: SysadminsLV.PKI.zip

@leechristensen
Copy link
Member

leechristensen commented Jun 18, 2021

@Crypt32 Would you be opposed to us bundling that in a release package on this repo until the next version of PSPKI is released? Thank you so much for addressing the bugs we've seen crop up in PSPKI!

@Crypt32
Copy link

Crypt32 commented Jun 18, 2021

As long as they are properly attributed, then I wouldn't mind if you host them until next release.

@leechristensen
Copy link
Member

Most definitely. You wouldn't by chance be able to build/sign a Windows PowerShell compatible version would you @Crypt32 ? Only able to load those newer libraries on PowerShell Core right now:
image

@Crypt32
Copy link

Crypt32 commented Jun 18, 2021

It does load for me even on PowerShell 3.0. Make sure that you haven't loaded different versions of this library in the current session.

@leechristensen
Copy link
Member

My fault, after diving it deeper it was mark of the web. Apparently PS core ignores that.... O.o...

@leechristensen
Copy link
Member

New version should be merged. @Crypt32 please take a look at the top of the readme for the attribution and let us know if you'd like us to change anything. Thanks again for your help!

@Crypt32
Copy link

Crypt32 commented Jun 22, 2021

Looks ok to me.

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 a pull request may close this issue.

3 participants