Skip to content

Commit

Permalink
Version 2.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiospizzi committed Nov 8, 2019
1 parent f7ff0ee commit abb65af
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 9 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is mainly based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## 2.8.1 - 2019-11-08

* Fixed: Spelling of Add-CertificatePrivateKeyPermission command
* Fixed: Add missing FriendlyName parameter

## 2.8.0 - 2019-11-08

* Added: Cmdlets to get and modify certificate private key permission
Expand Down
4 changes: 2 additions & 2 deletions SecurityFever.Library/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.8.0")]
[assembly: AssemblyFileVersion("2.8.0")]
[assembly: AssemblyVersion("2.8.1")]
[assembly: AssemblyFileVersion("2.8.1")]
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@
None.
.EXAMPLE
PS C:\> Add-CertificatePermission -Thumbprint '10E6862E31114CD86C5CD3E675ED45F4CA6DF8A0 -Identity 'User' -Right 'Read'
PS C:\> Add-CertificatePrivateKeyPermission -Thumbprint '10E6862E31114CD86C5CD3E675ED45F4CA6DF8A0 -Identity 'User' -Right 'Read'
Set read permission on the specified certificate private key.
.EXAMPLE
PS C:\> Add-CertificatePermission -Thumbprint '10E6862E31114CD86C5CD3E675ED45F4CA6DF8A0 -Identity 'NT SERVICE\MSSQL$INST01'
PS C:\> Add-CertificatePrivateKeyPermission -Thumbprint '10E6862E31114CD86C5CD3E675ED45F4CA6DF8A0 -Identity 'NT SERVICE\MSSQL$INST01'
Set full control permission on the specified certificate private key
for the SQL service account.
.LINK
https://github.com/claudiospizzi/SecurityFever
#>
function Add-CertificatePrivateKeyPremission
function Add-CertificatePrivateKeyPermission
{
[CmdletBinding(SupportsShouldProcess = $true)]
param
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
System.Security.AccessControl.FileSystemAccessRule. Access control entries.
.EXAMPLE
PS C:\> Get-CertificatePermission -Thumbprint '10E6862E31114CD86C5CD3E675ED45F4CA6DF8A0
PS C:\> Get-CertificatePrivateKeyPermission -Thumbprint '10E6862E31114CD86C5CD3E675ED45F4CA6DF8A0
Get the certificate private key permissions.
.LINK
https://github.com/claudiospizzi/SecurityFever
#>
function Get-CertificatePermission
function Get-CertificatePrivateKeyPermission
{
[CmdletBinding()]
[OutputType([System.Security.AccessControl.FileSystemAccessRule])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ function New-DomainSignedCertificate
[System.String[]]
$IPAddress,

# Optional firendly name to set on the imported certificate.
[Parameter(Mandatory = $false)]
[System.String]
$FriendlyName,

# Specify the key usage extensions.
[Parameter(Mandatory = $false)]
[ValidateSet('ServerAuthentication', 'ClientAuthentication')]
Expand Down Expand Up @@ -116,6 +121,12 @@ function New-DomainSignedCertificate
$openSslCmd = Get-CommandPath -Name 'openssl.exe' -WarningMessage 'Download OpenSSL for Windows from https://slproweb.com/products/Win32OpenSSL.html'
}

# If the friendly name wasn't specified, use the subject
if (-not $PSBoundParameters.ContainsKey('FriendlyName'))
{
$FriendlyName = $Subject
}

# Append subject to the dns name or ip address
if ($Subject -match '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$')
{
Expand Down Expand Up @@ -334,8 +345,10 @@ function New-DomainSignedCertificate
}


# Finally, get the certificate object and return it to the pipeline
# Finally, update the friendly name, get the certificate object and
# return it to the pipeline
$certificate = Get-Item -Path "Cert:\LocalMachine\My\$thumbprint"
$certificate.FriendlyName = $FriendlyName
Write-Output $certificate
}
}
Expand Down
2 changes: 1 addition & 1 deletion SecurityFever/SecurityFever.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
RootModule = 'SecurityFever.psm1'

# Version number of this module.
ModuleVersion = '2.8.0'
ModuleVersion = '2.8.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down

0 comments on commit abb65af

Please sign in to comment.