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

Least User Privileges #136

Closed
SinnGit opened this issue Jan 15, 2021 · 9 comments
Closed

Least User Privileges #136

SinnGit opened this issue Jan 15, 2021 · 9 comments
Labels
bug Bug. An issue exist in our code. docs This is documentation issue. Doesn't require changes in code. fixed-vNext The item is fixed in development code. Will be available in next release.

Comments

@SinnGit
Copy link

SinnGit commented Jan 15, 2021

Is there any documentation outlining least user privileges for each cmdlet? I'm finding that many tasks fail to execute if the account does not have "issue and manage certificates" rights on the CA. Is there any way to request a certificate from a CA without needing to grant the account full rights to manage the CA? The account already has read/enroll rights to the template in question.

@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 16, 2021

Is there any documentation outlining least user privileges for each cmdlet?

no, there is no such documentation.

I'm finding that many tasks fail to execute if the account does not have "issue and manage certificates" rights on the CA.

which ones? Can you provide specific examples?

@Crypt32 Crypt32 added the docs This is documentation issue. Doesn't require changes in code. label Jan 16, 2021
@SinnGit
Copy link
Author

SinnGit commented Jan 19, 2021

Get-CertificationAuthority returns "IsAccessible"=False which causes any commands leveraging the results returned by this command to fail.

PS C:\Users\> Get-CertificationAuthority -Name $CA

DisplayName                              ComputerName              IsAccessible ServiceStatus Type                     
-----------                              ------------              ------------ ------------- ----                     
IssuingCA03                     Servername...               False        Running       Enterprise Subordinate CA

Get-CATemplate returns an error that the specified certification authority is unavailable.

PS C:\Users\> (get-CATemplate -CertificationAuthority "servername.server.org").Templates | ?{$_.Name -like "*$Template*"}
New-Object : Exception calling ".ctor" with "1" argument(s): "Specified Certification Authority 'IssuingCA03' is unavailable."
At C:\Program Files\WindowsPowerShell\Modules\PSPKI\3.7.2\Server\Get-CATemplate.ps1:14 char:4
+             New-Object PKI.CertificateServices.CATemplate -ArgumentLi ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
    + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand

Submit-CertificateRequest fails with a cryptic 'Server' is a ReadOnly Property error.

PS C:\Users\> Submit-CertificateRequest -path C:\temp\adlds.csr -CertificationAuthority "server.name.org" -Attribute "CertificateTemplate:NDES"
Submit-CertificateRequest : 'Server' is a ReadOnly property.
At line:1 char:1
+ Submit-CertificateRequest -path C:\temp\adlds.csr -CertificationAutho ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [Submit-CertificateRequest], RuntimeException
    + FullyQualifiedErrorId : PropertyAssignmentException,Submit-CertificateRequest

@Crypt32 Crypt32 added the bug Bug. An issue exist in our code. label Jan 20, 2021
@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 20, 2021

It is a bug. There is an unnecessary check for CA admin permission.

Crypt32 added a commit to PKISolutions/pkix.net that referenced this issue Jan 22, 2021
@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 22, 2021

First issue (certificate template reading) is fixed. I'm investigating second issue and will update the issue when fix it.

Crypt32 added a commit that referenced this issue Jan 22, 2021
@Crypt32
Copy link
Collaborator

Crypt32 commented Jan 22, 2021

Both issues are now resolved. Fix will be added to next PSPKI release

@Crypt32 Crypt32 added the fixed-vNext The item is fixed in development code. Will be available in next release. label Jan 22, 2021
@warrenrees
Copy link

Would it be possible to build a pre/beta release module for this? I'm running into this issue and unfortunately don't have access to VS to rebuild the library

@darkrhyes
Copy link

Both issues are now resolved. Fix will be added to next PSPKI release

I see you stated you have fixed the issue I am having here but I don't see a link to get the updated cmdlet. As you may know, there is/was no next PSPKI release yet. The paid support version is still 3.7.2 without this fix in it. Are you able to send me the fixed versions?

@dje-git
Copy link

dje-git commented Apr 24, 2023

Hi @Crypt32,
I'm also experiencing the error below (in 3.7.2). Is there a new build available I'm not aware of?
Submit-CertificateRequest : 'Server' is a ReadOnly property.

thx for the very handy module and greatly appreciate!

@Crypt32
Copy link
Collaborator

Crypt32 commented Jun 15, 2023

Fixed in v4.0.0

@Crypt32 Crypt32 closed this as completed Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug. An issue exist in our code. docs This is documentation issue. Doesn't require changes in code. fixed-vNext The item is fixed in development code. Will be available in next release.
Projects
None yet
Development

No branches or pull requests

5 participants