mirror of
https://github.com/safedep/pmg.git
synced 2026-08-03 07:24:09 +02:00
feat: Add post-exec reporting support (#134)
* feat: Add post install reporting support * fix: UI report handling * fix: Duplicate reporting * fix: Show warning on insecure bypass * fix: Proxy event log insecure skip installation * fix: Proxy event log insecure skip installation * fix: Common definition for infer outcome
This commit is contained in:
@@ -23,6 +23,7 @@ const (
|
||||
EventTypeInstallTrustedAllowed EventType = "install_trusted_allowed"
|
||||
EventTypeInstallStarted EventType = "install_started"
|
||||
EventTypeDependencyResolved EventType = "dependency_resolved"
|
||||
EventTypeInstallInsecureBypass EventType = "install_insecure_bypass"
|
||||
EventTypeError EventType = "error"
|
||||
)
|
||||
|
||||
@@ -359,6 +360,21 @@ func LogInstallTrustedAllowed(packageName, version, ecosystem string) {
|
||||
}
|
||||
}
|
||||
|
||||
// LogInstallInsecureBypass logs when an installation skips analysis due to insecure installation mode.
|
||||
func LogInstallInsecureBypass(packageName, version, ecosystem string) {
|
||||
event := Event{
|
||||
EventType: EventTypeInstallInsecureBypass,
|
||||
Message: fmt.Sprintf("Installation bypassed analysis due to insecure installation mode: %s@%s", packageName, version),
|
||||
PackageName: packageName,
|
||||
Version: version,
|
||||
Ecosystem: ecosystem,
|
||||
}
|
||||
|
||||
if err := LogEvent(event); err != nil {
|
||||
log.Warnf("failed to log install insecure bypass event: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
// LogInstallStarted logs when an installation starts
|
||||
func LogInstallStarted(packageManager string, args []string) {
|
||||
event := Event{
|
||||
|
||||
Reference in New Issue
Block a user