Configuration Files

Configure Oculum's behavior with configuration files, profiles, and environment variables. Settings apply to all CLI commands and the VS Code extension.

Config File Location

Oculum looks for configuration in this order (first found wins):

  1. .oculum.yaml (recommended)
  2. .oculum.yml
  3. oculum.config.json
  4. .oculumrc

Place the config file in your project root.


Basic Configuration

YAML Format (Recommended)

# .oculum.yaml
version: 1

depth: local
failOn: none
format: terminal
quiet: false
verbose: false

ignore:
  - "**/*.test.ts"
  - "**/*.spec.ts"
  - "__tests__/**"

include: []  # Empty means scan all

profiles: {}
watch: {}
suppressions: {}

JSON Format

{
  "depth": "local",
  "failOn": "none",
  "format": "terminal",
  "quiet": false,
  "verbose": false,
  "ignore": [
    "**/*.test.ts",
    "**/*.spec.ts"
  ],
  "include": [],
  "profiles": {},
  "watch": {},
  "suppressions": {}
}

Configuration Options

Scan Options

OptionTypeDefaultDescription
depthstringlocalDefault scan depth: local, verified, deep
failOnstringnoneExit 1 on severity: critical, high, medium, low, none
formatstringterminalOutput format: terminal, json, sarif, markdown
outputstring-Write output to this file path
quietbooleanfalseMinimal output
verbosebooleanfalseDebug output

File Patterns

OptionTypeDefaultDescription
ignorestring[][]Glob patterns to ignore
includestring[][]Only scan files matching these patterns

Profiles

Profiles let you save different configurations for different use cases.

Defining Profiles

# .oculum.yaml
depth: local

profiles:
  ci:
    depth: verified
    format: sarif
    output: results.sarif
    quiet: true
    failOn: high

  audit:
    depth: deep
    format: json
    output: audit-report.json

  quick:
    depth: local
    ignore:
      - "**/*.test.ts"
      - "**/*.spec.ts"

  pr:
    depth: local
    failOn: critical
    incremental: true

Using Profiles

oculum scan -p ci
oculum scan -p audit
oculum scan -p quick
oculum scan -p pr

Priority Order

When options conflict:

  1. CLI flags (highest priority)
  2. Profile settings
  3. Project config file
  4. Built-in defaults (lowest priority)
# Profile says quiet: true, but CLI overrides
oculum scan -p ci --verbose

Watch Options

Configure watch mode defaults:

# .oculum.yaml
watch:
  debounce: 500
  cooldown: 10
  clear: true
OptionTypeDefaultDescription
debouncenumber500Milliseconds to wait after last change
cooldownnumber10Minimum seconds between scans
clearbooleanfalseClear console before each scan

Suppressions

Configure finding suppressions in config:

# .oculum.yaml
suppressions:
  # Rule-based suppressions (by category)
  rules:
    - category: hardcoded_secret
      reason: "Test fixtures"
      paths:
        - "**/*.test.ts"
        - "__tests__/**"

    - category: high_entropy_string
      reason: "UUIDs in constants"
      paths:
        - "**/constants.ts"

  # Finding-based suppressions (by hash)
  findings:
    - hash: "a1b2c3d4e5f67890"
      file: "src/api/auth.ts"
      line: 42
      reason: "False positive - static config"
      expires: "2026-06-01"
      suppressedBy: "developer@example.com"

See Suppressing Findings for details.


Environment Variables

VariableDescription
OCULUM_API_KEYAPI key for authentication

CI/CD Example

# GitHub Actions
env:
  OCULUM_API_KEY: ${{ secrets.OCULUM_API_KEY }}

steps:
  - run: oculum scan --depth verified

Environment variables override config file settings for authentication.


Example Configurations

Basic Project

# .oculum.yaml
version: 1

ignore:
  - "**/*.test.ts"
  - "**/*.spec.ts"
  - "__tests__/**"

Monorepo

# .oculum.yaml
version: 1

include:
  - "packages/api/src/**"
  - "packages/web/src/**"

ignore:
  - "**/__tests__/**"
  - "**/fixtures/**"

profiles:
  api:
    include:
      - "packages/api/src/**"

  web:
    include:
      - "packages/web/src/**"

Full CI Setup

# .oculum.yaml
version: 1

depth: local

profiles:
  ci:
    depth: verified
    format: sarif
    output: results.sarif
    failOn: high
    quiet: true

  pr:
    depth: local
    failOn: critical
    incremental: true

  audit:
    depth: deep
    format: json
    output: audit.json

ignore:
  - "**/*.test.ts"
  - "**/*.spec.ts"
  - "**/__mocks__/**"
  - "**/__tests__/**"

Security-Focused

# .oculum.yaml
version: 1

depth: verified
failOn: high

# Focus on high-risk areas
include:
  - "**/api/**"
  - "**/auth/**"
  - "**/middleware/**"
  - "**/*.env*"

# Suppress known false positives
suppressions:
  rules:
    - category: sensitive_url
      reason: "Dev URLs in config"
      paths:
        - "**/config.dev.ts"

VS Code Extension

The VS Code extension reads the same config file. Add VS Code-specific settings:

# .oculum.yaml
vscode:
  scanDepth: verified
  autoScanOnSave: true
  severityThreshold: medium

Or use VS Code settings:

{
  "oculum.scanDepth": "verified",
  "oculum.autoScanOnSave": true
}

.oculumignore

For gitignore-style patterns, create .oculumignore:

# Test files
**/*.test.ts
**/*.spec.ts
__tests__/

# Build output
dist/
build/
.next/

# Generated code
generated/
*.generated.ts

This is loaded in addition to config file ignore patterns.


Configuration Precedence

  1. CLI flags
  2. Environment variables (for auth)
  3. Profile settings (if -p specified)
  4. Project config file (.oculum.yaml)
  5. .oculumignore file
  6. Built-in defaults

Validating Configuration

Check your config is valid:

oculum scan --verbose

This shows which config file is loaded and what settings are applied.


Related