sqlsec

package
v2.13.0-dev Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: Apache-2.0, BSD-3-Clause, Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MonitorSQLOperation added in v2.12.0

func MonitorSQLOperation(ctx context.Context, query, driver string)

MonitorSQLOperation reports SQL injection attempts without interrupting execution. An outer SQL integration can suppress duplicate monitoring with WithSQLOperationChecked while retaining its own blocking behavior.

func ProtectSQLOperation

func ProtectSQLOperation(ctx context.Context, query, driver string) error

func WithSQLOperationChecked added in v2.12.0

func WithSQLOperationChecked(ctx context.Context) context.Context

WithSQLOperationChecked marks a driver call already checked by an outer SQL integration. Only pass the returned context to that call, not subsequent queries. Without a parent security operation, it returns ctx unchanged.

Types

type SQLOperation

type SQLOperation struct {
	dyngo.Operation
}

type SQLOperationArgs

type SQLOperationArgs struct {
	// Query corresponds to the addres `server.db.statement`
	Query string
	// Driver corresponds to the addres `server.db.system`
	Driver string
	// MonitorOnly reports attacks without applying blocking or redirect actions.
	MonitorOnly bool
}

func (SQLOperationArgs) IsArgOf

func (SQLOperationArgs) IsArgOf(*SQLOperation)

type SQLOperationRes

type SQLOperationRes struct{}

func (SQLOperationRes) IsResultOf

func (SQLOperationRes) IsResultOf(*SQLOperation)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL