Installation
Installing the SAF CLI
Installation via NPM
The SAF CLI can be installed and kept up to date using npm, which is included with most versions of NodeJS.
npm install -g @mitre/safUpdate via NPM
To update the SAF CLI with npm:
npm update -g @mitre/safInstallation via Brew
The SAF CLI can be installed and kept up to date using brew.
brew install mitre/saf/saf-cliUpdate via Brew
To update the SAF CLI with brew:
brew upgrade mitre/saf/saf-cliInstallation via Docker
On Linux and Mac:
The docker command below can be used to run the SAF CLI one time, where arguments contains the command and flags you want to run. For ex: --version or view summary -i hdf-results.json.
docker run -it -v$(pwd):/share mitre/saf <arguments>To run the SAF CLI with a persistent shell for one or more commands, use the following, then run each full command. For ex: saf --version or saf view summary -i hdf-results.json. You can change the entrypoint you wish to use. For example, run with --entrypoint sh to open in a shell terminal. If the specified entrypoint is not found, try using the path such as --entrypoint /bin/bash.
docker run --rm -it --entrypoint bash -v$(pwd):/share mitre/safOn Windows:
The docker command below can be used to run the SAF CLI one time, where arguments contains the command and flags you want to run. For ex: --version or view summary -i hdf-results.json.
docker run -it -v%cd%:/share mitre/saf <arguments>To run the SAF CLI with a persistent shell for one or more commands, use the following, then run each full command. For ex: saf --version or saf view summary -i hdf-results.json. You can change the entrypoint you wish to use. For example, run with --entrypoint sh to open in a shell terminal. If the specified entrypoint is not found, try using the path such as --entrypoint /bin/bash.
docker run --rm -it --entrypoint sh -v%cd%:/share mitre/safNOTE:
Remember to use Docker CLI flags as necessary to run the various subcommands.
For example, to run the emasser configure subcommand, you need to pass in a volume that contains your certificates and where you can store the resultant .env. Furthermore, you need to pass in flags for enabling the pseudo-TTY and interactivity.
docker run -it -v "$(pwd)":/share mitre/saf emasser configureOther commands might not require the -i or -t flags and instead only need a bind-mounted volume, such as a file based convert.
docker run --rm -v "$(pwd)":/share mitre/saf convert -i test/sample_data/trivy/sample_input_report/trivy-image_golang-1.12-alpine_sample.json -o test.jsonOther flags exist to open up network ports or pass through environment variables so make sure to use whichever ones are required to successfully run a command.
Update via Docker
To update the SAF CLI with docker:
docker pull mitre/saf:latest
Installation via Windows Installer
To install the latest release of the SAF CLI on Windows, download and run the most recent installer for your system architecture from the Releases 🌬️ page.
Update via Windows Installer
To update the SAF CLI on Windows, uninstall any existing version from your system and then download and run the most recent installer for your system architecture from the Releases 🌬️ page.