-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add CA Search functionality for the windows cert store (#5115)
This PR adds a new field for searching the windows Certificate Store for CA certificates. When specifying a value in the `ca_certs_match` field, the following locations are searched: - Trusted Root Certification Authorities - Third-Party Root Certification Authorities - Intermediate Certification Authorities Based on user input, the first matching certificate from subject in the list, from each location, is added to the certificate pool. If no certificates can be found an error is reported. Example usage: ```text tls { cert_store: "WindowsLocalMachine" cert_match_by: "Subject" cert_match: "client001" ca_certs_match: ["CA1","CA2"] timeout: 3s } ``` Additional Notes: Test scripts have been added to add and remove the test CA certificate, and existing windows certificates have been updated as they were expired. Signed-off-by: Colin Sullivan <colin@luxantsolutions.com>
- Loading branch information
Showing
11 changed files
with
179 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
7 changes: 5 additions & 2 deletions
7
test/configs/certs/tlsauth/certstore/delete-cert-from-store.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
$issuer="Synadia Communications Inc." | ||
Get-ChildItem Cert:\CurrentUser\My | Where-Object {$_.Issuer -match $issuer} | Remove-Item | ||
$issuer="NATS CA" | ||
Get-ChildItem Cert:\CurrentUser\My | Where-Object {$_.Issuer -match $issuer} | Remove-Item | ||
Get-ChildItem Cert:\CurrentUser\CA| Where-Object {$_.Issuer -match $issuer} | Remove-Item | ||
Get-ChildItem Cert:\CurrentUser\AuthRoot | Where-Object {$_.Issuer -match $issuer} | Remove-Item | ||
Get-ChildItem Cert:\CurrentUser\Root | Where-Object {$_.Issuer -match $issuer} | Remove-Item |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
$fileLocale = $PSScriptRoot + "\ca.p12" | ||
$Pass = ConvertTo-SecureString -String 's3cr3t' -Force -AsPlainText | ||
$User = "whatever" | ||
$Cred = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $Pass | ||
Import-PfxCertificate -FilePath $filelocale -CertStoreLocation Cert:\CurrentUser\My -Password $Cred.Password | ||
#Import-PfxCertificate -FilePath $filelocale -CertStoreLocation Cert:\LocalMachine\Root -Password $Cred.Password | ||
# TODO? Move to trusted enterprise? Requires some fingerprint parsing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.