Add macOS support for local package analysis#1128
Open
dsoni-affirm wants to merge 1 commit intoossf:mainfrom
Open
Add macOS support for local package analysis#1128dsoni-affirm wants to merge 1 commit intoossf:mainfrom
dsoni-affirm wants to merge 1 commit intoossf:mainfrom
Conversation
Docker Desktop's LinuxKit VM lacks several Linux-specific features needed by the analysis pipeline (findmnt, overlay fs whiteouts, gVisor/runsc, crun memfd). This adds automatic macOS detection that: - Uses Docker named volumes instead of host bind mounts (pivot_root compat) - Forces vfs storage driver for podman (overlay not supported) - Replaces gVisor runsc with runc via a shim script - Disables seccomp for nested containers (runc requirement in Docker Desktop) - Makes strace log parsing non-fatal so dynamic analysis returns partial results (status, stdout/stderr, DNS) when gVisor logs are unavailable - Fixes macOS-incompatible commands (findmnt, realpath -m, rmdir flags) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Add macOS Support for Local Package Analysis
Problem
Package Analysis currently only works on Linux for local analysis. Developers on macOS cannot run the analysis
pipeline locally because of several platform-specific incompatibilities:
entirely on macOS.
run_analysis.sh script to fail.
This means any contributor using macOS has to either spin up a Linux VM manually or push to CI for every change,
significantly slowing down the development feedback loop.
Solution
This PR adds macOS detection and compatibility shims so that run_analysis.sh and the Go analysis code gracefully
degrade on macOS while preserving full functionality on Linux.
Shell script changes (scripts/run_analysis.sh)
the broken crun.
Go analysis changes (internal/dynamicanalysis/analysis.go)
opened or parsed (which always happens with runc since it doesn't produce strace logs like gVisor), the analysis now
returns partial results containing DNS data and stdout/stderr.
full strace data is unavailable.
Trade-offs
connections, command execution) is unavailable. Only DNS queries, stdout, and stderr are captured.
runc.
longer. Subsequent runs use the cached binary.
Testing
availability checks)