v2

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GetAgentAccessKeyByIdPath = "%s/platform/v1/access-keys/%s"
	CreateAgentAccessKeyPath  = "%s/platform/v1/access-keys"
	DeleteAgentAccessKeyPath  = "%s/platform/v1/access-keys/%s"
	PutAgentAccessKeyPath     = "%s/platform/v1/access-keys/%s"
)
View Source
const (
	CreateAlertPath = "%s/api/alerts"
	DeleteAlertPath = "%s/api/alerts/%d"
	UpdateAlertPath = "%s/api/alerts/%d"
	GetAlertPath    = "%s/api/alerts/%d"
)
View Source
const (
	AlertV2TypePrometheus          AlertV2Type = "PROMETHEUS"
	AlertV2TypeManual              AlertV2Type = "MANUAL"
	AlertV2TypeEvent               AlertV2Type = "EVENT"
	AlertV2TypeChange              AlertV2Type = "PERCENTAGE_OF_CHANGE"
	AlertV2TypeFormBasedPrometheus AlertV2Type = "FORM_BASED_PROMETHEUS"
	AlertV2TypeGroupOutlier        AlertV2Type = "GROUP_OUTLIERS"

	AlertV2SeverityHigh   AlertV2Severity = "high"
	AlertV2SeverityMedium AlertV2Severity = "medium"
	AlertV2SeverityLow    AlertV2Severity = "low"
	AlertV2SeverityInfo   AlertV2Severity = "info"

	AlertLinkV2TypeDashboard AlertLinkV2Type = "dashboard"
	AlertLinkV2TypeRunbook   AlertLinkV2Type = "runbook"
)
View Source
const (
	GetMePath                  = "/api/users/me"
	UserAgentHeader            = "User-Agent"
	AuthorizationHeader        = "Authorization"
	ContentTypeHeader          = "Content-Type"
	SysdigProviderHeader       = "Sysdig-Provider"
	SysdigProviderHeaderValue  = "Terraform"
	SysdigUserAgentHeaderValue = "SysdigTerraform"
	ContentTypeJSON            = "application/json"
	ContentTypeFormURLEncoded  = "x-www-form-urlencoded"
	SysdigProductHeader        = "X-Sysdig-Product"
)
View Source
const (
	CreateCompositePolicyPath = "%s/api/v2/policies/batch?%s=%t"
	DeleteCompositePolicyPath = "%s/api/v2/policies/batch/%d?%s=%t"
	UpdateCompositePolicyPath = "%s/api/v2/policies/batch/%d"

	GetCompositePolicyPath   = "%s/api/v2/policies/%d" // TODO: Add skip query param
	GetCompositePoliciesPath = "%s/api/v2/policies?%s" // TODO: Implement pagination otherwise up to getPoliciesLimit number of policies will be returned

	GetCompositePolicyRulesPath = "%s/api/policies/v3/rules/groups?%s"
)
View Source
const (
	CustomRolesPath = "%s/api/roles"
	CustomRolePath  = "%s/api/roles/%d"
)
View Source
const (
	CreateGroupMappingPath = "%s/api/groupmappings"
	UpdateGroupMappingPath = "%s/api/groupmappings/%d"
	DeleteGroupMappingPath = "%s/api/groupmappings/%d"
	GetGroupMappingPath    = "%s/api/groupmappings/%d"
)
View Source
const (
	IBMInstanceIDHeader   = "IBMInstanceID"
	IBMIAMPath            = "/identity/token"
	IBMGrantTypeFormValue = "grant_type"
	IBMApiKeyFormValue    = "apikey"
	IBMAPIKeyGrantType    = "urn:ibm:params:oauth:grant-type:apikey"
	SysdigTeamIDHeader    = "SysdigTeamID"
	GetTeamByNamePath     = "/api/v2/teams/light/name/"
	IBMProductHeader      = "SysdigProduct"
)
View Source
const (
	CreateListPath = "%s/api/secure/falco/lists?skipPolicyV2Msg=%t"
	GetListPath    = "%s/api/secure/falco/lists/%d"
	UpdateListPath = "%s/api/secure/falco/lists/%d?skipPolicyV2Msg=%t"
	DeleteListPath = "%s/api/secure/falco/lists/%d?skipPolicyV2Msg=%t"
)
View Source
const (
	CreateMacroPath  = "%s/api/secure/falco/macros?skipPolicyV2Msg=%t"
	GetMacroByIDPath = "%s/api/secure/falco/macros/%d"
	UpdateMacroPath  = "%s/api/secure/falco/macros/%d?skipPolicyV2Msg=%t"
	DeleteMacroPath  = "%s/api/secure/falco/macros/%d?skipPolicyV2Msg=%t"
)
View Source
const (
	RuleTypeContainer  = "CONTAINER"
	RuleTypeFalco      = "FALCO"
	RuleTypeFilesystem = "FILESYSTEM"
	RuleTypeNetwork    = "NETWORK"
	RuleTypeProcess    = "PROCESS"
	RuleTypeSyscall    = "SYSCALL"
)
View Source
const (
	GetNotificationChannels = "%s/api/notificationChannels"
	GetNotificationChannel  = "%s/api/notificationChannels/%d"
)
View Source
const (
	CreatePolicyPath         = "%s/api/v2/policies?skipPolicyV2Msg=%t"
	DeletePolicyPath         = "%s/api/v2/policies/%d?skipPolicyV2Msg=%t"
	UpdatePolicyPath         = "%s/api/v2/policies/%d?skipPolicyV2Msg=%t"
	GetPolicyPath            = "%s/api/v2/policies/%d"
	GetPoliciesPath          = "%s/api/v2/policies"
	SendPoliciesToAgentsPath = "%s/api/v2/policies/actions?action=forwardPolicyV2Msg"
)
View Source
const (
	ZonesPath = "%s/api/cspm/v1/policy/zones"
	ZonePath  = "%s/api/cspm/v1/policy/zones/%d"
)
View Source
const (
	CreateRulePath   = "%s/api/secure/rules?skipPolicyV2Msg=%t"
	GetRuleByIDPath  = "%s/api/secure/rules/%d"
	UpdateRulePath   = "%s/api/secure/rules/%d?skipPolicyV2Msg=%t"
	DeleteURLPath    = "%s/api/secure/rules/%d?skipPolicyV2Msg=%t"
	GetRuleGroupPath = "%s/api/secure/rules/groups?name=%s&type=%s"
)
View Source
const (
	ServiceAccountsPath      = "%s/api/serviceaccounts/team"
	ServiceAccountPath       = "%s/api/serviceaccounts/team/%d"
	ServiceAccountDeletePath = "%s/api/serviceaccounts/team/%d/delete"
)
View Source
const (
	GetUsersLightPath = "%s/api/users/light"
	GetTeamsPath      = "%s/api/teams"
	GetTeamPath       = "%s/api/teams/%d"
)
View Source
const (
	GetUserByUsernamePath = "%s/api/users/%s"
	GetUserPath           = "%s/api/users/%d"
	GetUsersPath          = "%s/api/users"
	CreateUserPath        = "%s/api/user/provisioning/"
	UpdateUserPath        = "%s/api/users/%d"
	DeleteUserPath        = "%s/api/users/%d"
	GetCurrentUserPath    = "%s/api/users/me"
)
View Source
const (
	CreateVulnerabilityExceptionListPath = "%s/api/scanning/v1/vulnexceptions"
	GetVulnerabilityExceptionListPath    = "%s/api/scanning/v1/vulnexceptions/%s"
	DeleteVulnerabilityExceptionListPath = "%s/api/scanning/v1/vulnexceptions/%s"
	UpdateVulnerabilityExceptionListPath = "%s/api/scanning/v1/vulnexceptions/%s"

	CreateVulnerabilityExceptionPath = "%s/api/scanning/v1/vulnexceptions/%s/vulnerabilities"
	GetVulnerabilityExceptionPath    = "%s/api/scanning/v1/vulnexceptions/%s/vulnerabilities/%s/"
	DeleteVulnerabilityExceptionPath = "%s/api/scanning/v1/vulnexceptions/%s/vulnerabilities/%s/"
	UpdateVulnerabilityExceptionPath = "%s/api/scanning/v1/vulnexceptions/%s/vulnerabilities/%s/"
)
View Source
const GetIdentityContextPath = "%s/api/identity/context"
View Source
const (
	GroupMappingConfigPath = "%s/api/groupmappings/settings"
)
View Source
const PermissionsURL = "%s/api/permissions/%s/dependencies?requestedPermissions=%s"
View Source
const PosturePolicyListPath = "%s/api/cspm/v1/policy/policies/list"

Variables

View Source
var AlertV2NotFound = errors.New("alert not found")
View Source
var CustomRoleNotFound = errors.New("custom role not found")
View Source
var GroupMappingConfigNotFound = errors.New("group mapping configuration not found")
View Source
var GroupMappingNotFound = errors.New("group mapping not found")
View Source
var NotificationChannelNotFound = errors.New("notification channel not found")
View Source
var SilenceRuleNotFound = errors.New("silence rule not found")
View Source
var TeamServiceAccountNotFound = errors.New("team service account not found")

Functions

func Marshal

func Marshal[T any](data T) (io.Reader, error)

func Unmarshal

func Unmarshal[T any](data io.ReadCloser) (T, error)

Types

type AWSMLRuleDetails added in v1.23.0

type AWSMLRuleDetails struct {
	RuleType              ElementType                 `json:"ruleType" yaml:"ruleType"`
	AnomalousConsoleLogin *MLRuleThresholdAndSeverity `json:"anomalousConsoleLogin" yaml:"anomalousConsoleLogin"`
	Details               `json:"-"`
}

func (AWSMLRuleDetails) GetRuleType added in v1.23.0

func (p AWSMLRuleDetails) GetRuleType() ElementType

type Action added in v1.4.1

type Action struct {
	AfterEventNs         int     `json:"afterEventNs,omitempty"`
	BeforeEventNs        int     `json:"beforeEventNs,omitempty"`
	Name                 string  `json:"name,omitempty"`
	Filter               string  `json:"filter,omitempty"`
	StorageType          string  `json:"storageType,omitempty"`
	BucketName           string  `json:"bucketName,omitempty"`
	Folder               string  `json:"folder,omitempty"`
	IsLimitedToContainer bool    `json:"isLimitedToContainer"`
	Type                 string  `json:"type"`
	Msg                  *string `json:"msg,omitempty"`
}

Did not add support storageId because FE does not support it yet

type AdvancedQueries added in v1.5.0

type AdvancedQueries struct {
	Enabled     bool        `json:"enabled"`
	DisplayInfo DisplayInfo `json:"displayInfo"`
	Format      Format      `json:"format"`
	Query       string      `json:"query"`
	ID          int         `json:"id"`
	ParentPanel *Panels     `json:"-"`
}

func NewPromqlQuery added in v1.5.0

func NewPromqlQuery(query string, parentPanel *Panels, displayInfo DisplayInfo) *AdvancedQueries

func (*AdvancedQueries) Enable added in v1.5.0

func (q *AdvancedQueries) Enable(val bool) *AdvancedQueries

func (*AdvancedQueries) WithDataFormat added in v1.5.0

func (q *AdvancedQueries) WithDataFormat(f *Format) *AdvancedQueries

func (*AdvancedQueries) WithDataRateFormat added in v1.5.0

func (q *AdvancedQueries) WithDataRateFormat(f *Format) *AdvancedQueries

func (*AdvancedQueries) WithNumberFormat added in v1.5.0

func (q *AdvancedQueries) WithNumberFormat(f *Format) *AdvancedQueries

func (*AdvancedQueries) WithNumberRateFormat added in v1.5.0

func (q *AdvancedQueries) WithNumberRateFormat(f *Format) *AdvancedQueries

func (*AdvancedQueries) WithPercentFormat added in v1.5.0

func (q *AdvancedQueries) WithPercentFormat(f *Format) *AdvancedQueries

func (*AdvancedQueries) WithTimeFormat added in v1.5.0

func (q *AdvancedQueries) WithTimeFormat(f *Format) *AdvancedQueries

type AgentAccessKey added in v1.24.0

type AgentAccessKey struct {
	ID             int               `json:"id,omitempty"`
	Reservation    int               `json:"agentReservation"`
	Limit          int               `json:"agentLimit"`
	TeamID         int               `json:"teamId,omitempty"`
	AgentAccessKey string            `json:"accessKey,omitempty"`
	Metadata       map[string]string `json:"metadata,omitempty"`
	Enabled        bool              `json:"isEnabled"`
	DateCreated    string            `json:"dateCreated,omitempty"`
	DateDisabled   string            `json:"dateDisabled,omitempty"`
}

type AgentAccessKeyInterface added in v1.24.0

type AgentAccessKeyInterface interface {
	Base
	GetAgentAccessKeyByID(ctx context.Context, id string) (*AgentAccessKey, error)
	CreateAgentAccessKey(ctx context.Context, agentAccessKey *AgentAccessKey) (*AgentAccessKey, error)
	DeleteAgentAccessKey(ctx context.Context, id string) error
	UpdateAgentAccessKey(ctx context.Context, agentAccessKey *AgentAccessKey, id string) (*AgentAccessKey, error)
}

type AgentAccessKeyReadWrapper added in v1.24.0

type AgentAccessKeyReadWrapper struct {
	CustomerAccessKey []AgentAccessKey `json:"customerAccessKeys"`
}

type AgentAccessKeyWriteWrapper added in v1.24.0

type AgentAccessKeyWriteWrapper struct {
	CustomerAccessKey AgentAccessKey `json:"customerAccessKey"`
}

type Alert added in v1.4.0

