chore(mdm): skip macOS TCC-protected directories#108
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a macOS TCC (Transparency, Consent, and Control) “skipper” to avoid walking into well-known TCC-protected directories during filesystem discovery, preventing permission prompts when the agent runs without Full Disk Access.
Changes:
- Added a new
internal/tccpackage that identifies TCC-protected paths (darwin) and behaves as a no-op on non-darwin platforms, with unit tests for both. - Plumbed the skipper into directory-walking detectors (Node/Python project discovery and
.npmrcdiscovery) and wired it into both community scan and enterprise telemetry flows. - Added
--include-tcc-protectedCLI flag to opt into scanning these protected directories, plus logging of configured skip candidates and “hit” paths encountered during walks.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/telemetry/telemetry.go | Creates and wires a TCC skipper into enterprise telemetry scans; logs skip candidates and encountered skips. |
| internal/scan/scanner.go | Creates and wires a TCC skipper into community scans; warns when skipping protected dirs and logs encountered skips. |
| internal/tcc/tcc.go | Implements the platform-agnostic skipper API (ShouldSkip/Candidates/Hits) and hit tracking. |
| internal/tcc/tcc_darwin.go | Defines macOS-specific protected home-relative paths and absolute-prefix rules (e.g., Time Machine). |
| internal/tcc/tcc_other.go | Provides non-darwin no-op implementations for protected paths/prefixes. |
| internal/tcc/tcc_darwin_test.go | Adds darwin-specific unit tests for skip behavior, nil-safety, and candidate ordering. |
| internal/tcc/tcc_other_test.go | Adds non-darwin unit test verifying skipper is a no-op. |
| internal/detector/nodeproject.go | Skips TCC-protected directories during Node project discovery walk. |
| internal/detector/pythonproject.go | Skips TCC-protected directories during Python project discovery walk. |
| internal/detector/nodescan.go | Skips TCC-protected directories during enterprise Node project discovery phase. |
| internal/detector/configaudit/npmrc.go | Skips TCC-protected directories during .npmrc discovery walk. |
| internal/cli/cli.go | Adds --include-tcc-protected flag to config, parsing, and help text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
|
e19b1da to
fffc18d
Compare
fffc18d to
40d782c
Compare
ashishkurmi
approved these changes
May 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Type of change
Testing
./stepsecurity-dev-machine-guard --verbose./stepsecurity-dev-machine-guard --json | python3 -m json.toolmake lintmake testRelated Issues