compensatingcontrol

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2026 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompensatingControl

type CompensatingControl struct {
	// contains filtered or unexported fields
}

CompensatingControl represents a security control that mitigates risk without fixing the underlying vulnerability.

func NewCompensatingControl

func NewCompensatingControl(
	tenantID shared.ID,
	name string,
	controlType ControlType,
	reductionFactor float64,
	createdBy shared.ID,
) (*CompensatingControl, error)

NewCompensatingControl creates a new control.

func ReconstituteCompensatingControl

func ReconstituteCompensatingControl(data CompensatingControlData) *CompensatingControl

ReconstituteCompensatingControl recreates from persistence.

func (*CompensatingControl) Activate

func (c *CompensatingControl) Activate()

Activate marks the control as active.

func (*CompensatingControl) ControlType

func (c *CompensatingControl) ControlType() ControlType

func (*CompensatingControl) CreatedAt

func (c *CompensatingControl) CreatedAt() time.Time

func (*CompensatingControl) Deactivate

func (c *CompensatingControl) Deactivate()

Deactivate marks the control as inactive.

func (*CompensatingControl) Description

func (c *CompensatingControl) Description() string

func (*CompensatingControl) ExpiresAt

func (c *CompensatingControl) ExpiresAt() *time.Time

func (*CompensatingControl) ID

func (c *CompensatingControl) ID() shared.ID

Getters

func (*CompensatingControl) IsEffective

func (c *CompensatingControl) IsEffective() bool

IsEffective returns true if the control is active, tested successfully, and not expired.

func (*CompensatingControl) LastTestedAt

func (c *CompensatingControl) LastTestedAt() *time.Time

func (*CompensatingControl) Name

func (c *CompensatingControl) Name() string

func (*CompensatingControl) RecordTest

func (c *CompensatingControl) RecordTest(result TestResult, evidence string)

RecordTest records the result of a control effectiveness test.

func (*CompensatingControl) ReductionFactor

func (c *CompensatingControl) ReductionFactor() float64

func (*CompensatingControl) SetDescription

func (c *CompensatingControl) SetDescription(desc string)

SetDescription updates the description.

func (*CompensatingControl) SetReductionFactor

func (c *CompensatingControl) SetReductionFactor(factor float64) error

SetReductionFactor updates the reduction factor.

func (*CompensatingControl) Status

func (c *CompensatingControl) Status() ControlStatus

func (*CompensatingControl) TenantID

func (c *CompensatingControl) TenantID() shared.ID

func (*CompensatingControl) TestEvidence

func (c *CompensatingControl) TestEvidence() string

func (*CompensatingControl) TestResult

func (c *CompensatingControl) TestResult() *TestResult

type CompensatingControlData

type CompensatingControlData struct {
	ID              shared.ID
	TenantID        shared.ID
	Name            string
	Description     string
	ControlType     ControlType
	Status          ControlStatus
	ReductionFactor float64
	LastTestedAt    *time.Time
	TestResult      *TestResult
	TestEvidence    string
	ExpiresAt       *time.Time
	CreatedBy       *shared.ID
	CreatedAt       time.Time
	UpdatedAt       time.Time
}

CompensatingControlData is the persistence representation.

type ControlStatus

type ControlStatus string

ControlStatus represents the lifecycle status of a control.

const (
	ControlStatusActive   ControlStatus = "active"
	ControlStatusInactive ControlStatus = "inactive"
	ControlStatusExpired  ControlStatus = "expired"
	ControlStatusUntested ControlStatus = "untested"
)

type ControlType

type ControlType string

ControlType represents the category of compensating control.

const (
	ControlTypeSegmentation ControlType = "segmentation"
	ControlTypeIdentity     ControlType = "identity"
	ControlTypeRuntime      ControlType = "runtime"
	ControlTypeDetection    ControlType = "detection"
	ControlTypeOther        ControlType = "other"
)

type TestResult

type TestResult string

TestResult represents the outcome of a control effectiveness test.

const (
	TestResultPass    TestResult = "pass"
	TestResultFail    TestResult = "fail"
	TestResultPartial TestResult = "partial"
)

Jump to

Keyboard shortcuts

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