type Alert struct {
	ID                     int                 `json:"id,omitempty"`
	Version                int                 `json:"version,omitempty"`
	Type                   string              `json:"type"`
	Name                   string              `json:"name"`
	Description            string              `json:"description"`
	Enabled                bool                `json:"enabled"`
	GroupName              string              `json:"groupName,omitempty"`
	NotificationChannelIds []int               `json:"notificationChannelIds"`
	Filter                 string              `json:"filter"`
	Severity               int                 `json:"severity"`
	Timespan               int                 `json:"timespan"`
	CustomNotification     *CustomNotification `json:"customNotification"`
	TeamID                 int                 `json:"teamId,omitempty"`
	AutoCreated            bool                `json:"autoCreated"`
	SysdigCapture          *SysdigCapture      `json:"sysdigCapture"`
	RateOfChange           bool                `json:"rateOfChange,omitempty"`
	ReNotifyMinutes        int                 `json:"reNotifyMinutes"`
	ReNotify               bool                `json:"reNotify"`
	Valid                  bool                `json:"valid"`
	SeverityLabel          string              `json:"severityLabel,omitempty"`
	SegmentBy              []string            `json:"segmentBy"`
	SegmentCondition       *SegmentCondition   `json:"segmentCondition"`
	Criteria               *Criteria           `json:"criteria,omitempty"`
	Monitor                []*Monitor          `json:"monitor,omitempty"`
	Condition              string              `json:"condition"`
	SeverityLevel          int                 `json:"severityLevel,omitempty"`
}

type AlertInterface added in v1.4.0

type AlertInterface interface {
	Base
	CreateAlert(ctx context.Context, alert Alert) (Alert, error)
	DeleteAlert(ctx context.Context, alertID int) error
	UpdateAlert(ctx context.Context, alert Alert) (Alert, error)
	GetAlertByID(ctx context.Context, alertID int) (Alert, error)
}

type AlertLabelDescriptorV2 added in v1.6.0

type AlertLabelDescriptorV2 struct {
	ID       string `json:"id"`
	PublicID string `json:"publicId,omitempty"`
}

type AlertLinkV2 added in v1.6.0

type AlertLinkV2 struct {
	Type string `json:"type,omitempty"`
	ID   string `json:"id,omitempty"`
	Href string `json:"href,omitempty"`
}

type AlertLinkV2Type added in v1.6.0

type AlertLinkV2Type string

type AlertMetricDescriptorV2 added in v1.6.0

type AlertMetricDescriptorV2 struct {
	ID string `json:"id"`
}

type AlertScopeV2 added in v1.6.0

type AlertScopeV2 struct {
	Expressions []ScopeExpressionV2 `json:"expressions,omitempty"`
}

type AlertV2Change added in v1.12.0

type AlertV2Change struct {
	AlertV2Common
	DurationSec                              int                 `json:"durationSec"` // not really used but the api wants it set to 0 in POST/PUT
	Config                                   AlertV2ConfigChange `json:"config"`
	UnreportedAlertNotificationsRetentionSec *int                `json:"unreportedAlertNotificationsRetentionSec"`
}

type AlertV2ChangeInterface added in v1.12.0

type AlertV2ChangeInterface interface {
	Base
	CreateAlertV2Change(ctx context.Context, alert AlertV2Change) (AlertV2Change, error)
	UpdateAlertV2Change(ctx context.Context, alert AlertV2Change) (AlertV2Change, error)
	GetAlertV2Change(ctx context.Context, alertID int) (AlertV2Change, error)
	DeleteAlertV2Change(ctx context.Context, alertID int) error
}

type AlertV2Common added in v1.6.0

type AlertV2Common struct {
	ID                            int                           `json:"id,omitempty"`
	Version                       int                           `json:"version,omitempty"`
	Name                          string                        `json:"name"`
	Description                   string                        `json:"description,omitempty"`
	Type                          string                        `json:"type"`
	Group                         string                        `json:"group,omitempty"`
	Severity                      string                        `json:"severity"`
	TeamID                        int                           `json:"teamId,omitempty"`
	Enabled                       bool                          `json:"enabled"`
	NotificationChannelConfigList []NotificationChannelConfigV2 `json:"notificationChannelConfigList"`
	CustomNotificationTemplate    *CustomNotificationTemplateV2 `json:"customNotificationTemplate,omitempty"`
	CaptureConfig                 *CaptureConfigV2              `json:"captureConfig,omitempty"`
	Links                         []AlertLinkV2                 `json:"links"`
}

type AlertV2ConfigChange added in v1.12.0

type AlertV2ConfigChange struct {
	ScopedSegmentedConfig

	ConditionOperator        string   `json:"conditionOperator"`
	Threshold                float64  `json:"threshold"`
	WarningConditionOperator string   `json:"warningConditionOperator,omitempty"`
	WarningThreshold         *float64 `json:"warningThreshold,omitempty"`

	GroupAggregation string                  `json:"groupAggregation"`
	TimeAggregation  string                  `json:"timeAggregation"`
	Metric           AlertMetricDescriptorV2 `json:"metric"`

	ShorterRangeSec int `json:"shorterRangeSec"`
	LongerRangeSec  int `json:"longerRangeSec"`
}

type AlertV2ConfigDowntime added in v1.6.0

type AlertV2ConfigDowntime struct {
	ScopedSegmentedConfig

	ConditionOperator string  `json:"conditionOperator"`
	Threshold         float64 `json:"threshold"`

	GroupAggregation string                  `json:"groupAggregation"`
	TimeAggregation  string                  `json:"timeAggregation"`
	Metric           AlertMetricDescriptorV2 `json:"metric"`
	NoDataBehaviour  string                  `json:"noDataBehaviour"`
}

type AlertV2ConfigEvent added in v1.6.0

type AlertV2ConfigEvent struct {
	ScopedSegmentedConfig

	ConditionOperator        string   `json:"conditionOperator"`
	Threshold                float64  `json:"threshold"`
	WarningConditionOperator string   `json:"warningConditionOperator,omitempty"`
	WarningThreshold         *float64 `json:"warningThreshold,omitempty"`

	Filter string   `json:"filter"`
	Tags   []string `json:"tags"`
}

type AlertV2ConfigFormBasedPrometheus added in v1.12.0

type AlertV2ConfigFormBasedPrometheus struct {
	ScopedSegmentedConfig

	Query                    string   `json:"query"`
	ConditionOperator        string   `json:"conditionOperator"`
	Threshold                float64  `json:"threshold"`
	WarningConditionOperator string   `json:"warningConditionOperator,omitempty"`
	WarningThreshold         *float64 `json:"warningThreshold,omitempty"`
	NoDataBehaviour          string   `json:"noDataBehaviour"`
}

type AlertV2ConfigGroupOutlier added in v1.20.0

type AlertV2ConfigGroupOutlier struct {
	ScopedSegmentedConfig

	Algorithm       string  `json:"algorithm"`
	MadThreshold    float64 `json:"madThreshold,omitempty"`
	MadTolerance    float64 `json:"madTolerance,omitempty"`
	DbscanTolerance float64 `json:"dbscanTolerance,omitempty"`

	GroupAggregation string                  `json:"groupAggregation"`
	TimeAggregation  string                  `json:"timeAggregation"`
	Metric           AlertMetricDescriptorV2 `json:"metric"`
	NoDataBehaviour  string                  `json:"noDataBehaviour"`
}

type AlertV2ConfigMetric added in v1.6.0

type AlertV2ConfigMetric struct {
	ScopedSegmentedConfig

	ConditionOperator        string   `json:"conditionOperator"`
	Threshold                float64  `json:"threshold"`
	WarningConditionOperator string   `json:"warningConditionOperator,omitempty"`
	WarningThreshold         *float64 `json:"warningThreshold,omitempty"`

	GroupAggregation string                  `json:"groupAggregation"`
	TimeAggregation  string                  `json:"timeAggregation"`
	Metric           AlertMetricDescriptorV2 `json:"metric"`
	NoDataBehaviour  string                  `json:"noDataBehaviour"`
}

type AlertV2ConfigPrometheus added in v1.6.0

type AlertV2ConfigPrometheus struct {
	Query            string `json:"query"`
	KeepFiringForSec *int   `json:"keepFiringForSec,omitempty"`
}

type AlertV2Downtime added in v1.6.0

type AlertV2Downtime struct {
	AlertV2Common
	DurationSec                              int                   `json:"durationSec"`
	Config                                   AlertV2ConfigDowntime `json:"config"`
	UnreportedAlertNotificationsRetentionSec *int                  `json:"unreportedAlertNotificationsRetentionSec"`
}

type AlertV2DowntimeInterface added in v1.6.0

type AlertV2DowntimeInterface interface {
	Base
	CreateAlertV2Downtime(ctx context.Context, alert AlertV2Downtime) (AlertV2Downtime, error)
	UpdateAlertV2Downtime(ctx context.Context, alert AlertV2Downtime) (AlertV2Downtime, error)
	GetAlertV2Downtime(ctx context.Context, alertID int) (AlertV2Downtime, error)
	DeleteAlertV2Downtime(ctx context.Context, alertID int) error
}

type AlertV2Event added in v1.6.0

type AlertV2Event struct {
	AlertV2Common
	DurationSec int                `json:"durationSec"`
	Config      AlertV2ConfigEvent `json:"config"`
}

type AlertV2EventInterface added in v1.6.0

type AlertV2EventInterface interface {
	Base
	CreateAlertV2Event(ctx context.Context, alert AlertV2Event) (AlertV2Event, error)
	UpdateAlertV2Event(ctx context.Context, alert AlertV2Event) (AlertV2Event, error)
	GetAlertV2Event(ctx context.Context, alertID int) (AlertV2Event, error)
	DeleteAlertV2Event(ctx context.Context, alertID int) error
}

type AlertV2FormBasedPrometheus added in v1.12.0

type AlertV2FormBasedPrometheus struct {
	AlertV2Common
	DurationSec                              int                              `json:"durationSec"` // not really used but the api wants it set to 0 in POST/PUT
	Config                                   AlertV2ConfigFormBasedPrometheus `json:"config"`
	UnreportedAlertNotificationsRetentionSec *int                             `json:"unreportedAlertNotificationsRetentionSec"`
}

type AlertV2FormBasedPrometheusInterface added in v1.12.0

type AlertV2FormBasedPrometheusInterface interface {
	Base
	CreateAlertV2FormBasedPrometheus(ctx context.Context, alert AlertV2FormBasedPrometheus) (AlertV2FormBasedPrometheus, error)
	UpdateAlertV2FormBasedPrometheus(ctx context.Context, alert AlertV2FormBasedPrometheus) (AlertV2FormBasedPrometheus, error)
	GetAlertV2FormBasedPrometheus(ctx context.Context, alertID int) (AlertV2FormBasedPrometheus, error)
	DeleteAlertV2FormBasedPrometheus(ctx context.Context, alertID int) error
}

type AlertV2GroupOutlier added in v1.20.0

type AlertV2GroupOutlier struct {
	AlertV2Common
	DurationSec                              int                       `json:"durationSec"` // Observation window should be greater than or equal to 10 minutes
	Config                                   AlertV2ConfigGroupOutlier `json:"config"`
	UnreportedAlertNotificationsRetentionSec *int                      `json:"unreportedAlertNotificationsRetentionSec"`
}

type AlertV2GroupOutlierInterface added in v1.20.0

type AlertV2GroupOutlierInterface interface {
	Base
	CreateAlertV2GroupOutlier(ctx context.Context, alert AlertV2GroupOutlier) (AlertV2GroupOutlier, error)
	UpdateAlertV2GroupOutlier(ctx context.Context, alert AlertV2GroupOutlier) (AlertV2GroupOutlier, error)
	GetAlertV2GroupOutlier(ctx context.Context, alertID int) (AlertV2GroupOutlier, error)
	DeleteAlertV2GroupOutlier(ctx context.Context, alertID int) error
}

type AlertV2Metric added in v1.6.0

type AlertV2Metric struct {
	AlertV2Common
	DurationSec                              int                 `json:"durationSec"`
	Config                                   AlertV2ConfigMetric `json:"config"`
	UnreportedAlertNotificationsRetentionSec *int                `json:"unreportedAlertNotificationsRetentionSec"`
}

type AlertV2MetricInterface added in v1.6.0

type AlertV2MetricInterface interface {
	Base
	CreateAlertV2Metric(ctx context.Context, alert AlertV2Metric) (AlertV2Metric, error)
	UpdateAlertV2Metric(ctx context.Context, alert AlertV2Metric) (AlertV2Metric, error)
	GetAlertV2Metric(ctx context.Context, alertID int) (AlertV2Metric, error)
	DeleteAlertV2Metric(ctx context.Context, alertID int) error
}

type AlertV2Prometheus added in v1.6.0

type AlertV2Prometheus struct {
	AlertV2Common
	DurationSec int                     `json:"durationSec"`
	Config      AlertV2ConfigPrometheus `json:"config"`
}

type AlertV2PrometheusInterface added in v1.6.0

type AlertV2PrometheusInterface interface {
	Base
	CreateAlertV2Prometheus(ctx context.Context, alert AlertV2Prometheus) (AlertV2Prometheus, error)
	UpdateAlertV2Prometheus(ctx context.Context, alert AlertV2Prometheus) (AlertV2Prometheus, error)
	GetAlertV2Prometheus(ctx context.Context, alertID int) (AlertV2Prometheus, error)
	DeleteAlertV2Prometheus(ctx context.Context, alertID int) error
}

type AlertV2Severity added in v1.6.0

type AlertV2Severity string

type AlertV2Type added in v1.6.0

type AlertV2Type string

type AxesConfiguration added in v1.5.0

type AxesConfiguration struct {
	Bottom Bottom `json:"bottom"`
	Left   Left   `json:"left"`
	Right  Right  `json:"right"`
}

type Base added in v1.3.0

type Base interface {
	CurrentTeamID(ctx context.Context) (int, error)
}

type Bottom added in v1.5.0

type Bottom struct {
	Enabled bool `json:"enabled"`
}

type CaptureConfigV2 added in v1.6.0

