SecDim Sandbox provides Just In Time (JIT) secure coding training labs based on the finding reported by majority of security scanning tool. It can also enrich the reported findings with link to related secure coding exercises.
SecDim Sandbox command-line application provides two main functions:
-
enrich: Parses a SARIF file, enriches each finding with links to SecDim Secure Coding exercises, and outputs an augmented SARIF file.
-
jit: Manages Just-In-Time training games on the SecDim platform by creating or updating a game and adding relevant challenge slugs extracted from a SARIF file.
Both features can be used manually or integrated into CI/CD pipelines.
-
Ensure you have Go (
>=1.20) installed: Go installation docs. -
Clone this repository and navigate to the project root
-
Build the binary:
make build
git clone https://github.com/secdim/sandbox-sarif-parser.git
cd sandbox-sarif-parser
make buildThe compiled binary is bin/sandbox.
Parse and enrich a SARIF file with SecDim Secure Coding labs
sandbox enrich --in <input.sarif> --out <output.sarif> [--tool <tool>]-
--toolis optional - specifysemgrep,snyk, orcodeqlto override auto-detection
Extract challenge slugs from a SARIF file and either create or update a SecDim game
sandbox jit --game-slug <slug> [--new] --in <input.sarif>
[--game-title <title>]
[--game-desc <desc>]
[--game-tags <t1,t2>]
[--game-deps <d1,d2>]
[--game-chals <c1, c2>]
[--game-start <RFC3339>] [--game-end <RFC3339>]
[--filter-by-language] [--tool <tool>]-
Add
--newto create a fresh game (requires title, description, challenges, start/end). -
Omit
--newto patch an existing game (will error if the game does not exist). -
Add
--filter-by-languageto filter challenges based on programming languages detected from the SARIF file. If this flag is not provided, all challenges matching any detected language will be included. We recommend using this flag to ensure the training content is relevant to the codebase. -
--toolis optional - specifysemgrep,snyk, orcodeqlto override auto-detection
Example with language filtering:
sandbox jit --game-slug python-security-training --filter-by-language --in report.sarifIf the SARIF file contains Python vulnerabilities, only Python-related challenges will be added to the game.
SecDim Sandbox supports SARIF files from various security scanning tools:
-
Semgrep - Comprehensive rule parsing with intelligent search strategy:
-
CWE search (highest priority for precise vulnerability matching)
-
Free text search on rule names/descriptions (contextual relevance)
-
OWASP search (broad category coverage as final fallback)
-
-
Snyk Code - Rule-based vulnerability detection with metadata extraction
-
CodeQL - GitHub’s semantic analysis engine with extension-based rules
The tool automatically detects the scanner type based on SARIF structure:
- Driver name patterns (semgrep, snyk code, codeql)
- Rule organization and metadata structure
- Tool-specific SARIF formatting
For SARIF files from other tools (Bandit, ESLint, SonarQube, etc.):
- The system detects them as "unknown tool"
- Falls back to generic parsing using Semgrep-compatible logic
- May still work if the SARIF structure includes standard fields like:
- Rule IDs and descriptions
- CWE tags in properties.tags (format: "CWE-79")
- OWASP tags in properties.tags (format: "OWASP:A03")
Note: You can also explicitly specify the tool with --tool <tool> to override auto-detection. We will add support for more tools over time.
Override defaults via environment variables (flags take precedence):
| Variable | Description |
|---|---|
|
API key for enrichment & game endpoints (required) |
|
Default game slug |
|
Default game title |
|
Default game description |
|
Default game challenges |
|
Default game tags |
|
Default game departments |
|
Default start time |
|
Default end time |
export SECDIM_API_KEY=XYZ
sandbox jit --new --game-slug just-in-time-training
--game-title "Just-In-Time Training"
--game-desc "Exercises based on reported vulnerabilities"
--game-tags Trivial,Easy,Medium,Hard
--game-start 2025-05-06T00:00:00Z
--game-end 2025-06-06T00:00:00Z
--game-chals "xsspy,xssjs"
--in report.sarif
--filter-by-languagesandbox jit --game-slug just-in-time-training --in report.sarif --filter-by-language# For tools not directly supported, the system falls back to generic parsing
sandbox enrich --in bandit-report.sarif --out enriched-bandit.sarif
# You can also explicitly specify a compatible tool format for enrichment
sandbox enrich --in custom-tool.sarif --out enriched-custom.sarif --tool semgrep
# Force Semgrep-style parsing for JIT with unknown tools
sandbox jit --game-slug custom-training --tool semgrep --filter-by-language --in custom-tool.sarifIn your GitHub Actions you can add steps like:
- name: Build
run: make build
- name: Enrich SARIF
run: sandbox enrich --in report.sarif --out enriched_report.sarif
- name: Update JIT Game with Language Filtering
run: |
export SECDIM_API_KEY=${{ secrets.SEC_DIM_API_KEY }}
sandbox jit --game-slug language-specific-training --filter-by-language --in report.sarif