Giter VIP home page Giter VIP logo

simbple's Introduction

simbple

This project aims to document the inner workings of Apple's App Sandbox and to provide a way to obtain plaintext sandbox profiles for third-party apps.

Sandboxing for third-party applications is configured using entitlements. Under the hood, these entitlements are turned into a full sandboxing profile by libsandbox. For this, an abstract base profile, containing both SBPL statements and Scheme code, is evaluated, which generates the final ruleset for an app. Unfortunately, only the compiled profile is returned and the plaintext version cannot be audited.

The simbple tool reimplements the profile evaluation process done in libsandbox but outputs correct, human-readable SBPL output. The output can be manually audited, automatically patched, manually modified or simply be compiled to profile bytecode using Stefan Esser's tools.

Compilation

simbple depends on cmake, argp and nlohmann/json. The dependencies can be installed using homebrew:

$ brew tap nlohmann/json
$ brew install cmake nlohmann_json argp-standalone

To build the project

$ mkdir build
$ cd build
$ cmake ../src
$ make

Usage

As input, the simbple tool takes the Container.plist file for the target app. This is done so that the same parameters used during the initial sandbox compilation process can be used and the resulting profiles can be verified to be correct. In case an application does not have the required file, simply launch the app once to generate it. If it's still not there, ensure the application is sandboxed, for example by consulting Activity Monitor.app.

Here is the full command-line interface to the tool:

$ ./simbple --help

Usage: simbple [OPTION...] CONTAINER_METADATA
Evaluate a SBPL (+ Scheme) profile

  -o, --output=FILE          Output file
  -p, --profile=PROFILE      Base profile to evaluate. Defaults to
                             application.sb profile.
      --platforms=PLATFORM   sierra, high_sierra (default)

 Output formats:
      --json                 Output as JSON
      --scheme               Output as SCHEME / SBPL

 Misc options:
      --patch                Patch the output profile to log all statements.
      --verify               Verify semantic correctness of generated results

  -?, --help                 Give this help list
      --usage                Give a short usage message
  -V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.

The output is a simplified SBPL profile that can be analysed, modified and
compiled as is.

To obtain the plaintext sandbox profile for Calculator.app, execute the following command

$ ./simbple ~/Library/Containers/com.apple.calculator/Container.plist

The output can be verified to be correct using the --verify flag. The program exits with a non-zero status code if verification fails.

simbple's People

Contributors

0xbf00 avatar blochberger avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.