Skip to main content

Quick start for developers

Install the Vulnara CLI, sign in, start a scan from your terminal, then gate your CI builds with the Vulnara GitHub Action.

This guide takes you from nothing to a scan started from your terminal, and then to a GitHub workflow that fails the build when a scan finds something serious. You need a Vulnara account and a team with at least one repository imported. If you have neither, start with the quick start for security teams, which connects GitHub from the web app.

Scan from your terminal

  1. Install the CLI

    The CLI is a single binary called vulnara, for Linux (x86_64), macOS (Apple silicon and Intel) and Windows (x86_64). The download page offers the build for your system and its install command. On Linux:

    sh
    mkdir -p ~/.local/bin
    curl -fsSL https://cdn.vulnara.io/vulnara-cli/latest/vulnara-cli_Linux_x86_64.tar.gz | tar xz -C ~/.local/bin vulnara
    ~/.local/bin/vulnara add_to_path

    This puts it in ~/.local/bin, a folder you own, so vulnara -u can update it without sudo. Open a new terminal afterwards. For macOS and Windows, see CLI. Then, optionally, turn on completion:

    sh
    vulnara completion bash && source ~/.bashrc
  2. Sign in

    sh
    vulnara login

    Your browser opens the CLI Authentication page. Sign in if you are asked to, then choose Authenticate CLI. The CLI waits up to 3 minutes for the browser to hand it your session, and stores it under ~/.config/vulnara/. After that, commands refresh the session on their own.

    vulnara login needs a browser on the same machine. On a server or in CI, use a service account instead (see below).

  3. Pick a team

    Every command runs against one team. The team id is the team name shown in the web app's account menu. Save it once:

    sh
    vulnara set_default_tenant --tenant my-team

    To run a single command against another team, add --tenant other-team to it.

  4. List your repositories

    sh
    vulnara repositories --limit 20

    The response is JSON. Note the id of the repository you want to scan. Add --search <text> to narrow the list, or --output repos.json to write the raw JSON to a file.

  5. Start a scan

    You scan for a category, such as SAST, SCA, SECRETS or PII, and Vulnara starts every scanner serving it that your team may run, as the scan form in the web app does. List the categories your team may use, then start a scan for one:

    sh
    vulnara scan_categories
    vulnara start_repository_category_scan --repositoryId <repository-id> --category SECRETS --branch main

    What each category looks for is described in Scan categories.

    Leave out --branch to scan every branch. For a private repository, add --gitTokenId <token-id>. The scan appears under Scan History in the web app, and its findings in Vulnerabilities when it finishes.

Starting a scan needs the EDITOR role in the team. See start_repository_category_scan for every flag.

Gate CI with the GitHub Action

  1. Check the repository in Vulnara

    The repository must already be imported, with the same owner name as on GitHub, and it must be enabled. See Repositories.

  2. Create a service account

    A team ADMIN does this. In the web app, open Access & Security, then Service Accounts, and choose Create Service Account. Give it a Name and an Expires At date.

    Vulnara shows the secret once. Copy it before you close the dialog. The name shown in the list, which Copy name copies, is the service account username.

  3. Store the credentials in GitHub

    In your GitHub repository settings, add:

    • VULNARA_SERVICE_ACCOUNT: an Actions variable holding the service account username.
    • VULNARA_TOKEN: an Actions secret holding the secret you copied.
  4. Add the workflow

    Create .github/workflows/vulnara-scan.yml:

    yaml
    name: Vulnara Scan
    on:
      push:
        branches: [main]
      pull_request:
    
    jobs:
      scan:
        runs-on: ubuntu-latest
        steps:
          - uses: theorigamicorporation/vulnara-action@v1
            with:
              service-account: ${{ vars.VULNARA_SERVICE_ACCOUNT }}
              token: ${{ secrets.VULNARA_TOKEN }}
              tenant: my-team
              scan-tools: <scanner-id>
              fail-on: high

    scan-tools takes one or more scanner ids, separated by commas. fail-on: high fails the job on High or Critical findings. The branch defaults to the one that triggered the workflow. For a private repository, add git-token-id.

  5. Push and read the result

    Commit the file and push. The job starts one scan per scanner, waits for them to finish, and writes a job summary with the findings per severity and a link to each scan in Vulnara. The job fails when the highest severity reaches fail-on.

Good to know

  • A CLI command that gets an error back from the API still exits with status 0. In scripts, read the output rather than relying on the exit code.
  • The CLI stores its session and any service account file under ~/.config/vulnara/, readable by other users of the machine. On a shared host, restrict those files yourself.
  • To use the CLI in CI instead of the action, write the service account to ~/.config/vulnara/sa/service_account.json as {"username": "...", "password": "..."}. The CLI picks it up without vulnara login.
  • The action runs on Linux runners only, and waits for the whole scan. Its wait-timeout (default 1800 seconds) applies to each scan, so several scanners take longer.
  • Every input and output of the action is listed in the GitHub Action reference.

Next steps