type CaptureConfigV2 struct {
	DurationSec int    `json:"durationSec"`
	Storage     string `json:"storage"`
	Filter      string `json:"filter"`
	FileName    string `json:"fileName"`
	Enabled     bool   `json:"enabled"`
}

type Client

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

func (*Client) CreateAgentAccessKey added in v1.24.0

func (client *Client) CreateAgentAccessKey(ctx context.Context, agentAccessKey *AgentAccessKey) (*AgentAccessKey, error)

func (*Client) CreateAlert added in v1.4.0

func (client *Client) CreateAlert(ctx context.Context, alert Alert) (Alert, error)

func (*Client) CreateAlertURL added in v1.4.0

func (client *Client) CreateAlertURL() string

func (*Client) CreateAlertV2Change added in v1.12.0

func (client *Client) CreateAlertV2Change(ctx context.Context, alert AlertV2Change) (AlertV2Change, error)

func (*Client) CreateAlertV2Downtime added in v1.6.0

func (client *Client) CreateAlertV2Downtime(ctx context.Context, alert AlertV2Downtime) (AlertV2Downtime, error)

func (*Client) CreateAlertV2Event added in v1.6.0

func (client *Client) CreateAlertV2Event(ctx context.Context, alert AlertV2Event) (AlertV2Event, error)

func (*Client) CreateAlertV2FormBasedPrometheus added in v1.12.0

func (client *Client) CreateAlertV2FormBasedPrometheus(ctx context.Context, alert AlertV2FormBasedPrometheus) (AlertV2FormBasedPrometheus, error)

func (*Client) CreateAlertV2GroupOutlier added in v1.20.0

func (client *Client) CreateAlertV2GroupOutlier(ctx context.Context, alert AlertV2GroupOutlier) (AlertV2GroupOutlier, error)

func (*Client) CreateAlertV2Metric added in v1.6.0

func (client *Client) CreateAlertV2Metric(ctx context.Context, alert AlertV2Metric) (AlertV2Metric, error)

func (*Client) CreateAlertV2Prometheus added in v1.6.0

func (client *Client) CreateAlertV2Prometheus(ctx context.Context, alert AlertV2Prometheus) (AlertV2Prometheus, error)

func (*Client) CreateCloudAccountMonitor added in v1.4.2

func (client *Client) CreateCloudAccountMonitor(ctx context.Context, provider *CloudAccountMonitor) (*CloudAccountMonitor, error)

func (*Client) CreateCloudAccountSecure added in v1.4.2

func (client *Client) CreateCloudAccountSecure(ctx context.Context, cloudAccount *CloudAccountSecure) (*CloudAccountSecure, error)

func (*Client) CreateCloudauthAccountSecure added in v1.15.0

func (client *Client) CreateCloudauthAccountSecure(ctx context.Context, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, string, error)

func (*Client) CreateCompositePolicy added in v1.23.0

func (client *Client) CreateCompositePolicy(ctx context.Context, policy PolicyRulesComposite) (PolicyRulesComposite, error)

func (*Client) CreateCompositePolicyURL added in v1.23.0

func (client *Client) CreateCompositePolicyURL() string

func (*Client) CreateCustomRole added in v1.11.0

func (client *Client) CreateCustomRole(ctx context.Context, cr *CustomRole) (*CustomRole, error)

func (*Client) CreateCustomRoleURL added in v1.11.0

func (client *Client) CreateCustomRoleURL() string

func (*Client) CreateDashboard added in v1.5.0

func (client *Client) CreateDashboard(ctx context.Context, dashboard *Dashboard) (*Dashboard, error)

func (*Client) CreateGroupMapping added in v1.4.0

func (client *Client) CreateGroupMapping(ctx context.Context, gm *GroupMapping) (*GroupMapping, error)

func (*Client) CreateGroupMappingURL added in v1.4.0

func (client *Client) CreateGroupMappingURL() string

func (*Client) CreateList added in v1.4.1

func (client *Client) CreateList(ctx context.Context, list List) (List, error)

func (*Client) CreateListURL added in v1.4.1

func (client *Client) CreateListURL() string

func (*Client) CreateMacro added in v1.4.1

func (client *Client) CreateMacro(ctx context.Context, macro Macro) (Macro, error)

func (*Client) CreateMacroURL added in v1.4.1

func (client *Client) CreateMacroURL() string

func (*Client) CreateNotificationChannel added in v1.2.0

func (client *Client) CreateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)

func (*Client) CreateOrUpdatePostureZone added in v1.10.0

func (client *Client) CreateOrUpdatePostureZone(ctx context.Context, r *PostureZoneRequest) (*PostureZone, string, error)

func (*Client) CreateOrganizationSecure added in v1.15.0

func (client *Client) CreateOrganizationSecure(ctx context.Context, org *OrganizationSecure) (*OrganizationSecure, string, error)

func (*Client) CreatePolicy added in v1.4.1

func (client *Client) CreatePolicy(ctx context.Context, policy Policy) (Policy, error)

func (*Client) CreatePolicyURL added in v1.4.1

func (client *Client) CreatePolicyURL() string

func (*Client) CreateRule added in v1.4.2

func (client *Client) CreateRule(ctx context.Context, rule Rule) (Rule, error)

func (*Client) CreateRuleURL added in v1.4.2

func (client *Client) CreateRuleURL() string

func (*Client) CreateScanningPolicy added in v1.4.2

func (client *Client) CreateScanningPolicy(ctx context.Context, scanningPolicy ScanningPolicy) (ScanningPolicy, error)

func (*Client) CreateScanningPolicyAssignmentList added in v1.4.2

func (client *Client) CreateScanningPolicyAssignmentList(ctx context.Context, scanningPolicyAssignmentList ScanningPolicyAssignmentList) (ScanningPolicyAssignmentList, error)

func (*Client) CreateSilenceRule added in v1.12.0

func (client *Client) CreateSilenceRule(ctx context.Context, silenceRule SilenceRule) (SilenceRule, error)

func (*Client) CreateTeam

func (client *Client) CreateTeam(ctx context.Context, team Team) (Team, error)

func (*Client) CreateTeamServiceAccount added in v1.11.0

func (client *Client) CreateTeamServiceAccount(ctx context.Context, account *TeamServiceAccount) (*TeamServiceAccount, error)

func (*Client) CreateTeamServiceAccountURL added in v1.11.0

func (client *Client) CreateTeamServiceAccountURL() string

func (*Client) CreateUser added in v1.4.0

func (client *Client) CreateUser(ctx context.Context, user *User) (*User, error)

func (*Client) CreateUsersURL added in v1.4.0

func (client *Client) CreateUsersURL() string

func (*Client) CreateVulnerabilityException added in v1.4.2

func (client *Client) CreateVulnerabilityException(ctx context.Context, listID string, exception *VulnerabilityException) (*VulnerabilityException, error)

func (*Client) CreateVulnerabilityExceptionList added in v1.4.2

func (client *Client) CreateVulnerabilityExceptionList(ctx context.Context, list *VulnerabilityExceptionList) (*VulnerabilityExceptionList, error)

func (*Client) CreateVulnerabilityExceptionListURL added in v1.4.2

func (client *Client) CreateVulnerabilityExceptionListURL() string

func (*Client) CreateVulnerabilityExceptionURL added in v1.4.2

func (client *Client) CreateVulnerabilityExceptionURL(listID string) string

func (*Client) CurrentTeamID added in v1.3.0

func (client *Client) CurrentTeamID(ctx context.Context) (int, error)

func (*Client) DeleteAgentAccessKey added in v1.24.0

func (client *Client) DeleteAgentAccessKey(ctx context.Context, id string) error

func (*Client) DeleteAgentAccessKeyUrl added in v1.24.0

func (client *Client) DeleteAgentAccessKeyUrl(id string) string

func (*Client) DeleteAlert added in v1.4.0

func (client *Client) DeleteAlert(ctx context.Context, alertID int) error

func (*Client) DeleteAlertURL added in v1.4.0

func (client *Client) DeleteAlertURL(alertID int) string

func (*Client) DeleteAlertV2Change added in v1.12.0

func (client *Client) DeleteAlertV2Change(ctx context.Context, alertID int) error

func (*Client) DeleteAlertV2Downtime added in v1.6.0

func (client *Client) DeleteAlertV2Downtime(ctx context.Context, alertID int) error

func (*Client) DeleteAlertV2Event added in v1.6.0

func (client *Client) DeleteAlertV2Event(ctx context.Context, alertID int) error

func (*Client) DeleteAlertV2FormBasedPrometheus added in v1.12.0

func (client *Client) DeleteAlertV2FormBasedPrometheus(ctx context.Context, alertID int) error

func (*Client) DeleteAlertV2GroupOutlier added in v1.20.0

func (client *Client) DeleteAlertV2GroupOutlier(ctx context.Context, alertID int) error

func (*Client) DeleteAlertV2Metric added in v1.6.0

func (client *Client) DeleteAlertV2Metric(ctx context.Context, alertID int) error

func (*Client) DeleteAlertV2Prometheus added in v1.6.0

func (client *Client) DeleteAlertV2Prometheus(ctx context.Context, alertID int) error

func (*Client) DeleteCloudAccountMonitor added in v1.4.2

func (client *Client) DeleteCloudAccountMonitor(ctx context.Context, id int) error

func (*Client) DeleteCloudAccountSecure added in v1.4.2

func (client *Client) DeleteCloudAccountSecure(ctx context.Context, accountID string) error

func (*Client) DeleteCloudauthAccountSecure added in v1.15.0

func (client *Client) DeleteCloudauthAccountSecure(ctx context.Context, accountID string) (string, error)

func (*Client) DeleteCompositePolicy added in v1.23.0

func (client *Client) DeleteCompositePolicy(ctx context.Context, policyID int) error

func (*Client) DeleteCompositePolicyURL added in v1.23.0

func (client *Client) DeleteCompositePolicyURL(policyID int) string

func (*Client) DeleteCustomRole added in v1.11.0

func (client *Client) DeleteCustomRole(ctx context.Context, id int) error

func (*Client) DeleteCustomRoleURL added in v1.11.0

func (client *Client) DeleteCustomRoleURL(id int) string

func (*Client) DeleteDashboard added in v1.5.0

func (client *Client) DeleteDashboard(ctx context.Context, ID int) error

func (*Client) DeleteGroupMapping added in v1.4.0

func (client *Client) DeleteGroupMapping(ctx context.Context, id int) error

func (*Client) DeleteGroupMappingURL added in v1.4.0

func (client *Client) DeleteGroupMappingURL(id int) string

func (*Client) DeleteList added in v1.4.1

func (client *Client) DeleteList(ctx context.Context, id int) error

func (*Client) DeleteListURL added in v1.4.1

func (client *Client) DeleteListURL(id int) string

func (*Client) DeleteMacro added in v1.4.1

func (client *Client) DeleteMacro(ctx context.Context, id int) error

func (*Client) DeleteMacroURL added in v1.4.1

func (client *Client) DeleteMacroURL(id int) string

func (*Client) DeleteNotificationChannel added in v1.2.0

func (client *Client) DeleteNotificationChannel(ctx context.Context, id int) error

func (*Client) DeleteOrganizationSecure added in v1.15.0

func (client *Client) DeleteOrganizationSecure(ctx context.Context, orgID string) (string, error)

func (*Client) DeletePolicy added in v1.4.1

func (client *Client) DeletePolicy(ctx context.Context, policyID int) error

func (*Client) DeletePolicyURL added in v1.4.1

func (client *Client) DeletePolicyURL(policyID int) string

func (*Client) DeletePostureZone added in v1.10.0

func (client *Client) DeletePostureZone(ctx context.Context, id int) error

func (*Client) DeleteRule added in v1.4.2

func (client *Client) DeleteRule(ctx context.Context, ruleID int) error

func (*Client) DeleteRuleURL added in v1.4.2

func (client *Client) DeleteRuleURL(ruleID int) string

func (*Client) DeleteScanningPolicyAssignmentList added in v1.4.2

func (client *Client) DeleteScanningPolicyAssignmentList(ctx context.Context, scanningPolicyAssignmentList ScanningPolicyAssignmentList) error

func (*Client) DeleteScanningPolicyByID added in v1.4.2

func (client *Client) DeleteScanningPolicyByID(ctx context.Context, scanningPolicyID string) error

func (*Client) DeleteSilenceRule added in v1.12.0

func (client *Client) DeleteSilenceRule(ctx context.Context, id int) error

func (*Client) DeleteTeam

func (client *Client) DeleteTeam(ctx context.Context, id int) error

func (*Client) DeleteTeamServiceAccount added in v1.11.0

func (client *Client) DeleteTeamServiceAccount(ctx context.Context, id int) error

func (*Client) DeleteTeamServiceAccountURL added in v1.11.0

func (client *Client) DeleteTeamServiceAccountURL(id int) string

func (*Client) DeleteUser added in v1.4.0

func (client *Client) DeleteUser(ctx context.Context, id int) error

func (*Client) DeleteUserURL added in v1.4.0

func (client *Client) DeleteUserURL(id int) string

func (*Client) DeleteVulnerabilityException added in v1.4.2

func (client *Client) DeleteVulnerabilityException(ctx context.Context, listID string, exceptionID string) error

func (*Client) DeleteVulnerabilityExceptionList added in v1.4.2

func (client *Client) DeleteVulnerabilityExceptionList(ctx context.Context, id string) error

func (*Client) DeleteVulnerabilityExceptionListURL added in v1.4.2

func (client *Client) DeleteVulnerabilityExceptionListURL(id string) string

func (*Client) DeleteVulnerabilityExceptionURL added in v1.4.2

func (client *Client) DeleteVulnerabilityExceptionURL(listID, ID string) string

func (*Client) ErrorAndStatusFromResponse added in v1.15.0

func (client *Client) ErrorAndStatusFromResponse(response *http.Response) (string, error)

