feat: Better source-aware testing (#391)
This commit is contained in:
@@ -13,6 +13,12 @@ Use the `-n` or `--non-interactive` flag:
|
||||
strix -n --target ./app --scan-mode quick
|
||||
```
|
||||
|
||||
For pull-request style CI runs, Strix automatically scopes quick scans to changed files. You can force this behavior and set a base ref explicitly:
|
||||
|
||||
```bash
|
||||
strix -n --target ./app --scan-mode quick --scope-mode diff --diff-base origin/main
|
||||
```
|
||||
|
||||
## Exit Codes
|
||||
|
||||
| Code | Meaning |
|
||||
@@ -78,3 +84,7 @@ jobs:
|
||||
<Note>
|
||||
All CI platforms require Docker access. Ensure your runner has Docker available.
|
||||
</Note>
|
||||
|
||||
<Tip>
|
||||
If diff-scope fails in CI, fetch full git history (for example, `fetch-depth: 0` in GitHub Actions) so merge-base and branch comparison can be resolved.
|
||||
</Tip>
|
||||
|
||||
@@ -18,6 +18,8 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Strix
|
||||
run: curl -sSL https://strix.ai/install | bash
|
||||
@@ -58,3 +60,7 @@ The workflow fails when vulnerabilities are found:
|
||||
<Tip>
|
||||
Use `quick` mode for PRs to keep feedback fast. Schedule `deep` scans nightly.
|
||||
</Tip>
|
||||
|
||||
<Note>
|
||||
For pull_request workflows, Strix automatically uses changed-files diff-scope in CI/headless runs. If diff resolution fails, ensure full history is fetched (`fetch-depth: 0`) or set `--diff-base`.
|
||||
</Note>
|
||||
|
||||
@@ -45,13 +45,21 @@ Strix runs inside a Kali Linux-based Docker container with a comprehensive set o
|
||||
| [js-beautify](https://github.com/beautifier/js-beautify) | JavaScript deobfuscation |
|
||||
| [JSHint](https://jshint.com) | JavaScript code quality tool |
|
||||
|
||||
## Source-Aware Analysis
|
||||
|
||||
| Tool | Description |
|
||||
| ------------------------------------------------------- | --------------------------------------------- |
|
||||
| [Semgrep](https://github.com/semgrep/semgrep) | Fast SAST and custom rule matching |
|
||||
| [ast-grep](https://ast-grep.github.io) | Structural AST/CST-aware code search (`sg`) |
|
||||
| [Tree-sitter](https://tree-sitter.github.io/tree-sitter/) | Syntax tree parsing and symbol extraction (Java/JS/TS/Python/Go/Bash/JSON/YAML grammars pre-configured) |
|
||||
| [Bandit](https://bandit.readthedocs.io) | Python security linter |
|
||||
|
||||
## Secret Detection
|
||||
|
||||
| Tool | Description |
|
||||
| ----------------------------------------------------------- | ------------------------------------- |
|
||||
| [TruffleHog](https://github.com/trufflesecurity/trufflehog) | Find secrets in code and history |
|
||||
| [Semgrep](https://github.com/semgrep/semgrep) | Static analysis for security patterns |
|
||||
| [Bandit](https://bandit.readthedocs.io) | Python security linter |
|
||||
| [Gitleaks](https://github.com/gitleaks/gitleaks) | Detect hardcoded secrets in repositories |
|
||||
|
||||
## Authentication Testing
|
||||
|
||||
@@ -64,7 +72,7 @@ Strix runs inside a Kali Linux-based Docker container with a comprehensive set o
|
||||
|
||||
| Tool | Description |
|
||||
| -------------------------- | ---------------------------------------------- |
|
||||
| [Trivy](https://trivy.dev) | Container and dependency vulnerability scanner |
|
||||
| [Trivy](https://trivy.dev) | Filesystem/container scanning for vulns, misconfigurations, secrets, and licenses |
|
||||
|
||||
## HTTP Proxy
|
||||
|
||||
|
||||
@@ -32,14 +32,18 @@ sqlmap -u "https://example.com/page?id=1"
|
||||
### Code Analysis
|
||||
|
||||
```bash
|
||||
# Search for secrets
|
||||
trufflehog filesystem ./
|
||||
|
||||
# Static analysis
|
||||
# Fast SAST triage
|
||||
semgrep --config auto ./src
|
||||
|
||||
# Grep for patterns
|
||||
grep -r "password" ./
|
||||
# Structural AST search
|
||||
sg scan ./src
|
||||
|
||||
# Secret detection
|
||||
gitleaks detect --source ./
|
||||
trufflehog filesystem ./
|
||||
|
||||
# Supply-chain and misconfiguration checks
|
||||
trivy fs ./
|
||||
```
|
||||
|
||||
### Custom Scripts
|
||||
|
||||
@@ -27,6 +27,14 @@ strix --target <target> [options]
|
||||
Scan depth: `quick`, `standard`, or `deep`.
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="--scope-mode" type="string" default="auto">
|
||||
Code scope mode: `auto` (enable PR diff-scope in CI/headless runs), `diff` (force changed-files scope), or `full` (disable diff-scope).
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="--diff-base" type="string">
|
||||
Target branch or commit to compare against (e.g., `origin/main`). Defaults to the repository's default branch.
|
||||
</ParamField>
|
||||
|
||||
<ParamField path="--non-interactive, -n" type="boolean">
|
||||
Run in headless mode without TUI. Ideal for CI/CD.
|
||||
</ParamField>
|
||||
@@ -50,6 +58,9 @@ strix --target api.example.com --instruction "Focus on IDOR and auth bypass"
|
||||
# CI/CD mode
|
||||
strix -n --target ./ --scan-mode quick
|
||||
|
||||
# Force diff-scope against a specific base ref
|
||||
strix -n --target ./ --scan-mode quick --scope-mode diff --diff-base origin/main
|
||||
|
||||
# Multi-target white-box testing
|
||||
strix -t https://github.com/org/app -t https://staging.example.com
|
||||
```
|
||||
|
||||
@@ -31,6 +31,8 @@ Balanced testing for routine security reviews. Best for:
|
||||
|
||||
**Duration**: 30 minutes to 1 hour
|
||||
|
||||
**White-box behavior**: Uses source-aware mapping and static triage to prioritize dynamic exploit validation paths.
|
||||
|
||||
## Deep
|
||||
|
||||
```bash
|
||||
@@ -44,6 +46,8 @@ Thorough penetration testing. Best for:
|
||||
|
||||
**Duration**: 1-4 hours depending on target complexity
|
||||
|
||||
**White-box behavior**: Runs broad source-aware triage (`semgrep`, AST structural search, secrets, supply-chain checks) and then systematically validates top candidates dynamically.
|
||||
|
||||
<Note>
|
||||
Deep mode is the default. It explores edge cases, chained vulnerabilities, and complex attack paths.
|
||||
</Note>
|
||||
|
||||
Reference in New Issue
Block a user