Scan Criteria Management

The Scan Criteria page is the command center for managing automated scan rules that check files in the SearchPageAudit system. This page allows you to create, edit, and maintain criteria that define what patterns to search for in files, how to evaluate them, and optionally how to fix any issues found. Each criteria can be configured with search patterns, fix modes, dependencies, and mission assignments to create a comprehensive quality assurance framework.

Quick Start

  1. Click Add to create a new scan criteria
  2. Enter a descriptive name and search pattern
  3. Configure the search mode (FIND, FIND_ANY, or REGEX)
  4. Set whether the criteria passes when pattern is found or not found
  5. Optionally configure fix settings for automatic remediation
  6. Save and test the criteria on your file system

Toolbar Functions

Button Function Description
Add Create New Criteria Opens the Add Criteria modal to create a new scan rule with pattern matching and fix configurations
Back Navigate Back Returns to the previous page in browser history
Close Close Page Closes the current page and returns to Control Panel
ð??? Refresh Reloads the page to show the latest data
ð??쳌 Search Searches criteria names, descriptions, patterns, and applies-to types
Show All Clear Search Removes search filters and displays all active criteria
UnDelete View Deleted Shows soft-deleted criteria that can be restored
Delete Selected Bulk Delete Soft-deletes all selected criteria (sets Active=2)

Table Columns

Column Description Details
â?? Selection Checkbox Select criteria for bulk operations like delete or restore
Name Criteria Name Descriptive name for the scan criteria (e.g., "Check for deprecated functions")
Mission Mission Assignment Shows which scan mission this criteria belongs to, displayed as a blue badge
Description Detailed Description Longer explanation of what this criteria checks for
Pattern Search Pattern The text or regex pattern to search for in files, displayed in monospace font
Mode Search Mode FIND (exact text), FIND_ANY (pipe-delimited options), or REGEX (regular expression)
PassWhen Pass Condition FOUND (passes when pattern found) or NOT_FOUND (passes when pattern absent)
Applies To File Types Which file types this criteria applies to (ALL, Search, RecordEdit, etc.)
Depends On Dependency Another criteria that must pass before this one is evaluated
Order Sort Order Numeric value controlling the order criteria are processed
Fix Fix Mode Shows if automatic fixes are configured (REPLACE, INSERT_BEFORE, SCRIPT, etc.)
Pass/Fail Results Summary Shows count of passing files (green) vs failing files (red), plus active task count
Actions Row Actions Edit, Assign (create tasks), and Delete buttons for each criteria
Active Status Indicator Green checkmark (active), red X (deleted), or gray dash (inactive)
ID Unique ID Database ID number for the criteria record

Search Modes Explained

FIND Mode

Searches for exact text matches within files. Case-sensitive and looks for the exact string specified in the Search Pattern field. Use this for finding specific function calls, variable names, or exact code snippets.

FIND_ANY Mode

Searches for any one of multiple alternatives separated by pipe characters (|). For example, "cfquery|cfupdate|cfinsert" would match files containing any of those three tags. Useful for checking multiple related patterns in a single criteria.

REGEX Mode

Uses ColdFusion regular expressions for advanced pattern matching. Allows complex searches with wildcards, character classes, and quantifiers. Example: "cfquery[^>]*datasource\s*=\s*[\"']?##[^\"'##]*[\"']?" to find queries with dynamic datasources.


Fix Modes and Automation

Fix Mode Description Use Case
REPLACE Direct text replacement Replace deprecated functions with new ones
INSERT_BEFORE Insert text before anchor pattern Add security checks before database queries
INSERT_AFTER Insert text after anchor pattern Add logging after critical operations
REGEX_REPLACE Replace using regex capture groups Complex pattern transformations
SCRIPT Run custom ColdFusion script Complex fixes requiring logic

Creating and Editing Criteria

Adding New Criteria

  1. Click Add: Opens the criteria modal form
  2. Enter Basic Info: Provide name, description, and search pattern
  3. Configure Search: Select mode (FIND/FIND_ANY/REGEX) and pass condition
  4. Set Scope: Choose which file types this applies to
  5. Optional Dependencies: Select another criteria this depends on
  6. Fix Configuration: Optionally configure automatic remediation
  7. Save: Criteria becomes active immediately

