Caching

Caching process is used to speed up the data collection. QScanner currently supports caching only for images. When cache is used, Qscanner checks for the data of a particular image layer. If the data is found, it fetches it from the cache and use it.

QScanner maintains cache data on a per-layer per-scan basis. It also takes care of the parameters that might change the scan data even if they are for the same layer and scan-type.

For example, if the SCA scan was performed for layer-1 and an another scan is now triggered with offline scan, then the scan data is expected to change. QScanner understands this and it triggers a fresh SCA scan for layer-1.

The following cache types are supported.

Type Description
local QScanner creates a local cache database in $USER_CACHE_DIR/qualys/qscanner/.
This path can be overridden by using --cache-dir flag.
For commands associated with local cache cleanup, refer to Local Cache Cleanup section.
nop Indicates not to cache the data. This is the Default option.

To run the cache process, use --cache <cache-type> command. Also to clear the cache, use the clear-cache command. 

Local Cache Cleanup

The following commands are used to clean your local cache.

  • --enable-cache-cleanup
    This flag enables the cleanup of unused cache entries.
  • --cache-cleanup-duration-threshold
    Specify the threshold of cache cleanup duration in seconds. If a cache entry is not used for this duration, QScanner will remove it from the cache database on the next cleanup operation. This will be ignored if --enable-cache-cleanup is 'false'.
    The default value is six (6) months. This means QScanner will remove all cache entries not accessed from the last six (6) months.
  • --cache-cleanup-frequency
    Specify the duration after which QScanner attempts to clean up old unused local cache entries. This ensures that the cache cleanup process is not attempted on each run. This will be ignored if --enable-cache-cleanup is set to 'false'.
    Its default value is one (1) month. This means that QScanner finds out old unused cache entries once in every month. Once such entries are identified based on the value of the --cache-cleanup-duration-threshold flag, they will be removed from the cache database