Skip to main content

Module scanner

Module scanner 

Source
Expand description

Scanner traits and configuration for the detection layer (L5).

This module provides file-system oriented scanning interfaces:

  • Scanner trait for scanning files and directories
  • ContentScanner trait for content-based scanning
  • ScannerConfig for common scanner configuration

Structs§

ScannerConfig
Common configuration shared by all scanners.

Constants§

MAX_FILE_SIZE
Maximum size, in bytes, of a single file the scanner will read into memory.

Traits§

ContentScanner
Extended trait for scanners that support content-based scanning.
Scanner
Core trait for all security scanners.

Functions§

oversize_file_finding
Builds a fail-loud diagnostic finding for a file skipped because it exceeded the size cap.
read_to_string_capped
Reads a file into a String, refusing files larger than MAX_FILE_SIZE.
read_to_string_capped_with_limit
Reads a file into a String, refusing to allocate for files larger than limit bytes.

Type Aliases§

ProgressCallback
Type alias for progress callback function. Called each time a file is scanned to report progress. Uses Arc to allow cloning and sharing across threads.