Editing Existing Criteria

  1. Click Edit: Opens the criteria in edit mode
  2. Modify Fields: Update any configuration settings
  3. Save Changes: Updates take effect immediately
  4. Test Results: Check Pass/Fail counts to verify changes

Tips for Effective Criteria

  • Start with simple FIND patterns before moving to complex REGEX
  • Use descriptive names that explain the business rule being enforced
  • Set appropriate sort orders to ensure dependencies run first
  • Test fix modes on a small set of files before applying broadly
  • Use mission assignments to group related criteria together

Task Assignment and Automation

When criteria have fix modes configured, you can automatically create tasks for all failing files using the Assign button. This feature:

  • Identifies Failing Files: Finds all files that don't pass the criteria
  • Creates Tasks: Generates SearchPageAudit_Tasks records for remediation
  • Avoids Duplicates: Won't create tasks if they already exist for that criteria/file combination
  • Provides Feedback: Shows count of tasks created
  • Enables Automation: Tasks can be processed by the automated fix system

Task Creation Workflow

  1. Review Results: Check the Pass/Fail column to see failing file count
  2. Verify Fix Config: Ensure fix mode and patterns are correctly configured
  3. Click Assign: Confirm creation of tasks for failing files
  4. Monitor Progress: Task count badge shows active tasks for the criteria
  5. Check Results: Tasks will process automatically based on execution mode

Deletion and Recovery Workflows

Soft Delete Process

  1. Select Criteria: Check boxes next to criteria to delete
  2. Click Delete Selected: Moves criteria to deleted state (Active=2)
  3. Criteria Hidden: No longer appear in main listing
  4. Scan Results Preserved: Historical data remains intact
  5. Can Be Restored: Use UnDelete view to recover

Recovery Process

  1. Click UnDelete: Switch to deleted criteria view
  2. Select Criteria: Choose criteria to restore
  3. Click Un-Delete Selected: Restores criteria to active state
  4. Return to Main View: Criteria reappear in main listing

Permanent Deletion

  1. Go to UnDelete View: View soft-deleted criteria
  2. Select Criteria: Choose criteria to permanently remove
  3. Click Permanently Delete: Removes from database completely
  4. Cannot Be Undone: All associated data is lost forever

Status Management

Each criteria has an active status that can be toggled by clicking the status icon:

  • Green Checkmark (Active): Criteria is actively used in scans
  • Gray Dash (Inactive): Criteria exists but is not used in scans
  • Red X (Deleted): Criteria is soft-deleted and hidden from normal view

Inactive criteria remain in the system but are skipped during scan operations, allowing you to temporarily disable rules without losing their configuration.


Permission Requirements

Access to the Scan Criteria page requires:

  • Valid Login: Must be logged in with Client.ID set
  • Admin Access: Only Client.ID = 1 (primary admin) can access this page
  • Database Permissions: Read/write access to ScanCriteria table
  • Related Tables: Access to ScanResults, SearchPageAudit_Tasks, ScanMissions

Non-admin users will receive an "Access Denied" message when attempting to access this page.


Search and Filtering

The search functionality provides powerful filtering across multiple fields:

  • Criteria Names: Searches the CriteriaName field
  • Descriptions: Searches the Description field
  • Search Patterns: Searches the SearchPattern field
  • Applies To Types: Searches the AppliesToTypes field

Search is case-insensitive and uses partial matching. The search term is preserved in the client session for convenience when navigating between pages.


Data Relationships

The Scan Criteria system integrates with several related components:

  • ScanResults: Stores pass/fail results for each file/criteria combination
  • SearchPageAudit_Tasks: Contains fix tasks generated from failing criteria
  • ScanMissions: Groups criteria into logical scanning missions
  • Dependencies: Criteria can depend on other criteria passing first

These relationships enable sophisticated scanning workflows where criteria build upon each other and fixes can be automatically generated and applied.

Summary

The Scan Criteria page provides comprehensive management of automated quality assurance rules for your file system. Use it to define search patterns, configure automatic fixes, manage dependencies, and create tasks for remediation. The system supports multiple search modes, flexible fix options, and sophisticated workflow automation. Regular maintenance of criteria ensures your codebase stays compliant with established standards and best practices.