violation

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package violation reads App Sandbox violation (deny) records from the macOS unified log (subsystem com.apple.sandbox.reporting, category violation).

Index

Constants

This section is empty.

Variables

View Source
var ErrLogStore = errors.New("unified log store error")

ErrLogStore is returned when the unified log store cannot be queried.

Functions

This section is empty.

Types

type Violation

type Violation struct {
	// Time is when the violation was logged.
	Time time.Time
	// Process and PID identify the offending process (best-effort).
	Process string
	PID     int
	// Operation is the denied sandbox operation, e.g. "network-outbound".
	Operation string
	// Path is the resource the operation targeted, when the message includes one.
	Path string
	// Message is the full composed log message, preserved verbatim.
	Message string
}

A Violation is one App Sandbox denial recorded in the unified log.

func RecentViolations

func RecentViolations(since time.Duration, maxRows int) ([]Violation, error)

RecentViolations returns App Sandbox violations logged within the last since duration, up to maxRows entries (most recent window first). It reads the local unified log store, so it observes violations from any process on the system, not only the current one. A non-positive maxRows uses a default cap.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL