Function Signature
aguara.go:151
Description
Returns detailed information about a specific detection rule, including:- Full description and remediation guidance
- Detection patterns (regex or contains)
- True positive examples (should trigger)
- False positive examples (should not trigger)
Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | Rule ID (case-insensitive, whitespace trimmed) |
opts | ...Option | Functional options (only WithCustomRules() applies) |
Return Values
| Type | Description |
|---|---|
*RuleDetail | Detailed rule information |
error | Non-nil if rule not found or loading fails |
Type Definition
Examples
Basic Usage
View Detection Patterns
View Examples
Case-Insensitive Lookup
Error Handling
Export Rule Details to JSON
Explain Finding’s Rule
Generate Rule Documentation
Interactive Rule Explorer
Export All Rule Details
Pattern Format
Patterns are returned with type prefixes:[regex] (?i)ignore.*previous.*instruction- Case-insensitive regex[contains] curl | sh- Exact substring match
Custom Rules
To explain custom rules, load them first:Performance Notes
- Rules are loaded and compiled on each call
- Typical execution time: < 5ms
- For repeated lookups, consider caching rule details
Related
- ListRules() - Get all available rules
- WithCustomRules() - Load custom rules
- Finding - Finding type includes RuleID
