<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Command-Line on MyVar.dev</title><link>https://gibbok.github.io/myvar/tags/command-line/</link><description>Recent content in Command-Line on MyVar.dev</description><generator>Hugo</generator><language>en-US</language><lastBuildDate>Tue, 17 Mar 2026 20:42:51 +0000</lastBuildDate><atom:link href="https://gibbok.github.io/myvar/tags/command-line/index.xml" rel="self" type="application/rss+xml"/><item><title>macOS's Command-Line Sandboxing Tool: sandbox-exec</title><link>https://gibbok.github.io/myvar/macos/macoss-command-line-sandboxing-tool-sandbox-exec/</link><pubDate>Tue, 17 Mar 2026 20:42:51 +0000</pubDate><guid>https://gibbok.github.io/myvar/macos/macoss-command-line-sandboxing-tool-sandbox-exec/</guid><description>&lt;h3 id="overview"&gt;Overview&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;sandbox-exec&lt;/code&gt; is a built-in macOS command-line utility that enables users to execute applications within a secure, isolated sandboxed environment. It restricts an application&amp;rsquo;s access to system resources to only what is explicitly permitted, minimizing potential damage from malicious code or unintended behavior.&lt;/p&gt;
&lt;h3 id="key-insights"&gt;Key Insights&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Native macOS Utility:&lt;/strong&gt; &lt;code&gt;sandbox-exec&lt;/code&gt; is a core macOS tool for process isolation.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Profile-Driven:&lt;/strong&gt; Sandboxing behavior is defined by a &lt;strong&gt;sandbox profile&lt;/strong&gt; (&lt;code&gt;.sb&lt;/code&gt; file) using a Scheme-like (LISP dialect) syntax.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Explicit Control:&lt;/strong&gt; Users define precise rules for file, network, and process access.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Two Core Approaches:&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Deny by Default:&lt;/strong&gt; Most secure, permits only explicitly allowed operations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Allow by Default:&lt;/strong&gt; More permissive, denies only explicitly forbidden operations.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Debugging Tools:&lt;/strong&gt; &lt;code&gt;Console.app&lt;/code&gt; and &lt;code&gt;log stream&lt;/code&gt; are crucial for identifying sandbox violations.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Power User Tool:&lt;/strong&gt; While Apple encourages App Sandbox for developers, &lt;code&gt;sandbox-exec&lt;/code&gt; offers granular control for security-conscious users and testing environments.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Limitations:&lt;/strong&gt; It lacks a GUI, requires iterative testing, and is considered deprecated for formal application development in favor of App Sandbox.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id="technical-details"&gt;Technical Details&lt;/h3&gt;
&lt;h4 id="benefits-of-application-sandboxing"&gt;Benefits of Application Sandboxing&lt;/h4&gt;
&lt;p&gt;Implementing application sandboxing provides significant security and control advantages:&lt;/p&gt;</description></item></channel></rss>