irulescan
irulescan
is a tool to scan iRules for unexpected/unsafe expressions that may have undesirable effects like double substitution.
irulescan
would not exist without tclscan.
Usage
It is easiest to use the irulescan container to scan any irules.
By default the container will scan any .tcl
and .irule
file within the /scandir
folder of the container.
Here is an example:
docker run -it --rm -v $PWD/tests/basic:/scandir simonkowallik/irulescan
---
/dangerous.tcl: |
WARNING: Unquoted expr at `1` in `expr 1 + $one`
WARNING: Unquoted expr at `+` in `expr 1 + $one`
DANGEROUS: Dangerous unquoted expr at `$one` in `expr 1 + $one`
/ok.tcl: |
/warning.tcl: |
WARNING: Unquoted expr at `1` in `expr 1 + 1`
WARNING: Unquoted expr at `+` in `expr 1 + 1`
WARNING: Unquoted expr at `1` in `expr 1 + 1`
Scanning a single file:
docker run -it --rm -v $PWD/tests/tcl/catch.tcl:/scandir/catch.tcl simonkowallik/irulescan
---
/catch.tcl: |
WARNING: Unquoted expr at `1` in `expr 1`
WARNING: Unquoted expr at `2` in `expr 2`
Invoking irulescan directly:
docker run -it --rm simonkowallik/irulescan irulescan