nanodac CLI
Manage nano detections as version-controlled YAML with @nano-rs/dac-cli — validate, test, diff, and sync detection rules from your terminal or CI
Use @nano-rs/dac-cli (nanodac) to validate, test, and sync detection rules from your terminal or CI. Keep rules as YAML files in a Git repository to review changes and track their history.
npx @nano-rs/dac-cli initWhy detection-as-code
Manage detections in Git to record each change and its rationale, review it in a pull request, and revert it with git revert. New rules land in staging; promote them to alerting after an analyst validates them.
The UI rule editor records an audit log but has no review gate or easy rollback.
Install
# Global — puts `nanodac` on your PATH
npm install -g @nano-rs/dac-cli
# …or run any command without installing
npx @nano-rs/dac-cli <command>Quick start
# Scaffold a detections repo (config + detections/)
nanodac init
# Point nanodac.config.yaml at your deployment, then set the key
export NANOSIEM_API_KEY="your-api-key"
# Author a detection under detections/, then:
nanodac validate # local checks: required fields, MITRE ids, cron, lookback
nanodac test detections/brute_force_ssh.yaml # preview matches on real data
nanodac diff # what would change on the deployment
nanodac sync --dry-run # preview the sync plan
nanodac sync # push to nanoDetection file format
YAML frontmatter (metadata) followed by the nPL query body. Queries use OCSF 1.9 field paths:
---
title: brute_force_ssh
description: Detects SSH brute force from a single source IP
severity: high
mode: staging
detection_mode: scheduled
schedule: "*/5 * * * *"
lookback: 15m
mitre_tactics: TA0006
mitre_techniques: T1110
ai_triage_hints:
ignore_when: ["Source IP is a known security scanner"]
suspicious_when: ["Multiple usernames targeted from same IP"]
---
// Failed logons (OCSF Authentication 3002, status Failure) from Linux auditd
metadata.log_source="linux_auditd" class_uid=3002 status_id=2
| stats count() as attempts by src_endpoint.ip
| where attempts > 10
| risk score=70 entity=src_endpoint.ip factor="SSH brute force"CI/CD
Run nanodac validate on pull requests and nanodac sync on merge to main from your CI system. New rules deploy in staging until an analyst promotes them. The companion MCP server (@nano-rs/dac-mcp-server) lets a coding agent author and sync detections for you.
nanodac init doesn't scaffold a CI workflow. The nanodac repository ships a GitHub Action and example workflows to copy; see CI with GitHub Actions.
Troubleshoot
Need help with these checks? Contact support with the affected deployment, request ID and time with timezone.
A remote command lacks permission
Check the API key's explicit permission list against Setup → API key permissions. validate runs locally without a key. Testing and sync need the permissions described in Quick start.
No CI workflow appears after initialization
nanodac init does not scaffold one. Copy the action and example workflows described in CI with GitHub Actions.
What's next
- Detection-as-Code overview — the full workflow, file format, and CLI reference
- Setup — reference repos, the MCP server, and agent instructions
- Authoring detections — first end-to-end detection walkthrough
nano-connect CLI
Generate local collectors with the Bash nano-connect client, issue a per-source ingest token for each, and verify that events land under the right source
nano-investigator MCP
Turn Claude Code or any MCP client into a SOC analyst workstation with @nano-rs/investigator-mcp-server: search, triage and hunt in plain language.