func (*Client) ErrorFromResponse

func (client *Client) ErrorFromResponse(response *http.Response) error

func (*Client) FilterCompositePoliciesByNameAndType added in v1.23.0

func (client *Client) FilterCompositePoliciesByNameAndType(ctx context.Context, policyType string, policyName string) ([]PolicyRulesComposite, int, error)

This method is used in a data source to retrieve a policy by name and type. We must retrieve and iterate over all policies, as there is no endpoint to get a policy by name.

func (*Client) GetAgentAccessKeyByID added in v1.24.0

func (client *Client) GetAgentAccessKeyByID(ctx context.Context, id string) (*AgentAccessKey, error)

func (*Client) GetAgentAccessKeyByIdUrl added in v1.24.0

func (client *Client) GetAgentAccessKeyByIdUrl(id string) string

func (*Client) GetAlertByID added in v1.4.0

func (client *Client) GetAlertByID(ctx context.Context, alertID int) (Alert, error)

func (*Client) GetAlertByIDURL added in v1.4.0

func (client *Client) GetAlertByIDURL(alertID int) string

func (*Client) GetAlertV2Change added in v1.12.0

func (client *Client) GetAlertV2Change(ctx context.Context, alertID int) (AlertV2Change, error)

func (*Client) GetAlertV2Downtime added in v1.6.0

func (client *Client) GetAlertV2Downtime(ctx context.Context, alertID int) (AlertV2Downtime, error)

func (*Client) GetAlertV2Event added in v1.6.0

func (client *Client) GetAlertV2Event(ctx context.Context, alertID int) (AlertV2Event, error)

func (*Client) GetAlertV2FormBasedPrometheus added in v1.12.0

func (client *Client) GetAlertV2FormBasedPrometheus(ctx context.Context, alertID int) (AlertV2FormBasedPrometheus, error)

func (*Client) GetAlertV2GroupOutlier added in v1.20.0

func (client *Client) GetAlertV2GroupOutlier(ctx context.Context, alertID int) (AlertV2GroupOutlier, error)

func (*Client) GetAlertV2Metric added in v1.6.0

func (client *Client) GetAlertV2Metric(ctx context.Context, alertID int) (AlertV2Metric, error)

func (*Client) GetAlertV2Prometheus added in v1.6.0

func (client *Client) GetAlertV2Prometheus(ctx context.Context, alertID int) (AlertV2Prometheus, error)

func (*Client) GetCloudAccountMonitor added in v1.4.2

func (client *Client) GetCloudAccountMonitor(ctx context.Context, id int) (*CloudAccountMonitor, error)

func (*Client) GetCloudAccountSecure added in v1.4.2

func (client *Client) GetCloudAccountSecure(ctx context.Context, accountID string) (*CloudAccountSecure, error)

func (*Client) GetCloudauthAccountSecure added in v1.15.0

func (client *Client) GetCloudauthAccountSecure(ctx context.Context, accountID string) (*CloudauthAccountSecure, string, error)

func (*Client) GetCompositePoliciesURL added in v1.23.0

func (client *Client) GetCompositePoliciesURL(queryParams GetPoliciesQueryParams) string

func (*Client) GetCompositePolicyByID added in v1.23.0

func (client *Client) GetCompositePolicyByID(ctx context.Context, policyID int) (PolicyRulesComposite, int, error)

func (*Client) GetCompositePolicyRulesByName added in v1.23.0

func (client *Client) GetCompositePolicyRulesByName(ctx context.Context, names []string) ([]*RuntimePolicyRule, int, error)

func (*Client) GetCompositePolicyRulesURL added in v1.23.0

func (client *Client) GetCompositePolicyRulesURL(names []string) string

func (*Client) GetCompositePolicyURL added in v1.23.0

func (client *Client) GetCompositePolicyURL(policyID int) string

func (*Client) GetCurrentUser added in v1.4.0

func (client *Client) GetCurrentUser(ctx context.Context) (u *User, err error)

func (*Client) GetCurrentUserURL added in v1.4.0

func (client *Client) GetCurrentUserURL() string

func (*Client) GetCustomRole added in v1.11.0

func (client *Client) GetCustomRole(ctx context.Context, id int) (*CustomRole, error)

func (*Client) GetCustomRoleByName added in v1.11.0

func (client *Client) GetCustomRoleByName(ctx context.Context, name string) (*CustomRole, error)

func (*Client) GetCustomRoleURL added in v1.11.0

func (client *Client) GetCustomRoleURL(id int) string

func (*Client) GetCustomRolesURL added in v1.11.0

func (client *Client) GetCustomRolesURL() string

func (*Client) GetDashboard added in v1.5.0

func (client *Client) GetDashboard(ctx context.Context, ID int) (*Dashboard, error)

func (*Client) GetGroupMapping added in v1.4.0

func (client *Client) GetGroupMapping(ctx context.Context, id int) (*GroupMapping, error)

func (*Client) GetGroupMappingConfig added in v1.8.0

func (client *Client) GetGroupMappingConfig(ctx context.Context) (*GroupMappingConfig, error)

func (*Client) GetGroupMappingConfigURL added in v1.8.0

func (client *Client) GetGroupMappingConfigURL() string

func (*Client) GetGroupMappingURL added in v1.4.0

func (client *Client) GetGroupMappingURL(id int) string

func (*Client) GetIdentityContext added in v1.10.0

func (client *Client) GetIdentityContext(ctx context.Context) (*IdentityContext, error)

func (*Client) GetIdentityContextURL added in v1.10.0

func (client *Client) GetIdentityContextURL() string

func (*Client) GetListByID added in v1.4.1

func (client *Client) GetListByID(ctx context.Context, id int) (List, error)

func (*Client) GetListURL added in v1.4.1

func (client *Client) GetListURL(id int) string

func (*Client) GetMacroByID added in v1.4.1

func (client *Client) GetMacroByID(ctx context.Context, id int) (Macro, error)

func (*Client) GetMacroByIDURL added in v1.4.1

func (client *Client) GetMacroByIDURL(id int) string

func (*Client) GetNotificationChannelById added in v1.2.0

func (client *Client) GetNotificationChannelById(ctx context.Context, id int) (NotificationChannel, error)

func (*Client) GetNotificationChannelByName added in v1.2.0

func (client *Client) GetNotificationChannelByName(ctx context.Context, name string) (NotificationChannel, error)

func (*Client) GetNotificationChannelUrl added in v1.2.0

func (client *Client) GetNotificationChannelUrl(id int) string

func (*Client) GetNotificationChannelsUrl added in v1.2.0

func (client *Client) GetNotificationChannelsUrl() string

func (*Client) GetOrganizationSecure added in v1.15.0

func (client *Client) GetOrganizationSecure(ctx context.Context, orgID string) (*OrganizationSecure, string, error)

func (*Client) GetPermissionsDependencies added in v1.11.0

func (client *Client) GetPermissionsDependencies(ctx context.Context, product Product, permissions []string) ([]Dependency, error)

func (*Client) GetPolicies added in v1.5.0

func (client *Client) GetPolicies(ctx context.Context) ([]Policy, int, error)

func (*Client) GetPoliciesURL added in v1.5.0

func (client *Client) GetPoliciesURL() string

func (*Client) GetPolicyByID added in v1.4.1

func (client *Client) GetPolicyByID(ctx context.Context, policyID int) (Policy, int, error)

func (*Client) GetPolicyURL added in v1.4.1

func (client *Client) GetPolicyURL(policyID int) string

func (*Client) GetPostureZone added in v1.10.0

func (client *Client) GetPostureZone(ctx context.Context, id int) (*PostureZone, error)

func (*Client) GetRuleByID added in v1.4.2

func (client *Client) GetRuleByID(ctx context.Context, ruleID int) (Rule, int, error)

func (*Client) GetRuleByIDURL added in v1.4.2

func (client *Client) GetRuleByIDURL(ruleID int) string

func (*Client) GetRuleGroup added in v1.7.0

func (client *Client) GetRuleGroup(ctx context.Context, ruleName string, ruleType string) ([]Rule, error)

func (*Client) GetRuleGroupURL added in v1.7.0

func (client *Client) GetRuleGroupURL(ruleName string, ruleType string) string

func (*Client) GetScanningPolicyAssignmentList added in v1.4.2

func (client *Client) GetScanningPolicyAssignmentList(ctx context.Context) (ScanningPolicyAssignmentList, error)

func (*Client) GetScanningPolicyByID added in v1.4.2

func (client *Client) GetScanningPolicyByID(ctx context.Context, scanningPolicyID string) (ScanningPolicy, error)

func (*Client) GetSilenceRule added in v1.12.0

func (client *Client) GetSilenceRule(ctx context.Context, id int) (SilenceRule, error)

func (*Client) GetTeamById

func (client *Client) GetTeamById(ctx context.Context, id int) (Team, error)

func (*Client) GetTeamServiceAccountByID added in v1.11.0

func (client *Client) GetTeamServiceAccountByID(ctx context.Context, id int) (*TeamServiceAccount, error)

func (*Client) GetTeamServiceAccountURL added in v1.11.0

func (client *Client) GetTeamServiceAccountURL(id int) string

func (*Client) GetTeamURL

func (client *Client) GetTeamURL(id int) string

func (*Client) GetTeamsURL

func (client *Client) GetTeamsURL() string

func (*Client) GetTrustedCloudIdentitySecure added in v1.4.2

func (client *Client) GetTrustedCloudIdentitySecure(ctx context.Context, provider string) (string, error)

func (*Client) GetUserByEmail added in v1.4.0

func (client *Client) GetUserByEmail(ctx context.Context, email string) (*User, error)

func (*Client) GetUserById added in v1.4.0

func (client *Client) GetUserById(ctx context.Context, id int) (*User, error)

func (*Client) GetUserByUsername added in v1.4.0

func (client *Client) GetUserByUsername(ctx context.Context, username string) (*User, error)

func (*Client) GetUserByUsernameURL added in v1.4.0

func (client *Client) GetUserByUsernameURL(username string) string

func (*Client) GetUserIDByEmail

func (client *Client) GetUserIDByEmail(ctx context.Context, userRoles []UserRoles) ([]UserRoles, error)

func (*Client) GetUserUrl added in v1.4.0

func (client *Client) GetUserUrl(id int) string

func (*Client) GetUsersLightURL

func (client *Client) GetUsersLightURL() string

func (*Client) GetUsersUrl added in v1.4.0

func (client *Client) GetUsersUrl() string

func (*Client) GetVulnerabilityExceptionByID added in v1.4.2

func (client *Client) GetVulnerabilityExceptionByID(ctx context.Context, listID string, exceptionID string) (*VulnerabilityException, error)

func (*Client) GetVulnerabilityExceptionListByID added in v1.4.2

func (client *Client) GetVulnerabilityExceptionListByID(ctx context.Context, id string) (*VulnerabilityExceptionList, error)

func (*Client) GetVulnerabilityExceptionListURL added in v1.4.2

func (client *Client) GetVulnerabilityExceptionListURL(id string) string

func (*Client) GetVulnerabilityExceptionURL added in v1.4.2

func (client *Client) GetVulnerabilityExceptionURL(listID, ID string) string

func (*Client) ListPosturePolicies added in v1.10.0

func (client *Client) ListPosturePolicies(ctx context.Context) ([]PosturePolicy, error)

func (*Client) PostAgentAccessKeyUrl added in v1.24.0

func (client *Client) PostAgentAccessKeyUrl() string

func (*Client) PutAgentAccessKeyUrl added in v1.24.0

func (client *Client) PutAgentAccessKeyUrl(id string) string

func (*Client) SendPoliciesToAgents added in v1.14.0

func (client *Client) SendPoliciesToAgents(ctx context.Context) error

func (*Client) SendPoliciesToAgentsURL added in v1.14.0

func (client *Client) SendPoliciesToAgentsURL() string

func (*Client) UpdateAgentAccessKey added in v1.24.0

func (client *Client) UpdateAgentAccessKey(ctx context.Context, agentAccessKey *AgentAccessKey, id string) (*AgentAccessKey, error)

func (*Client) UpdateAlert added in v1.4.0

func (client *Client) UpdateAlert(ctx context.Context, alert Alert) (Alert, error)

func (*Client) UpdateAlertURL added in v1.4.0

func (client *Client) UpdateAlertURL(alertID int) string

func (*Client) UpdateAlertV2Change added in v1.12.0

func (client *Client) UpdateAlertV2Change(ctx context.Context, alert AlertV2Change) (AlertV2Change, error)

func (*Client) UpdateAlertV2Downtime added in v1.6.0

func (client *Client) UpdateAlertV2Downtime(ctx context.Context, alert AlertV2Downtime) (AlertV2Downtime, error)

func (*Client) UpdateAlertV2Event added in v1.6.0

func (client *Client) UpdateAlertV2Event(ctx context.Context, alert AlertV2Event) (AlertV2Event, error)

func (*Client) UpdateAlertV2FormBasedPrometheus added in v1.12.0

func (client *Client) UpdateAlertV2FormBasedPrometheus(ctx context.Context, alert AlertV2FormBasedPrometheus) (AlertV2FormBasedPrometheus, error)

func (*Client) UpdateAlertV2GroupOutlier added in v1.20.0

func (client *Client) UpdateAlertV2GroupOutlier(ctx context.Context, alert AlertV2GroupOutlier) (AlertV2GroupOutlier, error)

func (*Client) UpdateAlertV2Metric added in v1.6.0

func (client *Client) UpdateAlertV2Metric(ctx context.Context, alert AlertV2Metric) (AlertV2Metric, error)

func (*Client) UpdateAlertV2Prometheus added in v1.6.0

func (client *Client) UpdateAlertV2Prometheus(ctx context.Context, alert AlertV2Prometheus) (AlertV2Prometheus, error)

func (*Client) UpdateCloudAccountMonitor added in v1.4.2

