Skip to content

Commit 95e7b28

Browse files
[PPSC-579] docs(auth): establish JWT as primary authentication method (#99)
Update all CLI documentation to position JWT authentication (client_id/client_secret) as the recommended first-class method, with Basic auth (API token/tenant ID) as legacy fallback. - Lead Quick Start and auth sections with JWT examples - Reference VIPR External API screen for obtaining credentials - Update all CI platform examples to use JWT env vars - Add "Recommended"/"Legacy" labels throughout - Note that tenant ID is auto-extracted from JWT token - Fix pre-existing yamllint issues (document-start, indentation) - Fix markdownlint MD036 (use headings instead of bold emphasis)
1 parent 2f5ab89 commit 95e7b28

13 files changed

Lines changed: 209 additions & 114 deletions

README.md

Lines changed: 59 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,19 @@ cyclonedx-cli validate --input-file armis-cli-linux-amd64.tar.gz.sbom.cdx.json
216216

217217
### Set up authentication
218218

219+
#### JWT Authentication (Recommended)
220+
221+
Obtain client credentials from the VIPR external API screen in the Armis platform.
222+
223+
```bash
224+
export ARMIS_CLIENT_ID="your-client-id"
225+
export ARMIS_CLIENT_SECRET="your-client-secret"
226+
```
227+
228+
The tenant ID is automatically extracted from the JWT token — no need to set it separately.
229+
230+
#### Basic Authentication (Legacy)
231+
219232
```bash
220233
export ARMIS_API_TOKEN="your-api-token"
221234
export ARMIS_TENANT_ID="your-tenant-id"
@@ -242,8 +255,11 @@ armis-cli scan image nginx:latest
242255
#### Authentication Flags
243256

244257
```text
245-
--token string API token for authentication (env: ARMIS_API_TOKEN)
246-
--tenant-id string Tenant identifier (env: ARMIS_TENANT_ID)
258+
--client-id string Client ID for JWT authentication (env: ARMIS_CLIENT_ID) [recommended]
259+
--client-secret string Client secret for JWT authentication (env: ARMIS_CLIENT_SECRET) [recommended]
260+
--region string Armis cloud region (env: ARMIS_REGION)
261+
--token string API token for Basic authentication (env: ARMIS_API_TOKEN) [legacy]
262+
--tenant-id string Tenant identifier for Basic auth (env: ARMIS_TENANT_ID) [legacy]
247263
```
248264

249265
#### General Flags
@@ -266,38 +282,38 @@ armis-cli scan image nginx:latest
266282
Scans a local directory, creates a tarball, and uploads to Armis Cloud for analysis.
267283

268284
```bash
269-
armis-cli scan repo [path] --tenant-id [tenant-id]
285+
armis-cli scan repo [path]
270286
```
271287

272288
**Size Limit**: 2GB
273289
**Example**:
274290

275291
```bash
276-
armis-cli scan repo ./my-app --tenant-id my-tenant --format json --fail-on HIGH,CRITICAL
292+
armis-cli scan repo ./my-app --format json --fail-on HIGH,CRITICAL
277293

278294
# Generate SBOM and VEX documents
279-
armis-cli scan repo ./my-app --tenant-id my-tenant --sbom --vex
295+
armis-cli scan repo ./my-app --sbom --vex
280296
```
281297

282298
### Scan Container Image
283299

284300
Scans a container image (local or remote) or a tarball.
285301

286302
```bash
287-
armis-cli scan image [image-name] --tenant-id [tenant-id]
288-
armis-cli scan image --tarball [path-to-tarball] --tenant-id [tenant-id]
303+
armis-cli scan image [image-name]
304+
armis-cli scan image --tarball [path-to-tarball]
289305
```
290306

291307
**Size Limit**: 5GB
292308
**Examples**:
293309

294310
```bash
295311
# Scan remote image
296-
armis-cli scan image nginx:latest --tenant-id my-tenant
312+
armis-cli scan image nginx:latest
297313
# Scan local image
298-
armis-cli scan image my-app:v1.0.0 --tenant-id my-tenant
314+
armis-cli scan image my-app:v1.0.0
299315
# Scan tarball
300-
armis-cli scan image --tarball ./image.tar --tenant-id my-tenant
316+
armis-cli scan image --tarball ./image.tar
301317
```
302318

303319
#### Pull Policy
@@ -400,8 +416,10 @@ jobs:
400416

401417
**Required secrets:**
402418

403-
- `api-token`: Armis API token for authentication
404-
- `tenant-id`: Tenant identifier for Armis Cloud
419+
- `api-token`: Armis API token for authentication (legacy — JWT support coming soon)
420+
- `tenant-id`: Tenant identifier for Armis Cloud (legacy — not needed with JWT)
421+
422+
> **Note:** The reusable workflow currently accepts Basic auth secrets. For JWT authentication in CI, set `ARMIS_CLIENT_ID` and `ARMIS_CLIENT_SECRET` as environment variables directly in your workflow steps (see [Manual Installation](#option-3-manual-installation) below).
405423

406424
#### Option 2: GitHub Action
407425

@@ -452,10 +470,10 @@ jobs:
452470
curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash
453471
- name: Scan Repository
454472
env:
455-
ARMIS_API_TOKEN: ${{ secrets.ARMIS_API_TOKEN }}
473+
ARMIS_CLIENT_ID: ${{ secrets.ARMIS_CLIENT_ID }}
474+
ARMIS_CLIENT_SECRET: ${{ secrets.ARMIS_CLIENT_SECRET }}
456475
run: |
457476
armis-cli scan repo . \
458-
--tenant-id "${{ secrets.ARMIS_TENANT_ID }}" \
459477
--format sarif \
460478
--fail-on HIGH,CRITICAL \
461479
> results.sarif
@@ -475,10 +493,10 @@ security-scan:
475493
- apk add --no-cache curl bash
476494
- curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash
477495
script:
478-
- armis-cli scan repo . --tenant-id "$ARMIS_TENANT_ID" --format json --fail-on CRITICAL
496+
- armis-cli scan repo . --format json --fail-on CRITICAL
479497
variables:
480-
ARMIS_API_TOKEN: $ARMIS_API_TOKEN
481-
ARMIS_TENANT_ID: $ARMIS_TENANT_ID
498+
ARMIS_CLIENT_ID: $ARMIS_CLIENT_ID
499+
ARMIS_CLIENT_SECRET: $ARMIS_CLIENT_SECRET
482500
```
483501

484502
### Jenkins
@@ -487,15 +505,15 @@ security-scan:
487505
pipeline {
488506
agent any
489507
environment {
490-
ARMIS_API_TOKEN = credentials('armis-api-token')
491-
ARMIS_TENANT_ID = credentials('armis-tenant-id')
508+
ARMIS_CLIENT_ID = credentials('armis-client-id')
509+
ARMIS_CLIENT_SECRET = credentials('armis-client-secret')
492510
}
493511
stages {
494512
stage('Security Scan') {
495513
steps {
496514
sh '''
497515
curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash
498-
armis-cli scan repo . --tenant-id "$ARMIS_TENANT_ID" --format junit > scan-results.xml
516+
armis-cli scan repo . --format junit > scan-results.xml
499517
'''
500518
junit 'scan-results.xml'
501519
}
@@ -516,9 +534,10 @@ steps:
516534
curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash
517535
displayName: 'Install Armis CLI'
518536
- script: |
519-
armis-cli scan repo . --tenant-id "$(ARMIS_TENANT_ID)" --format junit > $(Build.ArtifactStagingDirectory)/scan-results.xml
537+
armis-cli scan repo . --format junit > $(Build.ArtifactStagingDirectory)/scan-results.xml
520538
env:
521-
ARMIS_API_TOKEN: $(ARMIS_API_TOKEN)
539+
ARMIS_CLIENT_ID: $(ARMIS_CLIENT_ID)
540+
ARMIS_CLIENT_SECRET: $(ARMIS_CLIENT_SECRET)
522541
displayName: 'Run Security Scan'
523542
- task: PublishTestResults@2
524543
inputs:
@@ -543,7 +562,7 @@ jobs:
543562
- run:
544563
name: Run Security Scan
545564
command: |
546-
armis-cli scan repo . --tenant-id "$ARMIS_TENANT_ID" --format json --fail-on HIGH,CRITICAL
565+
armis-cli scan repo . --format json --fail-on HIGH,CRITICAL
547566
workflows:
548567
version: 2
549568
scan:
@@ -563,19 +582,29 @@ pipelines:
563582
script:
564583
- apk add --no-cache curl bash
565584
- curl -sSL https://raw.githubusercontent.com/ArmisSecurity/armis-cli/main/scripts/install.sh | bash
566-
- armis-cli scan repo . --tenant-id "$ARMIS_TENANT_ID" --format json --fail-on CRITICAL
585+
- armis-cli scan repo . --format json --fail-on CRITICAL
567586
```
568587

569588
---
570589

571590
## Environment Variables
572591

573-
**Authentication:**
592+
**JWT Authentication (Recommended):**
593+
594+
| Variable | Description |
595+
|----------|-------------|
596+
| `ARMIS_CLIENT_ID` | Client ID for JWT authentication (from VIPR external API screen) |
597+
| `ARMIS_CLIENT_SECRET` | Client secret for JWT authentication |
598+
| `ARMIS_REGION` | Armis cloud region (equivalent to `--region` flag) |
599+
600+
When using JWT authentication, the tenant ID is automatically extracted from the token.
601+
602+
**Basic Authentication (Legacy):**
574603

575604
| Variable | Description |
576605
|----------|-------------|
577-
| `ARMIS_API_TOKEN` | API token for authentication |
578-
| `ARMIS_TENANT_ID` | Tenant identifier |
606+
| `ARMIS_API_TOKEN` | API token for Basic authentication |
607+
| `ARMIS_TENANT_ID` | Tenant identifier (required only with Basic auth) |
579608

580609
**General:**
581610

@@ -592,8 +621,9 @@ pipelines:
592621
- Repositories: 2GB
593622
- Container Images: 5GB
594623
- **Authentication Security**:
595-
- API tokens should be stored securely and never committed to version control
596-
- Rotate tokens periodically
624+
- Client credentials and API tokens should be stored securely and never committed to version control
625+
- Use JWT authentication (client ID/secret) for production — it supports automatic token refresh and does not require a separate tenant ID
626+
- Rotate credentials periodically
597627
- Credentials are never logged or exposed in output
598628
- **Secure Transport**: All API communication uses HTTPS
599629
- **Automatic Cleanup**: Temporary files are cleaned up after use

0 commit comments

Comments
 (0)