mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: Add opt-in support for proxy CA cert installation (#318)
* feat: Add opt-in support for proxy CA cert installation * fix: Code review fixes * fix: Code review fixes * fix: Code review fixes * fix: Code review fixes * fix: Code review fixes * docs: Add limitation for MacOS MDM script
This commit is contained in:
@@ -15,7 +15,9 @@ import (
|
||||
"github.com/safedep/pmg/internal/audit"
|
||||
"github.com/safedep/pmg/internal/ui"
|
||||
"github.com/safedep/pmg/internal/version"
|
||||
"github.com/safedep/pmg/proxy/certmanager"
|
||||
"github.com/safedep/pmg/sandbox/platform"
|
||||
"github.com/safedep/pmg/truststore"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -143,6 +145,26 @@ func executeSetupInfo() error {
|
||||
|
||||
ui.PrintInfoSection("Sandbox", sandboxEntries)
|
||||
|
||||
// Certificate Authority section
|
||||
caStatus, _ := certmanager.InspectCA(cfg.ConfigDir())
|
||||
caUser, caSystem, _ := truststore.Status(certmanager.CACommonName)
|
||||
caStatus.UserTrusted, caStatus.SystemTrusted = caUser, caSystem
|
||||
|
||||
caEntries := make(map[string]string)
|
||||
caEntries["Installed"] = strconv.FormatBool(caStatus.KeyPresent && caStatus.CertPresent)
|
||||
caScope := "none"
|
||||
if caStatus.SystemTrusted {
|
||||
caScope = "system"
|
||||
} else if caStatus.UserTrusted {
|
||||
caScope = "user"
|
||||
}
|
||||
caEntries["Trust Scope"] = caScope
|
||||
if caStatus.CertPresent {
|
||||
caEntries["Expires"] = caStatus.NotAfter.Format("2006-01-02")
|
||||
caEntries["Fingerprint"] = caStatus.Fingerprint
|
||||
}
|
||||
ui.PrintInfoSection("Certificate Authority", caEntries)
|
||||
|
||||
if cfg.Config.Cloud.Enabled {
|
||||
cloudEntries := make(map[string]string)
|
||||
cloudEntries["Enabled"] = "true"
|
||||
|
||||
Reference in New Issue
Block a user