func (client *Client) UpdateCloudAccountMonitor(ctx context.Context, id int, provider *CloudAccountMonitor) (*CloudAccountMonitor, error)

func (*Client) UpdateCloudAccountSecure added in v1.4.2

func (client *Client) UpdateCloudAccountSecure(ctx context.Context, accountID string, cloudAccount *CloudAccountSecure) (*CloudAccountSecure, error)

func (*Client) UpdateCloudauthAccountSecure added in v1.15.0

func (client *Client) UpdateCloudauthAccountSecure(ctx context.Context, accountID string, cloudAccount *CloudauthAccountSecure) (
	*CloudauthAccountSecure, string, error)

func (*Client) UpdateCompositePolicy added in v1.23.0

func (client *Client) UpdateCompositePolicy(ctx context.Context, policy PolicyRulesComposite) (PolicyRulesComposite, error)

func (*Client) UpdateCompositePolicyURL added in v1.23.0

func (client *Client) UpdateCompositePolicyURL(policyID int) string

func (*Client) UpdateCustomRole added in v1.11.0

func (client *Client) UpdateCustomRole(ctx context.Context, cr *CustomRole, id int) (*CustomRole, error)

func (*Client) UpdateCustomRoleURL added in v1.11.0

func (client *Client) UpdateCustomRoleURL(id int) string

func (*Client) UpdateDashboard added in v1.5.0

func (client *Client) UpdateDashboard(ctx context.Context, dashboard *Dashboard) (*Dashboard, error)

func (*Client) UpdateGroupMapping added in v1.4.0

func (client *Client) UpdateGroupMapping(ctx context.Context, gm *GroupMapping, id int) (*GroupMapping, error)

func (*Client) UpdateGroupMappingConfig added in v1.8.0

func (client *Client) UpdateGroupMappingConfig(ctx context.Context, gmc *GroupMappingConfig) (*GroupMappingConfig, error)

func (*Client) UpdateGroupMappingConfigURL added in v1.8.0

func (client *Client) UpdateGroupMappingConfigURL() string

func (*Client) UpdateGroupMappingURL added in v1.4.0

func (client *Client) UpdateGroupMappingURL(id int) string

func (*Client) UpdateList added in v1.4.1

func (client *Client) UpdateList(ctx context.Context, list List) (List, error)

func (*Client) UpdateListURL added in v1.4.1

func (client *Client) UpdateListURL(id int) string

func (*Client) UpdateMacro added in v1.4.1

func (client *Client) UpdateMacro(ctx context.Context, macro Macro) (Macro, error)

func (*Client) UpdateMacroURL added in v1.4.1

func (client *Client) UpdateMacroURL(id int) string

func (*Client) UpdateNotificationChannel added in v1.2.0

func (client *Client) UpdateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)

func (*Client) UpdateOrganizationSecure added in v1.15.0

func (client *Client) UpdateOrganizationSecure(ctx context.Context, orgID string, org *OrganizationSecure) (*OrganizationSecure, string, error)

func (*Client) UpdatePolicy added in v1.4.1

func (client *Client) UpdatePolicy(ctx context.Context, policy Policy) (Policy, error)

func (*Client) UpdatePolicyURL added in v1.4.1

func (client *Client) UpdatePolicyURL(policyID int) string

func (*Client) UpdateRule added in v1.4.2

func (client *Client) UpdateRule(ctx context.Context, rule Rule) (Rule, error)

func (*Client) UpdateRuleURL added in v1.4.2

func (client *Client) UpdateRuleURL(ruleID int) string

func (*Client) UpdateScanningPolicyByID added in v1.4.2

func (client *Client) UpdateScanningPolicyByID(ctx context.Context, scanningPolicy ScanningPolicy) (ScanningPolicy, error)

func (*Client) UpdateSilenceRule added in v1.12.0

func (client *Client) UpdateSilenceRule(ctx context.Context, silenceRule SilenceRule) (SilenceRule, error)

func (*Client) UpdateTeam

func (client *Client) UpdateTeam(ctx context.Context, team Team) (Team, error)

func (*Client) UpdateTeamServiceAccount added in v1.11.0

func (client *Client) UpdateTeamServiceAccount(ctx context.Context, account *TeamServiceAccount, id int) (*TeamServiceAccount, error)

func (*Client) UpdateTeamServiceAccountURL added in v1.11.0

func (client *Client) UpdateTeamServiceAccountURL(id int) string

func (*Client) UpdateUser added in v1.4.0

func (client *Client) UpdateUser(ctx context.Context, user *User) (*User, error)

func (*Client) UpdateUserURL added in v1.4.0

func (client *Client) UpdateUserURL(id int) string

func (*Client) UpdateVulnerabilityException added in v1.4.2

func (client *Client) UpdateVulnerabilityException(ctx context.Context, listID string, exception *VulnerabilityException) (*VulnerabilityException, error)

func (*Client) UpdateVulnerabilityExceptionList added in v1.4.2

func (client *Client) UpdateVulnerabilityExceptionList(ctx context.Context, list *VulnerabilityExceptionList) (*VulnerabilityExceptionList, error)

func (*Client) UpdateVulnerabilityExceptionListURL added in v1.4.2

func (client *Client) UpdateVulnerabilityExceptionListURL(id string) string

func (*Client) UpdateVulnerabilityExceptionURL added in v1.4.2

func (client *Client) UpdateVulnerabilityExceptionURL(listID, ID string) string

type ClientOption

type ClientOption func(c *config)

func WithExtraHeaders

func WithExtraHeaders(headers map[string]string) ClientOption

func WithIBMAPIKey added in v1.1.0

func WithIBMAPIKey(key string) ClientOption

func WithIBMIamURL added in v1.1.0

func WithIBMIamURL(url string) ClientOption

func WithIBMInstanceID added in v1.1.0

func WithIBMInstanceID(instanceID string) ClientOption

func WithInsecure

func WithInsecure(insecure bool) ClientOption

func WithMonitorProduct added in v1.8.0

func WithMonitorProduct() ClientOption

func WithSecureProduct added in v1.8.0

func WithSecureProduct() ClientOption

func WithSkipPolicyV2Msg added in v1.14.0

func WithSkipPolicyV2Msg(skipPolicyV2Msg bool) ClientOption

func WithSysdigTeamID added in v1.3.0

func WithSysdigTeamID(teamID *int) ClientOption

func WithSysdigTeamName added in v1.3.0

func WithSysdigTeamName(teamName string) ClientOption

func WithToken

func WithToken(token string) ClientOption

func WithURL

func WithURL(url string) ClientOption

type CloudAccountCredentialsMonitor added in v1.4.2

type CloudAccountCredentialsMonitor struct {
	AccountId string `json:"accountId"`
}

type CloudAccountMonitor added in v1.4.2

type CloudAccountMonitor struct {
	Id                int                            `json:"id"`
	Platform          string                         `json:"platform"`
	IntegrationType   string                         `json:"integrationType"`
	Credentials       CloudAccountCredentialsMonitor `json:"credentials"`
	AdditionalOptions string                         `json:"additionalOptions"`
}

type CloudAccountMonitorInterface added in v1.4.2

type CloudAccountMonitorInterface interface {
	Base
	CreateCloudAccountMonitor(ctx context.Context, provider *CloudAccountMonitor) (*CloudAccountMonitor, error)
	UpdateCloudAccountMonitor(ctx context.Context, id int, provider *CloudAccountMonitor) (*CloudAccountMonitor, error)
	GetCloudAccountMonitor(ctx context.Context, id int) (*CloudAccountMonitor, error)
	DeleteCloudAccountMonitor(ctx context.Context, id int) error
}

type CloudAccountSecure added in v1.4.2

type CloudAccountSecure struct {
	AccountID                    string `json:"accountId"`
	Provider                     string `json:"provider"`
	Alias                        string `json:"alias"`
	RoleAvailable                bool   `json:"roleAvailable"`
	RoleName                     string `json:"roleName"`
	ExternalID                   string `json:"externalId,omitempty"`
	WorkLoadIdentityAccountID    string `json:"workloadIdentityAccountId,omitempty"`
	WorkLoadIdentityAccountAlias string `json:"workLoadIdentityAccountAlias,omitempty"`
}

type CloudAccountSecureInterface added in v1.4.2

type CloudAccountSecureInterface interface {
	Base
	CreateCloudAccountSecure(ctx context.Context, cloudAccount *CloudAccountSecure) (*CloudAccountSecure, error)
	GetCloudAccountSecure(ctx context.Context, accountID string) (*CloudAccountSecure, error)
	DeleteCloudAccountSecure(ctx context.Context, accountID string) error
	UpdateCloudAccountSecure(ctx context.Context, accountID string, cloudAccount *CloudAccountSecure) (*CloudAccountSecure, error)
	GetTrustedCloudIdentitySecure(ctx context.Context, provider string) (string, error)
}

type CloudauthAccountSecure added in v1.15.0

type CloudauthAccountSecure struct {
	cloudauth.CloudAccount
}

type CloudauthAccountSecureInterface added in v1.15.0

type CloudauthAccountSecureInterface interface {
	Base
	CreateCloudauthAccountSecure(ctx context.Context, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, string, error)
	GetCloudauthAccountSecure(ctx context.Context, accountID string) (*CloudauthAccountSecure, string, error)
	DeleteCloudauthAccountSecure(ctx context.Context, accountID string) (string, error)
	UpdateCloudauthAccountSecure(ctx context.Context, accountID string, cloudAccount *CloudauthAccountSecure) (*CloudauthAccountSecure, string, error)
}

type CompositePolicyInterface added in v1.23.0

type CompositePolicyInterface interface {
	Base
	CreateCompositePolicy(ctx context.Context, policy PolicyRulesComposite) (PolicyRulesComposite, error)
	DeleteCompositePolicy(ctx context.Context, policyID int) error
	UpdateCompositePolicy(ctx context.Context, policy PolicyRulesComposite) (PolicyRulesComposite, error)
	GetCompositePolicyByID(ctx context.Context, policyID int) (PolicyRulesComposite, int, error)
	FilterCompositePoliciesByNameAndType(ctx context.Context, policyType string, policyName string) ([]PolicyRulesComposite, int, error)
}

type Condition added in v1.4.2

type Condition struct {
	Condition  string        `json:"condition"`
	Components []interface{} `json:"components"`
}

type Containers added in v1.4.2

type Containers struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type Criteria added in v1.4.0

type Criteria struct {
	Text   string `json:"text"`
	Source string `json:"source"`
}

type CustomNotification added in v1.4.0

type CustomNotification struct {
	TitleTemplate  string `json:"titleTemplate"`
	UseNewTemplate bool   `json:"useNewTemplate"`
	PrependText    string `json:"prependText,omitempty"`
	AppendText     string `json:"appendText,omitempty"`
}

type CustomNotificationTemplateV2 added in v1.6.0

type CustomNotificationTemplateV2 struct {
	Subject     string `json:"subject"`
	PrependText string `json:"prependText"`
	AppendText  string `json:"appendText"`
}

type CustomRole added in v1.11.0

type CustomRole struct {
	ID                 int      `json:"id,omitempty"`
	Name               string   `json:"name"`
	Description        string   `json:"description,omitempty"`
	MonitorPermissions []string `json:"monitorPermissions,omitempty"`
	SecurePermissions  []string `json:"securePermissions,omitempty"`
}

type CustomRoleInterface added in v1.11.0

type CustomRoleInterface interface {
	Base
	CreateCustomRole(ctx context.Context, cr *CustomRole) (*CustomRole, error)
	UpdateCustomRole(ctx context.Context, cr *CustomRole, id int) (*CustomRole, error)
	DeleteCustomRole(ctx context.Context, id int) error
	GetCustomRole(ctx context.Context, id int) (*CustomRole, error)
	GetCustomRoleByName(ctx context.Context, name string) (*CustomRole, error)
}

type CustomRolePermissionInterface added in v1.11.0

type CustomRolePermissionInterface interface {
	Base

	GetPermissionsDependencies(ctx context.Context, product Product, permissions []string) ([]Dependency, error)
}

type Dashboard added in v1.5.0

type Dashboard struct {
	Version                 int                    `json:"version,omitempty"`
	CustomerID              interface{}            `json:"customerId"`
	TeamID                  int                    `json:"teamId"`
	Schema                  int                    `json:"schema"`
	AutoCreated             bool                   `json:"autoCreated"`
	PublicToken             string                 `json:"publicToken"`
	ScopeExpressionList     []*ScopeExpressionList `json:"scopeExpressionList"`
	Layout                  []*Layout              `json:"layout"`
	TeamScope               interface{}            `json:"teamScope"`
	EventDisplaySettings    EventDisplaySettings   `json:"eventDisplaySettings"`
	ID                      int                    `json:"id,omitempty"`
	Name                    string                 `json:"name"`
	Description             string                 `json:"description"`
	Username                string                 `json:"username"`
	Shared                  bool                   `json:"shared"`
	SharingSettings         []*SharingOptions      `json:"sharingSettings"`
	Public                  bool                   `json:"public"`
	Favorite                bool                   `json:"favorite"`
	CreatedOn               int64                  `json:"createdOn"`
	ModifiedOn              int64                  `json:"modifiedOn"`
	Panels                  []*Panels              `json:"panels"`
	TeamScopeExpressionList []interface{}          `json:"teamScopeExpressionList"`
	CreatedOnDate           string                 `json:"createdOnDate"`
	ModifiedOnDate          string                 `json:"modifiedOnDate"`
	TeamSharingOptions      TeamSharingOptions     `json:"teamSharingOptions"`
	MinInterval             string                 `json:"minInterval"`
}

func NewDashboard added in v1.5.0

func NewDashboard(name, description string) *Dashboard

func (*Dashboard) AddPanels added in v1.5.0

func (db *Dashboard) AddPanels(panels ...*Panels)

