Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports IsRuleEngineOff #504

Merged
merged 8 commits into from
Nov 21, 2022
8 changes: 8 additions & 0 deletions internal/corazawaf/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -939,12 +939,20 @@ func (tx *Transaction) ProcessLogging() {
}
}

// RuleEngineStatus returns the status of the rule engine for the transaction
// Note that it returns the current status of the engine, later rules may still change it via ctl actions
func (tx *Transaction) RuleEngineStatus() types.RuleEngineStatus {
return tx.RuleEngine
}

// RequestBodyAccessible will return true if RequestBody access has been enabled by RequestBodyAccess
// Note that it returns the current status, later rules may still change it via ctl actions
func (tx *Transaction) RequestBodyAccessible() bool {
return tx.RequestBodyAccess
}

// ResponseBodyAccessible will return true if ResponseBody access has been enabled by ResponseBodyAccess
// Note that it returns the current status, later rules may still change it via ctl actions
func (tx *Transaction) ResponseBodyAccessible() bool {
return tx.ResponseBodyAccess
}
Expand Down
3 changes: 3 additions & 0 deletions types/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ type Transaction interface {
// delivered prior to the execution of this method.
ProcessLogging()

// RuleEngineStatus returns the status of the rule engine for the transaction
RuleEngineStatus() RuleEngineStatus

// RequestBodyAccessible will return true if RequestBody access has been enabled by RequestBodyAccess
RequestBodyAccessible() bool

Expand Down