reference Flags

--interfile-timeout

Accepted by
opengrep scan, opengrep ci
Value
INT, in seconds
Default
0
See also
--enable-interfile, --interfile-depth, --timeout, taint_interfile

Sets how many seconds a rule may spend on the cross-file taint analysis of --enable-interfile. 0, the default, sets no limit.

The cross-file analysis of a rule spans several files at once and is not bounded by --timeout, which limits the time a rule spends on one file. --interfile-depth limits how many files the analysis brings in.

Examples

A time limit for the cross-file analysis

rule.yaml
rules:  - id: input-to-system    mode: taint    pattern-sources:      - pattern: input(...)    pattern-sinks:      - pattern: os.system(...)    message: input reaches os.system    languages: [python]    severity: ERROR    options:      taint_interfile: true
util.py
import osdef run(cmd):    os.system(cmd)
main.py
from util import runrun(input())
Command and result
$ opengrep scan -q --config rule.yaml --enable-interfile --interfile-timeout 60 --files-with-matches .
util.py