func (*Dashboard) AsPublic added in v1.5.0

func (db *Dashboard) AsPublic(value bool) *Dashboard

type DashboardInterface added in v1.5.0

type DashboardInterface interface {
	GetDashboard(ctx context.Context, ID int) (*Dashboard, error)
	CreateDashboard(ctx context.Context, dashboard *Dashboard) (*Dashboard, error)
	UpdateDashboard(ctx context.Context, dashboard *Dashboard) (*Dashboard, error)
	DeleteDashboard(ctx context.Context, ID int) error
}

type Dependencies added in v1.11.0

type Dependencies []Dependency

type Dependency added in v1.11.0

type Dependency struct {
	PermissionAuthority string   `json:"permissionAuthority"`
	Dependencies        []string `json:"dependencies"`
}

type Details added in v1.4.2

type Details struct {
	// Containers
	Containers *Containers `json:"containers,omitempty"`

	// Filesystems
	ReadWritePaths *ReadWritePaths `json:"readWritePaths,omitempty"`
	ReadPaths      *ReadPaths      `json:"readPaths,omitempty"`

	// Network
	AllOutbound    bool            `json:"allOutbound"`
	AllInbound     bool            `json:"allInbound"`
	TCPListenPorts *TCPListenPorts `json:"tcpListenPorts,omitempty"`
	UDPListenPorts *UDPListenPorts `json:"udpListenPorts,omitempty"`

	// Processes
	Processes *Processes `json:"processes,omitempty"`

	// Syscalls
	Syscalls *Syscalls `json:"syscalls,omitempty"`

	// Falco
	Append               *bool        `json:"append,omitempty"`
	Source               string       `json:"source,omitempty"`
	Output               string       `json:"output,omitempty"`
	Condition            *Condition   `json:"condition,omitempty"`
	Priority             string       `json:"priority,omitempty"`
	Exceptions           []*Exception `json:"exceptions,omitempty"`
	MinimumEngineVersion *int         `json:"minimumEngineVersion,omitempty"`

	RuleType string `json:"ruleType"`
}

type DisplayInfo added in v1.5.0

type DisplayInfo struct {
	DisplayName                   string `json:"displayName"`
	TimeSeriesDisplayNameTemplate string `json:"timeSeriesDisplayNameTemplate"`
	Type                          string `json:"type"`
	Color                         string `json:"color,omitempty"`
	LineWidth                     int    `json:"lineWidth,omitempty"`
}

type DriftRuleDetails added in v1.23.0

type DriftRuleDetails struct {
	RuleType           ElementType            `json:"ruleType"`
	Exceptions         *RuntimePolicyRuleList `json:"exceptionList"`
	ProhibitedBinaries *RuntimePolicyRuleList `json:"prohibitedBinaries"`
	Mode               string                 `json:"mode"`
	Details            `json:"-"`
}

func (DriftRuleDetails) GetRuleType added in v1.23.0

func (p DriftRuleDetails) GetRuleType() ElementType

type ElementType added in v1.23.0

type ElementType string

type EntryPoint

type EntryPoint struct {
	Module    string `json:"module"`
	Selection string `json:"selection,omitempty"`
}

type EventDisplaySettings added in v1.5.0

type EventDisplaySettings struct {
	Enabled     bool        `json:"enabled"`
	QueryParams QueryParams `json:"queryParams"`
}

type Exception added in v1.4.2

type Exception struct {
	Name   string      `json:"name"`
	Fields interface{} `json:"fields,omitempty"`
	Comps  interface{} `json:"comps,omitempty"`
	Values interface{} `json:"values,omitempty"`
}

type FlexInt added in v1.23.0

type FlexInt int

type Format added in v1.5.0

type Format struct {
	Unit                 FormatUnit `json:"unit"`
	InputFormat          *string    `json:"inputFormat"`
	DisplayFormat        *string    `json:"displayFormat"`
	Decimals             *int       `json:"decimals"`
	YAxis                *string    `json:"yAxis"`
	MinInterval          *string    `json:"minInterval"`
	NullValueDisplayMode *string    `json:"nullValueDisplayMode"`
}

func NewDataFormat added in v1.18.1

func NewDataFormat() Format

func NewDataRateFormat added in v1.18.1

func NewDataRateFormat() Format

func NewFormat added in v1.5.0

func NewFormat(
	unit FormatUnit,
	inputFormat string,
	displayFormat string,
	decimals int,
	yAxis string,
	minInterval string,
	nullValueDisplayMode string,
) *Format

func NewNumberFormat added in v1.18.1

func NewNumberFormat() Format

func NewNumberRateFormat added in v1.18.1

func NewNumberRateFormat() Format

func NewPercentFormat added in v1.18.1

func NewPercentFormat() Format

func NewTimeFormat added in v1.18.1

func NewTimeFormat() Format

type FormatUnit added in v1.5.0

type FormatUnit string
const (
	FormatUnitPercentage FormatUnit = "%"
	FormatUnitData       FormatUnit = "byte"
	FormatUnitDataRate   FormatUnit = "byteRate"
	FormatUnitNumber     FormatUnit = "number"
	FormatUnitNumberRate FormatUnit = "numberRate"
	FormatUnitTime       FormatUnit = "relativeTime"
)

type GetPoliciesQueryParams added in v1.23.0

type GetPoliciesQueryParams struct {
	PolicyType string
	Filter     string
	Limit      int
}

func (*GetPoliciesQueryParams) Encode added in v1.23.0

func (q *GetPoliciesQueryParams) Encode() string

type GroupMapping added in v1.4.0

type GroupMapping struct {
	ID         int      `json:"id,omitempty"`
	GroupName  string   `json:"groupName,omitempty"`
	Role       string   `json:"role,omitempty"`
	SystemRole string   `json:"systemRole,omitempty"`
	TeamMap    *TeamMap `json:"teamMap,omitempty"`
	Weight     int      `json:"weight,omitempty"`
}

type GroupMappingConfig added in v1.8.0

type GroupMappingConfig struct {
	NoMappingStrategy             string `json:"noMappingStrategy"`
	DifferentTeamSameRoleStrategy string `json:"differentRolesSameTeamStrategy"`
}

type GroupMappingConfigInterface added in v1.8.0

type GroupMappingConfigInterface interface {
	Base
	UpdateGroupMappingConfig(ctx context.Context, gmc *GroupMappingConfig) (*GroupMappingConfig, error)
	GetGroupMappingConfig(ctx context.Context) (*GroupMappingConfig, error)
}

type GroupMappingInterface added in v1.4.0

type GroupMappingInterface interface {
	Base
	CreateGroupMapping(ctx context.Context, gm *GroupMapping) (*GroupMapping, error)
	UpdateGroupMapping(ctx context.Context, gm *GroupMapping, id int) (*GroupMapping, error)
	DeleteGroupMapping(ctx context.Context, id int) error
	GetGroupMapping(ctx context.Context, id int) (*GroupMapping, error)
}

type IAMTokenResponse added in v1.1.0

type IAMTokenResponse struct {
	AccessToken string `json:"access_token"`
	Expiration  int64  `json:"expiration"`
}

type IBMAccessToken added in v1.1.0

type IBMAccessToken string

type IBMCommon added in v1.1.0

type IBMCommon interface {
	Common
}

type IBMMonitor added in v1.1.0

type IBMMonitor interface {
	IBMCommon
	MonitorCommon
}

func NewIBMMonitor added in v1.1.0

func NewIBMMonitor(opts ...ClientOption) IBMMonitor

type IBMRequest added in v1.1.0

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

func (*IBMRequest) CurrentTeamID added in v1.3.0

func (ir *IBMRequest) CurrentTeamID(ctx context.Context) (int, error)

func (*IBMRequest) Request added in v1.1.0

func (ir *IBMRequest) Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error)

type IBMSecure added in v1.8.0

type IBMSecure interface {
	IBMCommon
	SecureCommon
}

func NewIBMSecure added in v1.8.0

func NewIBMSecure(opts ...ClientOption) IBMSecure

type IdentityContext added in v1.10.0

type IdentityContext struct {
	IdentityType       string `json:"identityType"`
	CustomerID         int    `json:"customerId"`
	TeamID             int    `json:"teamId"`
	TeamName           string `json:"teamName"`
	UserID             int    `json:"userId"`
	Username           string `json:"username"`
	ServiceAccountID   int    `json:"serviceAccountId"`
	ServiceAccountName string `json:"serviceAccountName"`
}

type IdentityContextInterface added in v1.10.0

type IdentityContextInterface interface {
	GetIdentityContext(ctx context.Context) (*IdentityContext, error)
}

type Items added in v1.4.1

type Items struct {
	Items []string `json:"items"`
}

type LabelDescriptorV3 added in v1.6.0

type LabelDescriptorV3 struct {
	ID       string `json:"id"`
	PublicID string `json:"publicId"`
}

type Layout added in v1.5.0

type Layout struct {
	X       int `json:"x"`
	Y       int `json:"y"`
	W       int `json:"w"`
	H       int `json:"h"`
	PanelID int `json:"panelId"`
}

type Left added in v1.5.0

type Left struct {
	Enabled        bool        `json:"enabled"`
	DisplayName    interface{} `json:"displayName"`
	Unit           string      `json:"unit"`
	DisplayFormat  string      `json:"displayFormat"`
	Decimals       interface{} `json:"decimals"`
	MinValue       float64     `json:"minValue"`
	MaxValue       interface{} `json:"maxValue"`
	MinInputFormat string      `json:"minInputFormat"`
	MaxInputFormat string      `json:"maxInputFormat"`
	Scale          string      `json:"scale"`
}

type LegendConfiguration added in v1.5.0

type LegendConfiguration struct {
	Enabled     bool        `json:"enabled"`
	Position    string      `json:"position"`
	Layout      string      `json:"layout"`
	ShowCurrent bool        `json:"showCurrent"`
	Width       interface{} `json:"width"`
	Height      interface{} `json:"height"`
}

type List added in v1.4.1

type List struct {
	Name    string `json:"name"`
	Items   Items  `json:"items"`
	Append  bool   `json:"append"`
	ID      int    `json:"id,omitempty"`
	Version int    `json:"version,omitempty"`
}

type ListInterface added in v1.4.1

type ListInterface interface {
	Base
	CreateList(ctx context.Context, list List) (List, error)
	GetListByID(ctx context.Context, id int) (List, error)
	UpdateList(ctx context.Context, list List) (List, error)
	DeleteList(ctx context.Context, id int) error
}

type MLRuleDetails added in v1.23.0

type MLRuleDetails struct {
	RuleType                ElementType                 `json:"ruleType" yaml:"ruleType"`
	AnomalyDetectionTrigger *MLRuleThresholdAndSeverity `json:"anomalyDetectionTrigger" yaml:"anomalyDetectionTrigger"`
	CryptominingTrigger     *MLRuleThresholdAndSeverity `json:"cryptominingTrigger" yaml:"cryptominingTrigger"`
	Details                 `json:"-"`
}

func (MLRuleDetails) GetRuleType added in v1.23.0

func (p MLRuleDetails) GetRuleType() ElementType

type MLRuleThresholdAndSeverity added in v1.23.0

type MLRuleThresholdAndSeverity struct {
	Enabled   bool    `json:"enabled" yaml:"enabled"`
	Threshold float64 `json:"threshold" yaml:"threshold"`
	Severity  float64 `json:"severity" yaml:"severity"`
}

type Macro added in v1.4.1

type Macro struct {
	ID                   int            `json:"id,omitempty"`
	Version              int            `json:"version,omitempty"`
	Name                 string         `json:"name"`
	Condition            MacroCondition `json:"condition"`
	Append               bool           `json:"append"`
	MinimumEngineVersion *int           `json:"minimumEngineVersion,omitempty"`
}

type MacroCondition added in v1.4.1

type MacroCondition struct {
	Condition string `json:"condition"`
}

type MacroInterface added in v1.4.1

type MacroInterface interface {
	Base
	CreateMacro(ctx context.Context, macro Macro) (Macro, error)
	GetMacroByID(ctx context.Context, id int) (Macro, error)
	UpdateMacro(ctx context.Context, macro Macro) (Macro, error)
	DeleteMacro(ctx context.Context, id int) error
}

type MalwareRuleDetails added in v1.23.0

type MalwareRuleDetails struct {
	RuleType         ElementType         `json:"ruleType"`
	UseManagedHashes bool                `json:"useManagedHashes"`
	AdditionalHashes map[string][]string `json:"additionalHashes"`
	IgnoreHashes     map[string][]string `json:"ignoreHashes"`
	Details          `json:"-"`
}

func (MalwareRuleDetails) GetRuleType added in v1.23.0

func (p MalwareRuleDetails) GetRuleType() ElementType

type Monitor

type Monitor struct {
	Metric       string  `json:"metric"`
	StdDevFactor float64 `json:"stdDevFactor"`
}

type MonitorCommon added in v1.4.0

type NamespaceFilters added in v1.1.0

type NamespaceFilters struct {
	IBMPlatformMetrics *string `json:"ibmPlatformMetrics"`
}

type NotificationChannel added in v1.2.0

type NotificationChannel struct {
	ID      int                        `json:"id,omitempty"`
	Version int                        `json:"version,omitempty"`
	Type    string                     `json:"type"`
	Name    string                     `json:"name"`
	Enabled bool                       `json:"enabled"`
	TeamID  *int                       `json:"teamId,omitempty"`
	Options NotificationChannelOptions `json:"options"`
}

type NotificationChannelConfigV2 added in v1.6.0

type NotificationChannelConfigV2 struct {
	ChannelID       int                          `json:"channelId,omitempty"`
	Type            string                       `json:"type,omitempty"`
	Name            string                       `json:"nam,omitempty"`
	Enabled         bool                         `json:"enabled,omitempty"`
	OverrideOptions NotificationChannelOptionsV2 `json:"overrideOptions"`
}

