Skip to content

Plugins ​

Plugins is the security detection core of FlowMind. All scan rules and tag scripts are managed here. The Plugins page has three tabs: Rules (passive scanning), Scan (active scanning), and Tags (request tagging scripts).

Plugins

Overview ​

  • Rule Management: View, create, edit, and delete passive scan rule scripts
  • Scan Management: View, create, edit, and delete active scan rule scripts
  • Tag Scripts: Write Rhai functions to automatically tag requests
  • Hot Reload: Reload scripts with one click, no restart needed
  • Rule Debugging: Select a Flow to test rule output
  • Project Configuration: Enable/disable rules per project

Page Layout ​

The Plugins page has three tabs:

TabDescription
RulesPassive scan scripts (plugins/scanner/passive/)
ScanActive scan scripts (plugins/scanner/active/)
TagsTag scripts

Rules (Passive Scanning) ​

Manage passive scanning rules stored as .rhai files in plugins/scanner/passive/.

Rule List ​

  • Built-in Rules: Compiled into the binary, auto-extracted on first launch, read-only
  • Workspace Rules: User-created, editable, deletable, renamable
  • Status Indicator: Shows whether a rule is enabled and its metadata

Actions ​

ActionDescription
Enable/DisableToggle rule status
EditOpen script editor
CreateNew rule file in workspace
DeleteDelete workspace rule
ReloadReload all scripts
DebugTest rule output against a selected Flow

Execution Flow ​

mermaid
flowchart LR
    Traffic[Traffic Capture] --> Engine[Passive Scan Engine]
    Engine --> Rules[Rule Matching]
    Rules --> Findings[Security Findings]
    Findings --> Store[Finding Storage]
    Store --> Drawer[Findings Panel]

Passive scanning runs automatically during traffic capture. Rules check all HTTP/HTTPS and WebSocket traffic.

Built-in Rules ​

28 built-in passive scanning rules, all enabled by default, covering OWASP Top 10 risks.

Scan (Active Scanning) ​

Manage active scanning rules stored as .rhai files in plugins/scanner/active/.

Execution Flow ​

mermaid
flowchart LR
    Traffic[Traffic Capture] --> Dispatcher[Scan Dispatcher]
    Dispatcher --> RateLimit[Rate Limiting]
    RateLimit --> Probe[Probe Requests]
    Probe --> Detect[Payload Detection]
    Detect --> Findings[Security Findings]

Active scanning runs concurrently during traffic capture (disabled by default, must be enabled in project settings).

Built-in Rules ​

8 built-in active scanning rules, all disabled by default.

Tag Scripts ​

Tag scripts are Rhai functions that automatically tag captured requests.

Use Cases ​

  • Endpoint Classification: Tag API endpoints by URL pattern
  • Sensitive Operations: Identify requests involving sensitive operations
  • Tech Stack Recognition: Tag based on response headers
  • Custom Annotations: Project-specific tagging logic

Function Format ​

Tag scripts export a fn tag(flow) function that returns an array of strings:

rust
fn tag(flow) {
    let tags = [];
    if host_url_match(flow, "/api/admin") {
        tags.push("admin");
    }
    if host_url_match(flow, "(?i)(login|auth|token)") {
        tags.push("auth");
    }
    if host_header_absent(flow, "req", "authorization") {
        tags.push("no-auth");
    }
    tags
}

Script Editor ​

All rules and tag scripts share the same editor with:

  • Syntax Highlighting: Rhai script highlighting
  • Code Folding: Fold/unfold code blocks
  • Error Reporting: Real-time compilation errors
  • Debug Output: Execution result preview

Project Configuration ​

  • Go to Settings → Project Settings to enable/disable rules
  • Active rules are disabled by default
  • Rule configuration is per-project

Viewing Findings ​

Findings can be viewed through:

  • Status Bar Findings Panel: Quick access to recent findings
  • Reports Page: Browse and manage all findings in the Findings tab

Built-in Rules ​

Passive Rules (28, all enabled by default) ​

Rule IDNameDetectionSeverity
sensitive-dataSensitive Data LeakPhone, ID, email, secretsHigh
credit-cardCredit Card LeakVisa/MasterCard/Amex numbersHigh
transport-http-sensitiveHTTP Plaintext Sensitive Paramspassword/token/secret in plaintextHigh
transport-hsts-missingHSTS MissingNo HSTS header on HTTPSHigh
certificateCertificate IssuesSelf-signed or expired certHigh
sqli-patternSQL Injection PatternUNION SELECT, OR 1=1 patternsHigh
path-traversalPath Traversal../ or ..\ patternsHigh
api-key-in-urlAPI Key in URLapi_key in query paramsHigh
websocket-ws-sensitiveWebSocket Plaintext Sensitive Infopassword/token in ws://High
websocket-ws-plaintextWebSocket Plaintext Connectionws:// protocolHigh
cookie-securityCookie Security MissingNo HttpOnly/Secure/SameSiteMedium
corsInsecure CORSACAO: * + ACAC: trueMedium
cspWeak CSPunsafe-inline, unsafe-eval, *Medium
x-frame-optionsX-Frame-Options MissingClickjacking riskMedium
jwt-tokenJWT Token LeakeyJ-prefixed tokens in bodyMedium
stack-traceStack Trace LeakDebug stack in responseMedium
debug-pageDebug Page ExposureFlask debug, PHPInfo, Spring Boot errorMedium
directory-listingDirectory ListingIndex of / listingMedium
open-redirectOpen RedirectLocation to external domainMedium
host-header-injectionHost Header InjectionResponse reflects Host headerMedium
xss-reflectionXSS ReflectionUnencoded <script> or event handlersMedium
content-typeContent-Type MissingNo X-Content-Type-OptionsLow
info-leakServer Info LeakServer/X-Powered-By headersLow
internal-ipInternal IP LeakRFC1918 IP in responseLow
referrer-policyReferrer-Policy MissingNo Referrer-Policy headerLow
permissions-policyPermissions-Policy MissingNo feature policy headerLow
cache-controlCache-Control MissingSensitive pages without cache controlLow
x-xss-protectionX-XSS-Protection MissingMissing XSS filter headerLow

Active Rules (8, all disabled by default) ​

Rule IDNameDetection MethodSeverity
active-sqli-errorSQL Injection (Error)Append quote payload, detect DB errorsHigh
active-cmd-injectionCommand InjectionAppend echo canary, detect echoHigh
active-path-traversalPath TraversalReplace with ../etc/passwdHigh
active-ssrfSSRFInject internal address, detect connectionHigh
active-xss-reflectXSS ReflectionAppend unique probe, detect echoMedium
active-open-redirectOpen RedirectInject external probe domain, detect redirectMedium
active-sstiSSTIAppend arithmetic expression, detect eval resultMedium
active-error-disclosureError DisclosureInject malformed input, compare baselineLow

Plugin Development ​

All scan rules use the Rhai scripting language. See:

Troubleshooting ​

Rules Not Triggering ​

  1. Check if rules are enabled in the project
  2. Verify the proxy is running and capturing traffic
  3. Passive rules trigger automatically; active rules need traffic
  4. Check scan logs

Script Load Failure ​

  1. Check .rhai file format and syntax
  2. Verify metadata header (//!) format
  3. Check app logs for compilation errors
  4. Click Reload to refresh

Performance Issues ​

  1. Reduce number of enabled rules
  2. Return early in scripts to minimize regex
  3. Adjust active scan concurrency limits
  4. Periodically clean historical Flow data