use sif's json output for automation and integration.
./sif -u https://example.com -apiapi mode outputs json to stdout:
{
"url": "https://example.com",
"results": [
{
"id": "module-id",
"data": {
"module_id": "module-id",
"target": "https://example.com",
"findings": [
{
"url": "https://example.com/.git/HEAD",
"severity": "high",
"evidence": "ref: refs/heads/main",
"extracted": {
"branch": "main"
}
}
]
}
}
]
}the target url that was scanned.
array of module results.
module identifier.
array of security findings from the module.
the specific url where the finding was detected.
severity level: info, low, medium, high, critical
evidence that triggered the finding (matched content, etc).
extracted data from the response (versions, keys, etc).
./sif -u https://example.com -api -am > results.json./sif -u https://example.com -api -am | jq '.results[].data.findings[]'./sif -u https://example.com -api -am | jq '.results[].data.findings[] | select(.severity == "high")'./sif -u https://example.com -api -am | jq -r '.results[].data.findings[].url'- name: run sif scan
run: |
./sif -u ${{ env.TARGET_URL }} -api -am > sif-results.json
- name: check for high severity findings
run: |
HIGH_COUNT=$(jq '[.results[].data.findings[] | select(.severity == "high" or .severity == "critical")] | length' sif-results.json)
if [ "$HIGH_COUNT" -gt 0 ]; then
echo "Found $HIGH_COUNT high/critical severity findings"
exit 1
fisecurity_scan:
script:
- ./sif -u $TARGET_URL -api -am > sif-results.json
- |
if jq -e '.results[].data.findings[] | select(.severity == "critical")' sif-results.json > /dev/null; then
echo "Critical findings detected"
exit 1
fi
artifacts:
paths:
- sif-results.jsonwhen scanning multiple urls, each target outputs a separate json object:
./sif -u https://site1.com,https://site2.com -apioutputs:
{"url":"https://site1.com","results":[...]}
{"url":"https://site2.com","results":[...]}use jq -s to combine into an array:
./sif -u https://site1.com,https://site2.com -api | jq -s '.'- api mode suppresses banner and interactive output
- all output goes to stdout
- errors and warnings still go to stderr
- combine with
-lflag to also save detailed logs