type NotificationChannelInterface added in v1.2.0

type NotificationChannelInterface interface {
	Base
	GetNotificationChannelById(ctx context.Context, id int) (NotificationChannel, error)
	GetNotificationChannelByName(ctx context.Context, name string) (NotificationChannel, error)
	CreateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
	UpdateNotificationChannel(ctx context.Context, channel NotificationChannel) (NotificationChannel, error)
	DeleteNotificationChannel(ctx context.Context, id int) error
}

type NotificationChannelOptions added in v1.2.0

type NotificationChannelOptions struct {
	EmailRecipients          []string                                   `json:"emailRecipients,omitempty"`          // Type: email
	SnsTopicARNs             []string                                   `json:"snsTopicARNs,omitempty"`             // Type: SNS
	APIKey                   string                                     `json:"apiKey,omitempty"`                   // Type: VictorOps, ibm event function
	RoutingKey               string                                     `json:"routingKey,omitempty"`               // Type: VictorOps
	Url                      string                                     `json:"url,omitempty"`                      // Type: OpsGenie, Webhook, Slack, google chat, prometheus alert manager, custom webhook, ms teams
	Channel                  string                                     `json:"channel,omitempty"`                  // Type: Slack
	Account                  string                                     `json:"account,omitempty"`                  // Type: PagerDuty
	ServiceKey               string                                     `json:"serviceKey,omitempty"`               // Type: PagerDuty
	ServiceName              string                                     `json:"serviceName,omitempty"`              // Type: PagerDuty
	AdditionalHeaders        map[string]interface{}                     `json:"additionalHeaders,omitempty"`        // Type: Webhook, prometheus alert manager, custom webhook, ibm function
	Region                   string                                     `json:"region,omitempty"`                   // Type: OpsGenie
	AllowInsecureConnections *bool                                      `json:"allowInsecureConnections,omitempty"` // Type: prometheus alert manager, custom webhook, Webhook
	TeamId                   int                                        `json:"teamId,omitempty"`                   // Type: team email
	HttpMethod               string                                     `json:"httpMethod,omitempty"`               // Type: custom webhook
	MonitorTemplate          string                                     `json:"monitorTemplate,omitempty"`          // Type: custom webhook
	InstanceId               string                                     `json:"instanceId,omitempty"`               // Type: ibm event notification
	IbmFunctionType          string                                     `json:"ibmFunctionType,omitempty"`          // Type: ibm event function
	CustomData               map[string]interface{}                     `json:"customData,omitempty"`               // Type: ibm function, Webhook
	TemplateConfiguration    []NotificationChannelTemplateConfiguration `json:"templateConfiguration,omitempty"`    // Type: slack, ms teams

	NotifyOnOk           bool `json:"notifyOnOk"`
	NotifyOnResolve      bool `json:"notifyOnResolve"`
	SendTestNotification bool `json:"sendTestNotification"`
}

type NotificationChannelOptionsV2 added in v1.6.0

type NotificationChannelOptionsV2 struct {
	NotifyOnAcknowledge        bool                          `json:"notifyOnAcknowledge,omitempty"`
	NotifyOnResolve            bool                          `json:"notifyOnResolve"`
	ReNotifyEverySec           *int                          `json:"reNotifyEverySec"`
	CustomNotificationTemplate *CustomNotificationTemplateV2 `json:"customNotificationTemplate,omitempty"`
	Thresholds                 []string                      `json:"thresholds"`
}

type NotificationChannelTemplateConfiguration added in v1.9.0

type NotificationChannelTemplateConfiguration struct {
	TemplateKey                   string                                            `json:"templateKey,omitempty"`
	TemplateConfigurationSections []NotificationChannelTemplateConfigurationSection `json:"templateConfigurationSections,omitempty"`
}

type NotificationChannelTemplateConfigurationSection added in v1.9.0

type NotificationChannelTemplateConfigurationSection struct {
	SectionName string `json:"sectionName,omitempty"`
	ShouldShow  bool   `json:"shouldShow"`
}

type NumberThresholdBase added in v1.5.0

type NumberThresholdBase struct {
	DisplayText string `json:"displayText"`
	Severity    string `json:"severity"`
}

type NumberThresholds added in v1.5.0

type NumberThresholds struct {
	Base   NumberThresholdBase `json:"base"`
	Values []interface{}       `json:"values"`
}

type OrganizationSecure added in v1.15.0

type OrganizationSecure struct {
	cloudauth.CloudOrganization
}

type OrganizationSecureInterface added in v1.15.0

type OrganizationSecureInterface interface {
	Base
	CreateOrganizationSecure(ctx context.Context, org *OrganizationSecure) (*OrganizationSecure, string, error)
	GetOrganizationSecure(ctx context.Context, orgID string) (*OrganizationSecure, string, error)
	DeleteOrganizationSecure(ctx context.Context, orgID string) (string, error)
	UpdateOrganizationSecure(ctx context.Context, orgID string, org *OrganizationSecure) (*OrganizationSecure, string, error)
}

type PanelType added in v1.5.0

type PanelType string
const (
	PanelTypeTimechart PanelType = "advancedTimechart"
	PanelTypeNumber    PanelType = "advancedNumber"
	PanelTypeText      PanelType = "text"
)

type Panels added in v1.5.0

type Panels struct {
	ID                     int                  `json:"id"`
	Name                   string               `json:"name"`
	Description            string               `json:"description"`
	AxesConfiguration      *AxesConfiguration   `json:"axesConfiguration,omitempty"`
	LegendConfiguration    *LegendConfiguration `json:"legendConfiguration,omitempty"`
	ApplyScopeToAll        bool                 `json:"applyScopeToAll,omitempty"`
	ApplySegmentationToAll bool                 `json:"applySegmentationToAll,omitempty"`
	AdvancedQueries        []*AdvancedQueries   `json:"advancedQueries,omitempty"`
	NumberThresholds       *NumberThresholds    `json:"numberThresholds,omitempty"`
	MarkdownSource         *string              `json:"markdownSource,omitempty"`
	PanelTitleVisible      bool                 `json:"panelTitleVisible"`
	TextAutosized          bool                 `json:"textAutosized"`
	TransparentBackground  bool                 `json:"transparentBackground"`
	Type                   PanelType            `json:"type"`
	// Just a helper to the client, the actual field is in Dashboard
	Layout *Layout `json:"-"`
}

func (*Panels) AddQueries added in v1.5.0

func (p *Panels) AddQueries(queries ...*AdvancedQueries) (*Panels, error)

func (*Panels) WithLayout added in v1.5.0

func (p *Panels) WithLayout(xPos, yPos, width, height int) (*Panels, error)

type Policy added in v1.4.1

type Policy struct {
	ID                     int           `json:"id,omitempty"`
	IsDefault              bool          `json:"isDefault"`
	Name                   string        `json:"name"`
	Description            string        `json:"description"`
	Severity               int           `json:"severity"`
	Enabled                bool          `json:"enabled"`
	RuleNames              []string      `json:"ruleNames"`
	Rules                  []*PolicyRule `json:"rules,omitempty"`
	Actions                []Action      `json:"actions"`
	Scope                  string        `json:"scope,omitempty"`
	Version                int           `json:"version,omitempty"`
	NotificationChannelIds []int         `json:"notificationChannelIds"`
	Type                   string        `json:"type"`
	Origin                 string        `json:"origin"`
	Runbook                string        `json:"runbook"`
	TemplateId             int           `json:"templateId"`
	TemplateVersion        string        `json:"templateVersion"`
}

type PolicyInterface added in v1.4.1

type PolicyInterface interface {
	Base
	CreatePolicy(ctx context.Context, policy Policy) (Policy, error)
	DeletePolicy(ctx context.Context, policyID int) error
	UpdatePolicy(ctx context.Context, policy Policy) (Policy, error)
	GetPolicyByID(ctx context.Context, policyID int) (Policy, int, error)
	GetPolicies(ctx context.Context) ([]Policy, int, error)
	SendPoliciesToAgents(ctx context.Context) error
}

type PolicyRule added in v1.5.0

type PolicyRule struct {
	Name    string `json:"ruleName"`
	Enabled bool   `json:"enabled"`
}

type PolicyRulesComposite added in v1.23.0

type PolicyRulesComposite struct {
	Policy *Policy              `json:"policy"`
	Rules  []*RuntimePolicyRule `json:"rules"`
}

type PosturePolicy added in v1.10.0

type PosturePolicy struct {
	ID             string                  `json:"id,omitempty"`
	Name           string                  `json:"name"`
	Type           int                     `json:"type"`
	Kind           int                     `json:"kind"`
	Description    string                  `json:"description"`
	Version        string                  `json:"version"`
	Link           string                  `json:"link"`
	Authors        string                  `json:"authors"`
	PublishedData  string                  `json:"publishedDate"`
	MinKubeVersion float64                 `json:"minKubeVersion"`
	MaxKubeVersion float64                 `json:"maxKubeVersion"`
	IsCustom       bool                    `json:"isCustom"`
	IsActive       bool                    `json:"isActive"`
	Platform       string                  `json:"platform"`
	Zones          []PosturePolicyZoneMeta `json:"zones"`
}

type PosturePolicyInterface added in v1.10.0

type PosturePolicyInterface interface {
	Base
	ListPosturePolicies(ctx context.Context) ([]PosturePolicy, error)
}

type PosturePolicyZoneMeta added in v1.10.0

type PosturePolicyZoneMeta struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

type PostureZone added in v1.10.0

type PostureZone struct {
	ID             string                  `json:"id"`
	Name           string                  `json:"name"`
	Description    string                  `json:"description"`
	Author         string                  `json:"author"`
	LastModifiedBy string                  `json:"lastModifiedBy"`
	LastUpdated    string                  `json:"lastUpdated"`
	IsSystem       bool                    `json:"isSystem"`
	Scopes         []PostureZoneScope      `json:"scopes"`
	Policies       []PostureZonePolicySlim `json:"policies"`
}

type PostureZoneInterface added in v1.10.0

type PostureZoneInterface interface {
	Base
	CreateOrUpdatePostureZone(ctx context.Context, z *PostureZoneRequest) (*PostureZone, string, error)
	GetPostureZone(ctx context.Context, id int) (*PostureZone, error)
	DeletePostureZone(ctx context.Context, id int) error
}

type PostureZonePolicyListResponse added in v1.10.0

type PostureZonePolicyListResponse struct {
	Data []PosturePolicy `json:"data"`
}

type PostureZonePolicySlim added in v1.10.0

type PostureZonePolicySlim struct {
	ID   string `json:"id,omitempty"`
	Name string `json:"name"`
	Type int    `json:"type"`
	Kind int    `json:"kind"`
}

type PostureZoneRequest added in v1.10.0

type PostureZoneRequest struct {
	ID          string             `json:"id"`
	Name        string             `json:"name"`
	Description string             `json:"description"`
	PolicyIDs   []string           `json:"policyIds"`
	Scopes      []PostureZoneScope `json:"scopes"`
}

type PostureZoneResponse added in v1.10.0

type PostureZoneResponse struct {
	Data PostureZone `json:"data"`
}

type PostureZoneScope added in v1.10.0

type PostureZoneScope struct {
	ID         string `json:"id,omitempty"`
	TargetType string `json:"targetType"`
	Rules      string `json:"rules"`
}

type Processes added in v1.4.2

type Processes struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type Product added in v1.8.0

type Product string
const (
	MonitorProduct Product = "SDC"
	SecureProduct  Product = "SDS"
)

type QueryParams added in v1.5.0

type QueryParams struct {
	Severities    []interface{} `json:"severities"`
	AlertStatuses []interface{} `json:"alertStatuses"`
	Categories    []interface{} `json:"categories"`
	Filter        string        `json:"filter"`
	TeamScope     bool          `json:"teamScope"`
}

type ReadPaths added in v1.4.2

type ReadPaths struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type ReadWritePaths added in v1.4.2

type ReadWritePaths struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type Requester added in v0.7.3

type Requester interface {
	CurrentTeamID(ctx context.Context) (int, error)
	Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error)
}
type Right struct {
	Enabled        bool        `json:"enabled"`
	DisplayName    interface{} `json:"displayName"`
	Unit           string      `json:"unit"`
	DisplayFormat  string      `json:"displayFormat"`
	Decimals       interface{} `json:"decimals"`
	MinValue       float64     `json:"minValue"`
	MaxValue       interface{} `json:"maxValue"`
	MinInputFormat string      `json:"minInputFormat"`
	MaxInputFormat string      `json:"maxInputFormat"`
	Scale          string      `json:"scale"`
}

type Rule added in v1.4.2

type Rule struct {
	ID          int      `json:"id,omitempty"`
	Name        string   `json:"name"`
	Description string   `json:"description,omitempty"`
	Tags        []string `json:"tags"`
	Details     Details  `json:"details"`
	Version     int      `json:"version,omitempty"`
}

type RuleInterface added in v1.4.2

type RuleInterface interface {
	Base
	CreateRule(ctx context.Context, rule Rule) (Rule, error)
	GetRuleByID(ctx context.Context, ruleID int) (Rule, int, error)
	UpdateRule(ctx context.Context, rule Rule) (Rule, error)
	DeleteRule(ctx context.Context, ruleID int) error
	GetRuleGroup(ctx context.Context, ruleName string, ruleType string) ([]Rule, error)
}

type RuntimePolicyObjectOrigin added in v1.23.0

type RuntimePolicyObjectOrigin string // NOTE: This is an int in model_rules.go#L247

type RuntimePolicyRule added in v1.23.0

type RuntimePolicyRule struct {
	Id          *FlexInt                   `json:"id"`
	Name        string                     `json:"name"`
	Origin      *RuntimePolicyObjectOrigin `json:"origin"`
	VersionId   string                     `json:"versionId"`
	Filename    string                     `json:"filename"`
	Description string                     `json:"description"`
	Details     RuntimePolicyRuleDetails   `json:"details"`
	Tags        []string                   `json:"tags"`
	Version     *int                       `json:"version"`
	CreatedOn   int64                      `json:"createdOn"`
	ModifiedOn  int64                      `json:"modifiedOn"`
}

