Skip to main content

    Filter by idea status

    Filter by product

    629 Ideas

    tibtibSteward *

    Add a "Windows" mode to x509 Certificate pluginReleased

    For now the x509 certificate provide four modes (https, tcp, file and opensslcli), but Windows “MMC” certificates still can’t be check.I propose to add this “custommode”.Many of windows packaged plugins run powershell commands to retrieve informations and the perl side format the output to the standard centreon. For retrieve the MMC certificates informations, we can run the flollowing powershell command :Get-ChildItem -Path 'Cert:\LocalMachine\Remote Desktop' | Select *PSPath : Microsoft.PowerShell.Security\Certificate::LocalMachine\Remote Desktop\57014B6168AD0DF7B10185FCD9D ED51F7D470E17PSParentPath : Microsoft.PowerShell.Security\Certificate::LocalMachine\Remote DesktopPSChildName : 57014B6168AD0DF7B10185FCD9DED51F7D470E17PSDrive : certPSProvider : Microsoft.PowerShell.Security\CertificatePSIsContainer : FalseArchived : FalseExtensions : {System.Security.Cryptography.Oid, System.Security.Cryptography.Oid}FriendlyName :IssuerName : System.Security.Cryptography.X509Certificates.X500DistinguishedNameNotAfter : 28/11/2023 19:07:49NotBefore : 29/05/2023 20:07:49HasPrivateKey : TruePrivateKey : System.Security.Cryptography.RSACryptoServiceProviderPublicKey : System.Security.Cryptography.X509Certificates.PublicKeyRawData : {48, 130, 2, 216...}SerialNumber : 68588A4B2F8BF98B476714E087F0F16ASubjectName : System.Security.Cryptography.X509Certificates.X500DistinguishedNameSignatureAlgorithm : System.Security.Cryptography.OidThumbprint : 57014B6168AD0DF7B10185FCD9DED51F7D470E17Version : 3Handle : 451449296Issuer : CN=VM-2008-R2Subject : CN=VM-2008-R2The path “Cert:\LocalMachine\” contains the same folders like the MMC (with Snap-In “Certificates (Local Computer), For exemple, “My” folder in powershell matches with “Personnal” folder in MMC.  With the following command, we can display all the folders certificates PS C:\Users\Administrateur> Get-ChildItem Cert:\LocalMachine\ | Select PSPathPSPath------Microsoft.PowerShell.Security\Certificate::SmartCardRootMicrosoft.PowerShell.Security\Certificate::AuthRootMicrosoft.PowerShell.Security\Certificate::CAMicrosoft.PowerShell.Security\Certificate::TrustMicrosoft.PowerShell.Security\Certificate::DisallowedMicrosoft.PowerShell.Security\Certificate::MyMicrosoft.PowerShell.Security\Certificate::RootMicrosoft.PowerShell.Security\Certificate::TrustedPeopleMicrosoft.PowerShell.Security\Certificate::TrustedDevicesMicrosoft.PowerShell.Security\Certificate::Remote DesktopMicrosoft.PowerShell.Security\Certificate::TrustedPublisherPlace a filtrer on these folders in the plugin will be very useful. When we have a Certificate object listing, we can filter the property “Issuer” for target the correct one.=> this would be the second filter. Once the certificates parameters retreived, i think it’s easy to evaluate expiration date like others modes with same options (warning-status and critical-status). What do you think about that ?