Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,21 @@ jobs:
try { .\scripts\install.ps1 -Version "not-a-version" } catch { $message = $_.Exception.Message }
if ($message -notmatch "Invalid version format") { throw "expected 'Invalid version format' error, got: $message" }

# scripts/enterprise-setup.sh runs on macOS with the stock bash 3.2, so it is
# tested only there. The tests fake armis-cli, curl and sudo and use a temporary HOME.
script-tests-macos:
name: Script tests (macOS)
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7

- name: Install bats and shellcheck
run: brew install bats-core shellcheck

- name: Shellcheck and bats
run: make test-scripts

lint:
uses: ./.github/workflows/reusable-lint.yml

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ completions/
*.log
nohup.out
armis-cli
!test/scripts/stubs/armis-cli
moose
armis
.idea/
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build install clean test lint lint-clean scan help tools coverage release try-fleet
.PHONY: build install clean test test-scripts lint lint-clean scan help tools coverage release try-fleet

BINARY_NAME=armis-cli
BUILD_DIR=bin
Expand All @@ -14,6 +14,7 @@ help:
@echo " install - Install the binary to $(INSTALL_DIR)"
@echo " clean - Remove build artifacts"
@echo " test - Run tests with coverage"
@echo " test-scripts - Run the shell script tests (needs bats and shellcheck; macOS)"
@echo " coverage - Show coverage report"
@echo " lint - Run linters"
@echo " lint-clean - Clear the golangci-lint cache, then run linters"
Expand Down Expand Up @@ -65,6 +66,11 @@ tools:
@echo "Installing dev tools..."
go install gotest.tools/gotestsum@v1.13.0

# scripts/enterprise-setup.sh targets macOS and its stock bash 3.2; run the tests there.
test-scripts:
shellcheck -s bash scripts/enterprise-setup.sh
bats test/scripts

lint:
@echo "Running linters..."
@which golangci-lint > /dev/null || (echo "golangci-lint not installed" && exit 1)
Expand Down
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,18 @@ Download the latest release for your platform from the [releases page](https://g
go install github.com/ArmisSecurity/armis-cli/cmd/armis-cli@latest
```

### Fleet / MDM deployment (macOS)

To roll out armis-cli and the Armis AppSec MCP server to many Macs, run `scripts/enterprise-setup.sh` by hand or from Jamf, Kandji or another MDM. It installs a pinned armis-cli, registers the MCP server in Cursor, VS Code with Copilot, Copilot CLI, Codex, Claude Code, Antigravity and Junie (and JetBrains projects you list), checks the result, and writes a JSON report per machine, user and component.

```bash
ARMIS_CLI_VERSION=1.27.0 ./scripts/enterprise-setup.sh --dry-run # preview
ARMIS_CLI_VERSION=1.27.0 ARMIS_CREDENTIALS_FILE=/var/db/armis/credentials \
sudo -E ./scripts/enterprise-setup.sh --non-interactive # roll out
```

It supports `--dry-run`, `--uninstall`, `--only`/`--skip`, backups of every config it changes, and exit codes 0 (ok), 1 (partial), 2 (verification failed) and 3 (bad arguments or preflight failure). See [docs/ENTERPRISE-DEPLOYMENT.md](docs/ENTERPRISE-DEPLOYMENT.md).

### Verify Installation

After installation, verify that the CLI is working:
Expand Down
245 changes: 245 additions & 0 deletions docs/ENTERPRISE-DEPLOYMENT.md

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions docs/SSO-SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,22 @@ export ARMIS_DEFAULT_AUTH_METHOD="SSO"
export ARMIS_REGION="eu1"
```

To do the whole rollout (CLI, MCP server in every detected editor, and the
variables above) in one step, run `scripts/enterprise-setup.sh` as root from
your MDM (macOS) with `ARMIS_AUTH_MODE=sso`:

```bash
ARMIS_AUTH_MODE="sso" ARMIS_TENANT_ID="acme" ARMIS_CLI_VERSION="1.27.0" \
./scripts/enterprise-setup.sh --non-interactive
```

Pin `ARMIS_CLI_VERSION` so every machine gets the same reviewed release, and set
`ARMIS_INSTALLER_URL` to an internal mirror if endpoints cannot reach GitHub.
The MCP server needs Python 3.11+ on each developer's `PATH`. Use
`ARMIS_SSO_LOGIN=now` to open the sign-in page in the logged-in user's session.
See [ENTERPRISE-DEPLOYMENT.md](ENTERPRISE-DEPLOYMENT.md) for every option, the
report format and uninstall.

The first Armis command a developer runs then opens the browser for sign-in
(they can also run `armis-cli auth login`). The session is shared across
`armis-cli` and the Armis MCP plugins, and tokens refresh silently.
Expand Down
Loading
Loading