Documentation
¶
Overview ¶
Package tcc identifies macOS TCC (Transparency, Consent, and Control) protected directories so filesystem walks can skip them and avoid triggering system permission prompts on a user's machine.
On non-darwin builds the Skipper is a no-op: ShouldSkip always returns false and Candidates returns nil, so callers can wire it unconditionally.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Enabled ¶
Enabled reports whether the TCC skipper should be active for this run. The override is the resolved tri-state cfg/config value: nil or false to apply the default (skip TCC-protected dirs), true to include them in the scan.
Default behavior is to skip — both community (`scan`) and enterprise (`send-telemetry`) runs avoid TCC-protected paths so the agent never triggers permission prompts. Customers who have granted the agent access (via a PPPC profile pushed by their MDM, or by manually approving "Full Disk Access" in System Settings) flip the bool to `true` to opt those paths back into the scan. See docs/macos-tcc-permissions.md for the configuration recipe.
Types ¶
type Skipper ¶
type Skipper struct {
// contains filtered or unexported fields
}
Skipper matches TCC-protected directories. Build one per scan via New; share across detectors. Hits are tracked so callers can prove from logs which protected paths were actually encountered during the walks.
func New ¶
New builds a Skipper anchored at home. home == "" produces a degraded Skipper that only matches absolute-prefix entries (e.g. Time Machine snapshot mounts) — useful when the agent runs without a console user.
func (*Skipper) Candidates ¶
Candidates returns the exact-match protected paths the Skipper would skip, sorted lexicographically. Useful for surfacing in logs. Returns nil on a nil receiver or on non-darwin builds.
func (*Skipper) Hits ¶
Hits returns the set of TCC-protected paths that were encountered during walks, with the count of times each was matched. Returns nil if nothing was skipped (or on a nil receiver). Safe to call concurrently with ShouldSkip, though callers typically only read after walks complete.
func (*Skipper) LogHits ¶
LogHits emits a single summary line listing the protected paths that were actually encountered during walks. Quiet when nothing was matched (or on a nil receiver). The emit callback decouples this from any specific logger — pass log.Warn (interactive) or log.Debug (daemon) to pick the level. Single source of truth for both community scan and enterprise telemetry.
func (*Skipper) ShouldSkip ¶
ShouldSkip reports whether path is a TCC-protected directory whose walk should be short-circuited. When path equals walkRoot the result is always false: passing --search-dirs ~/Documents is an explicit opt-in, and the walk root must be entered for anything to happen.
Safe to call on a nil receiver (returns false), which is what callers pass when --include-tcc-protected is set.