feat: Add support for sandbox diagnostic log (#245)

* feat: Add support for sandbox diagnostic log

* fix: Normalize and prioritise sandbox violations

* fix: Code review fixes
This commit is contained in:
Abhisek Datta
2026-05-12 18:11:18 +05:30
committed by GitHub
parent 00fd6d2a9c
commit d993d57e3d
11 changed files with 830 additions and 60 deletions
+9 -1
View File
@@ -8,6 +8,7 @@ import (
"fmt"
"os"
"os/exec"
"time"
"github.com/safedep/dry/log"
"github.com/safedep/pmg/sandbox"
@@ -17,6 +18,9 @@ type seatbeltSandbox struct {
translator *seatbeltPolicyTranslator
tempProfilePath string
cleanupCompleted bool
policyName string
logTag string
startedAt time.Time
}
func newSeatbeltSandbox() (*seatbeltSandbox, error) {
@@ -38,7 +42,11 @@ func (s *seatbeltSandbox) Execute(ctx context.Context, cmd *exec.Cmd, policy *sa
}
// Log pattern referred in sandbox.md as debugging guidance
log.Debugf("MacOS Seatbelt sandbox log tag: %s", s.translator.LogTag())
s.logTag = s.translator.LogTag()
s.policyName = policy.Name
s.startedAt = time.Now()
log.Debugf("MacOS Seatbelt sandbox log tag: %s", s.logTag)
tmpFile, err := os.CreateTemp("", "pmg-sandbox-*.sb")
if err != nil {