func (*RuntimePolicyRule) UnmarshalJSON added in v1.23.0

func (r *RuntimePolicyRule) UnmarshalJSON(b []byte) error

TODO: This should be exported into a common package Copied from: https://github.com/draios/secure-backend/blob/main/policies/model/model_rules.go#L676C1-L779C2

type RuntimePolicyRuleDetails added in v1.23.0

type RuntimePolicyRuleDetails interface {
	GetRuleType() ElementType
}

type RuntimePolicyRuleList added in v1.23.0

type RuntimePolicyRuleList struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type ScanningGate added in v1.4.2

type ScanningGate struct {
	ID      string              `json:"id,omitempty"`
	Gate    string              `json:"gate"`
	Trigger string              `json:"trigger"`
	Action  string              `json:"action"`
	Params  []ScanningGateParam `json:"params"`
}

type ScanningGateParam added in v1.4.2

type ScanningGateParam struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

type ScanningPolicy added in v1.4.2

type ScanningPolicy struct {
	ID             string         `json:"id,omitempty"`
	Version        string         `json:"version,omitempty"`
	Name           string         `json:"name"`
	Comment        string         `json:"comment"`
	IsDefault      bool           `json:"isDefault,omitempty"`
	PolicyBundleId string         `json:"policyBundleId,omitempty"`
	Rules          []ScanningGate `json:"rules"`
}

type ScanningPolicyAssignment added in v1.4.2

type ScanningPolicyAssignment struct {
	ID           string                        `json:"id,omitempty"`
	Name         string                        `json:"name"`
	Registry     string                        `json:"registry"`
	Repository   string                        `json:"repository"`
	Image        ScanningPolicyAssignmentImage `json:"image"`
	PolicyIDs    []string                      `json:"policy_ids"`
	WhitelistIDs []string                      `json:"whitelist_ids"`
}

type ScanningPolicyAssignmentImage added in v1.4.2

type ScanningPolicyAssignmentImage struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

type ScanningPolicyAssignmentInterface added in v1.4.2

type ScanningPolicyAssignmentInterface interface {
	Base
	CreateScanningPolicyAssignmentList(ctx context.Context, scanningPolicyAssignmentRequest ScanningPolicyAssignmentList) (ScanningPolicyAssignmentList, error)
	DeleteScanningPolicyAssignmentList(ctx context.Context, scanningPolicyAssignmentList ScanningPolicyAssignmentList) error
	GetScanningPolicyAssignmentList(ctx context.Context) (ScanningPolicyAssignmentList, error)
}

type ScanningPolicyAssignmentList added in v1.4.2

type ScanningPolicyAssignmentList struct {
	Items          []ScanningPolicyAssignment `json:"items"`
	PolicyBundleId string                     `json:"policyBundleId"`
}

type ScanningPolicyInterface added in v1.4.2

type ScanningPolicyInterface interface {
	Base
	CreateScanningPolicy(ctx context.Context, scanningPolicy ScanningPolicy) (ScanningPolicy, error)
	GetScanningPolicyByID(ctx context.Context, scanningPolicyID string) (ScanningPolicy, error)
	UpdateScanningPolicyByID(ctx context.Context, scanningPolicy ScanningPolicy) (ScanningPolicy, error)
	DeleteScanningPolicyByID(ctx context.Context, scanningPolicyID string) error
}

type ScopeExpressionList added in v1.5.0

type ScopeExpressionList struct {
	Operand     string      `json:"operand"`
	Operator    string      `json:"operator"`
	DisplayName string      `json:"displayName"`
	Value       []string    `json:"value"`
	Descriptor  interface{} `json:"descriptor"`
	IsVariable  bool        `json:"isVariable"`
}

type ScopeExpressionV2 added in v1.6.0

type ScopeExpressionV2 struct {
	Operand    string                  `json:"operand"`
	Descriptor *AlertLabelDescriptorV2 `json:"descriptor,omitempty"`
	Operator   string                  `json:"operator"`
	Value      []string                `json:"value"`
}

type ScopedSegmentedConfig added in v1.6.0

type ScopedSegmentedConfig struct {
	Scope     *AlertScopeV2            `json:"scope,omitempty"`
	SegmentBy []AlertLabelDescriptorV2 `json:"segmentBy"`
}

type SecureCommon added in v1.10.0

type SecureCommon interface {
	PosturePolicyInterface
	PostureZoneInterface
}

type SegmentCondition added in v1.4.0

type SegmentCondition struct {
	Type string `json:"type"`
}

type SharingMember added in v1.5.0

type SharingMember struct {
	Type string `json:"type"`
	ID   int    `json:"id"`
}

type SharingOptions added in v1.5.0

type SharingOptions struct {
	Member SharingMember `json:"member"`
	Role   string        `json:"role"`
}

type SilenceRule added in v1.12.0

type SilenceRule struct {
	Name                   string `json:"name"`
	Enabled                bool   `json:"enabled"`
	StartTs                int64  `json:"startTs"`
	DurationInSec          int    `json:"durationInSec"`
	Scope                  string `json:"scope,omitempty"`
	AlertIds               []int  `json:"alertIds,omitempty"`
	NotificationChannelIds []int  `json:"notificationChannelIds,omitempty"`

	Version int `json:"version,omitempty"`
	ID      int `json:"id,omitempty"`
}

type SilenceRuleInterface added in v1.12.0

type SilenceRuleInterface interface {
	Base
	GetSilenceRule(ctx context.Context, id int) (SilenceRule, error)
	CreateSilenceRule(ctx context.Context, silenceRule SilenceRule) (SilenceRule, error)
	UpdateSilenceRule(ctx context.Context, silenceRule SilenceRule) (SilenceRule, error)
	DeleteSilenceRule(ctx context.Context, id int) error
}

type Syscalls added in v1.4.2

type Syscalls struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type SysdigCapture added in v1.4.0

type SysdigCapture struct {
	Name       string      `json:"name"`
	Filters    string      `json:"filters,omitempty"`
	Duration   int         `json:"duration"`
	Type       string      `json:"type,omitempty"`
	BucketName string      `json:"bucketName"`
	Folder     string      `json:"folder,omitempty"`
	Enabled    bool        `json:"enabled"`
	StorageID  interface{} `json:"storageId,omitempty"`
}

type SysdigMonitor added in v1.1.0

type SysdigMonitor interface {
	SysdigCommon
	MonitorCommon
	CloudAccountMonitorInterface
}

func NewSysdigMonitor added in v1.1.0

func NewSysdigMonitor(opts ...ClientOption) SysdigMonitor

type SysdigRequest added in v0.7.3

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

func (*SysdigRequest) CurrentTeamID added in v1.3.0

func (sr *SysdigRequest) CurrentTeamID(ctx context.Context) (int, error)

func (*SysdigRequest) Request added in v0.7.3

func (sr *SysdigRequest) Request(ctx context.Context, method string, url string, payload io.Reader) (*http.Response, error)

type TCPListenPorts added in v1.4.2

type TCPListenPorts struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type Team

type Team struct {
	UserRoles           []UserRoles       `json:"userRoles,omitempty"`
	Description         string            `json:"description"`
	Name                string            `json:"name"`
	ID                  int               `json:"id,omitempty"`
	Version             int               `json:"version,omitempty"`
	Origin              string            `json:"origin,omitempty"`
	LastUpdated         int64             `json:"lastUpdated,omitempty"`
	EntryPoint          *EntryPoint       `json:"entryPoint,omitempty"`
	Theme               string            `json:"theme"`
	CustomerID          int               `json:"customerId,omitempty"`
	DateCreated         int64             `json:"dateCreated,omitempty"`
	Products            []string          `json:"products,omitempty"`
	Show                string            `json:"show,omitempty"`
	Immutable           bool              `json:"immutable,omitempty"`
	CanUseSysdigCapture *bool             `json:"canUseSysdigCapture,omitempty"`
	CanUseCustomEvents  *bool             `json:"canUseCustomEvents,omitempty"`
	CanUseAwsMetrics    *bool             `json:"canUseAwsMetrics,omitempty"`
	CanUseBeaconMetrics *bool             `json:"canUseBeaconMetrics,omitempty"`
	UserCount           int               `json:"userCount,omitempty"`
	Filter              string            `json:"filter,omitempty"`
	NamespaceFilters    *NamespaceFilters `json:"namespaceFilters,omitempty"`
	DefaultTeam         bool              `json:"default,omitempty"`
	ZoneIDs             []int             `json:"zoneIds,omitempty"`
	AllZones            bool              `json:"allZones"`
}

type TeamInterface

type TeamInterface interface {
	Base
	GetUserIDByEmail(ctx context.Context, userRoles []UserRoles) ([]UserRoles, error)
	GetTeamById(ctx context.Context, id int) (t Team, err error)
	CreateTeam(ctx context.Context, tRequest Team) (t Team, err error)
	UpdateTeam(ctx context.Context, tRequest Team) (t Team, err error)
	DeleteTeam(ctx context.Context, id int) error
}

type TeamMap added in v1.4.0

type TeamMap struct {
	AllTeams bool  `json:"allTeams"`
	TeamIDs  []int `json:"teamIds"`
}

type TeamServiceAccount added in v1.11.0

type TeamServiceAccount struct {
	ID             int    `json:"id,omitempty"`
	Name           string `json:"name"`
	SystemRole     string `json:"systemRole"`
	TeamId         int    `json:"teamId"`
	TeamRole       string `json:"teamRole"`
	DateCreated    int64  `json:"dateCreated,omitempty"`
	ExpirationDate int64  `json:"expirationDate"`
	ApiKey         string `json:"apiKey,omitempty"`
}

type TeamServiceAccountInterface added in v1.11.0

type TeamServiceAccountInterface interface {
	Base
	GetTeamServiceAccountByID(ctx context.Context, id int) (*TeamServiceAccount, error)
	CreateTeamServiceAccount(ctx context.Context, account *TeamServiceAccount) (*TeamServiceAccount, error)
	UpdateTeamServiceAccount(ctx context.Context, account *TeamServiceAccount, id int) (*TeamServiceAccount, error)
	DeleteTeamServiceAccount(ctx context.Context, id int) error
}

type TeamSharingOptions added in v1.5.0

type TeamSharingOptions struct {
	Type          string        `json:"type"`
	UserTeamsRole string        `json:"userTeamsRole"`
	SelectedTeams []interface{} `json:"selectedTeams"`
}

type UDPListenPorts added in v1.4.2

type UDPListenPorts struct {
	Items      []string `json:"items"`
	MatchItems bool     `json:"matchItems"`
}

type UnixTimestamp added in v1.1.0

type UnixTimestamp int64

type User added in v1.3.0

type User struct {
	ID          int    `json:"id,omitempty"`
	Version     int    `json:"version,omitempty"`
	SystemRole  string `json:"systemRole,omitempty"`
	Email       string `json:"username"`
	FirstName   string `json:"firstName,omitempty"`
	LastName    string `json:"lastName,omitempty"`
	CurrentTeam *int   `json:"currentTeam"`
}

type UserInterface added in v1.4.0

type UserInterface interface {
	Base
	GetUserById(ctx context.Context, id int) (*User, error)
	GetUserByUsername(ctx context.Context, username string) (*User, error)
	GetUserByEmail(ctx context.Context, email string) (*User, error)
	CreateUser(ctx context.Context, user *User) (*User, error)
	UpdateUser(ctx context.Context, user *User) (*User, error)
	DeleteUser(ctx context.Context, id int) error
	GetCurrentUser(ctx context.Context) (u *User, err error)
}

type UserRoles

type UserRoles struct {
	UserId int    `json:"userId"`
	Email  string `json:"userName,omitempty"`
	Role   string `json:"role"`
	Admin  bool   `json:"admin,omitempty"`
}

type VulnerabilityException added in v1.4.2

type VulnerabilityException struct {
	ID             string `json:"id"`
	Gate           string `json:"gate"`
	TriggerID      string `json:"trigger_id"`
	Notes          string `json:"notes"`
	ExpirationDate *int   `json:"expiration_date,omitempty"`
	Enabled        bool   `json:"enabled"`
}

type VulnerabilityExceptionInterface added in v1.4.2

type VulnerabilityExceptionInterface interface {
	Base
	CreateVulnerabilityException(ctx context.Context, listID string, exception *VulnerabilityException) (*VulnerabilityException, error)
	GetVulnerabilityExceptionByID(ctx context.Context, listID string, exceptionID string) (*VulnerabilityException, error)
	DeleteVulnerabilityException(ctx context.Context, listID string, exceptionID string) error
	UpdateVulnerabilityException(ctx context.Context, listID string, exception *VulnerabilityException) (*VulnerabilityException, error)
}

type VulnerabilityExceptionList added in v1.4.2

type VulnerabilityExceptionList struct {
	ID      string `json:"id,omitempty"`
	Version string `json:"version"`
	Name    string `json:"name"`
	Comment string `json:"comment"`
}

type VulnerabilityExceptionListInterface added in v1.4.2

type VulnerabilityExceptionListInterface interface {
	Base
	CreateVulnerabilityExceptionList(ctx context.Context, list *VulnerabilityExceptionList) (*VulnerabilityExceptionList, error)
	GetVulnerabilityExceptionListByID(ctx context.Context, id string) (*VulnerabilityExceptionList, error)
	DeleteVulnerabilityExceptionList(ctx context.Context, id string) error
	UpdateVulnerabilityExceptionList(ctx context.Context, list *VulnerabilityExceptionList) (*VulnerabilityExceptionList, error)
}

Directories

Path Synopsis
cloudauth
go

Jump to

Keyboard shortcuts

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