Documentation
¶
Index ¶
- type AdvancedExfiltrationDetector
- type AdvancedInjectionDetector
- type AdvancedSupplyChainAnalyzer
- type Category
- type ConfigInterface
- type Finding
- func CheckAIAgentCommentTriggered(workflow parser.WorkflowFile) []Finding
- func CheckAdvancedPrivilegeAnalysis(workflow parser.WorkflowFile) []Finding
- func CheckAllRules(workflow parser.WorkflowFile) []Finding
- func CheckCachePoisoning(workflow parser.WorkflowFile) []Finding
- func CheckDockerAgentExposure(workflow parser.WorkflowFile) []Finding
- func CheckInjectionVulnerabilities(workflow parser.WorkflowFile) []Finding
- func CheckOIDCAbuse(workflow parser.WorkflowFile) []Finding
- func CheckSelfHostedRunnerSecurity(workflow parser.WorkflowFile) []Finding
- func CheckShellInjectionVulnerabilities(workflow parser.WorkflowFile) []Finding
- func CheckSupplyChainVulnerabilities(workflow parser.WorkflowFile) []Finding
- func CheckWorkflowRunTrust(workflow parser.WorkflowFile) []Finding
- type InjectionPatterns
- type Platform
- type Rule
- type RuleEngine
- type Severity
- type VersionPinningAnalysis
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvancedExfiltrationDetector ¶
type AdvancedExfiltrationDetector struct {
// contains filtered or unexported fields
}
AdvancedExfiltrationDetector detects advanced data exfiltration techniques Addresses Issue #16: Exfiltration Scanner Misses DNS, Tunneling & Encoded Data Patterns
func NewAdvancedExfiltrationDetector ¶
func NewAdvancedExfiltrationDetector() *AdvancedExfiltrationDetector
NewAdvancedExfiltrationDetector creates a new advanced exfiltration detector
func (*AdvancedExfiltrationDetector) DetectAdvancedExfiltration ¶
func (d *AdvancedExfiltrationDetector) DetectAdvancedExfiltration(workflow *parser.Workflow) []Finding
DetectAdvancedExfiltration scans for advanced exfiltration techniques
type AdvancedInjectionDetector ¶
type AdvancedInjectionDetector struct {
// contains filtered or unexported fields
}
AdvancedInjectionDetector detects obfuscated and indirect injection attacks Addresses Issue #17: Indirect and Obfuscated Injection Attacks Bypass Detection
func NewAdvancedInjectionDetector ¶
func NewAdvancedInjectionDetector() *AdvancedInjectionDetector
NewAdvancedInjectionDetector creates a new advanced injection detector
func (*AdvancedInjectionDetector) DetectObfuscatedInjections ¶
func (d *AdvancedInjectionDetector) DetectObfuscatedInjections(workflow *parser.Workflow) []Finding
DetectObfuscatedInjections scans for obfuscated injection attacks
type AdvancedSupplyChainAnalyzer ¶
type AdvancedSupplyChainAnalyzer struct {
// contains filtered or unexported fields
}
AdvancedSupplyChainAnalyzer provides comprehensive supply chain security analysis
func NewAdvancedSupplyChainAnalyzer ¶
func NewAdvancedSupplyChainAnalyzer() *AdvancedSupplyChainAnalyzer
NewAdvancedSupplyChainAnalyzer creates a new advanced analyzer
type Category ¶
type Category string
Category represents the category of a security rule
const ( MaliciousPattern Category = "MALICIOUS_PATTERN" Misconfiguration Category = "MISCONFIGURATION" SecretExposure Category = "SECRET_EXPOSURE" ShellObfuscation Category = "SHELL_OBFUSCATION" PolicyViolation Category = "POLICY_VIOLATION" SupplyChain Category = "SUPPLY_CHAIN" InjectionAttack Category = "INJECTION_ATTACK" SecretsExposure Category = "SECRETS_EXPOSURE" AccessControl Category = "ACCESS_CONTROL" PrivilegeEscalation Category = "PRIVILEGE_ESCALATION" DataExposure Category = "DATA_EXPOSURE" )
type ConfigInterface ¶
type ConfigInterface interface {
IsRuleEnabled(ruleID string) bool
ShouldIgnoreForRule(ruleID, text, filePath string) bool
ShouldIgnoreSecret(text, context string) bool
}
ConfigInterface defines the interface for configuration
type Finding ¶
type Finding struct {
RuleID string
RuleName string
Description string
Severity Severity
Category Category
FilePath string
JobName string
StepName string
Evidence string
Remediation string
LineNumber int // Line number where the issue was found
GitHubURL string // Direct GitHub URL to the line (for remote repositories)
GitLabURL string // Direct GitLab URL to the line (for remote repositories)
// Context fields for better AI analysis
Trigger string `json:"trigger,omitempty"` // Workflow trigger (e.g., "push", "pull_request", "workflow_dispatch")
RunnerType string `json:"runner_type,omitempty"` // Runner type (e.g., "ubuntu-latest", "self-hosted", "windows-latest")
FileContext string `json:"file_context,omitempty"` // File context (e.g., "production", "test", "example", "template")
// AI verification fields
AIVerified bool `json:"ai_verified,omitempty"` // Whether AI analysis was performed
AILikelyFalsePositive *bool `json:"ai_likely_false_positive,omitempty"` // AI assessment (nil if not analyzed)
AIConfidence float64 `json:"ai_confidence,omitempty"` // AI confidence level (0.0 to 1.0)
AIReasoning string `json:"ai_reasoning,omitempty"` // AI explanation
AISuggestedSeverity string `json:"ai_suggested_severity,omitempty"` // AI suggested severity if different
AIError string `json:"ai_error,omitempty"` // AI analysis error if any
AISkipped bool `json:"ai_skipped,omitempty"` // Whether AI analysis was skipped
AISkipReason string `json:"ai_skip_reason,omitempty"` // Reason AI analysis was skipped
AIRemediation string `json:"ai_remediation,omitempty"` // AI-suggested remediation steps
}
Finding represents a detected security issue
func CheckAIAgentCommentTriggered ¶
func CheckAIAgentCommentTriggered(workflow parser.WorkflowFile) []Finding
CheckAIAgentCommentTriggered detects AI agent workflows triggered by issue_comment or pull_request_review_comment that process attacker-controlled input (comment body) with secrets available. This enables prompt injection attacks where any external user can @mention the agent and craft payloads to exfiltrate secrets or abuse write permissions.
func CheckAdvancedPrivilegeAnalysis ¶
func CheckAdvancedPrivilegeAnalysis(workflow parser.WorkflowFile) []Finding
CheckAdvancedPrivilegeAnalysis performs advanced workflow privilege analysis
func CheckAllRules ¶
func CheckAllRules(workflow parser.WorkflowFile) []Finding
CheckAllRules runs all security rule checks
func CheckCachePoisoning ¶
func CheckCachePoisoning(workflow parser.WorkflowFile) []Finding
CheckCachePoisoning is the public entry point that detects cache poisoning attack vectors (CP-001 and CP-002).
func CheckDockerAgentExposure ¶
func CheckDockerAgentExposure(workflow parser.WorkflowFile) []Finding
CheckDockerAgentExposure detects pull_request_target workflows that run Docker containers or reusable agent workflows with secrets on fork code.
func CheckInjectionVulnerabilities ¶
func CheckInjectionVulnerabilities(workflow parser.WorkflowFile) []Finding
CheckInjectionVulnerabilities is the main entry point for injection vulnerability checks
func CheckOIDCAbuse ¶
func CheckOIDCAbuse(workflow parser.WorkflowFile) []Finding
CheckOIDCAbuse is the entry point for OIDC token abuse detection. It checks for OA-001 (workflow-level id-token:write) and OA-002 (id-token:write without environment scope).
func CheckSelfHostedRunnerSecurity ¶
func CheckSelfHostedRunnerSecurity(workflow parser.WorkflowFile) []Finding
CheckSelfHostedRunnerSecurity performs comprehensive self-hosted runner security analysis
func CheckShellInjectionVulnerabilities ¶
func CheckShellInjectionVulnerabilities(workflow parser.WorkflowFile) []Finding
CheckShellInjectionVulnerabilities is the main entry point for shell injection checks
func CheckSupplyChainVulnerabilities ¶
func CheckSupplyChainVulnerabilities(workflow parser.WorkflowFile) []Finding
CheckSupplyChainVulnerabilities checks for supply chain security issues
func CheckWorkflowRunTrust ¶
func CheckWorkflowRunTrust(workflow parser.WorkflowFile) []Finding
CheckWorkflowRunTrust is the main entry point for WRT-001, WRT-002, and WRT-003. It returns findings for all three rules covering the CVE-2025-30066 (tj-actions/reviewdog) supply chain attack pattern where workflow_run triggers allow untrusted artifact injection.
type InjectionPatterns ¶
InjectionPatterns contains regex patterns for detecting injection vulnerabilities
func GetInjectionPatterns ¶
func GetInjectionPatterns() InjectionPatterns
GetInjectionPatterns returns patterns for detecting user-controlled input injection
type Platform ¶
type Platform string
Platform represents the CI/CD platform a rule applies to
func StringToPlatform ¶
StringToPlatform converts platform string constants to Platform enum
type Rule ¶
type Rule struct {
ID string
Name string
Description string
Severity Severity
Category Category
Platform Platform // Platform compatibility for this rule
Check func(workflow parser.WorkflowFile) []Finding
}
Rule represents a security rule to check in a workflow
func FilterRulesByPlatform ¶
FilterRulesByPlatform filters rules based on target platform compatibility
func StandardRules ¶
func StandardRules() []Rule
StandardRules returns the list of built-in security rules
type RuleEngine ¶
type RuleEngine struct {
// contains filtered or unexported fields
}
RuleEngine handles rule execution with configuration support
func NewRuleEngine ¶
func NewRuleEngine(config ConfigInterface) *RuleEngine
NewRuleEngine creates a new rule engine with configuration
func (*RuleEngine) ExecuteRules ¶
func (re *RuleEngine) ExecuteRules(workflow parser.WorkflowFile, rules []Rule) []Finding
ExecuteRules runs rules against a workflow with configuration filtering
func (*RuleEngine) SetContextAware ¶
func (re *RuleEngine) SetContextAware(enabled bool)
SetContextAware enables or disables context-aware analysis
Source Files
¶
- advanced_exfiltration.go
- advanced_injection.go
- advanced_privilege_analysis.go
- advanced_supply_chain.go
- cache_poisoning.go
- conditions.go
- debug.go
- docker_agent_exposure.go
- injection.go
- malicious_patterns.go
- oidc_abuse.go
- permissions.go
- rules.go
- runners.go
- secrets.go
- self_hosted_security.go
- shell_injection.go
- supply_chain.go
- supply_chain_checks.go
- triggers.go
- version_utils.go
- workflow_run_trust.go