v2

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2023 License: MPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

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 (
	GetMePath                 = "/api/users/me"
	AuthorizationHeader       = "Authorization"
	ContentTypeHeader         = "Content-Type"
	SysdigProviderHeader      = "Sysdig-Provider"
	SysdigProviderHeaderValue = "Terraform"
	ContentTypeJSON           = "application/json"
	ContentTypeFormURLEncoded = "x-www-form-urlencoded"
)
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/"
)
View Source
const (
	CreateListPath = "%s/api/secure/falco/lists"
	GetListPath    = "%s/api/secure/falco/lists/%d"
	UpdateListPath = "%s/api/secure/falco/lists/%d"
	DeleteListPath = "%s/api/secure/falco/lists/%d"
)
View Source
const (
	CreateMacroPath  = "%s/api/secure/falco/macros"
	GetMacroByIDPath = "%s/api/secure/falco/macros/%d"
	UpdateMacroPath  = "%s/api/secure/falco/macros/%d"
	DeleteMacroPath  = "%s/api/secure/falco/macros/%d"
)
View Source
const (
	GetNotificationChannels = "%s/api/notificationChannels"
	GetNotificationChannel  = "%s/api/notificationChannels/%d"
)
View Source
const (
	CreatePolicyPath = "%s/api/v2/policies"
	DeletePolicyPath = "%s/api/v2/policies/%d"
	UpdatePolicyPath = "%s/api/v2/policies/%d"
	GetPolicyPath    = "%s/api/v2/policies/%d"
	GetPoliciesPath  = "%s/api/v2/policies"
)
View Source
const (
	CreateRulePath  = "%s/api/secure/rules"
	GetRuleByIDPath = "%s/api/secure/rules/%d"
	UpdateRulePath  = "%s/api/secure/rules/%d"
	DeleteURLPath   = "%s/api/secure/rules/%d"
)
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/"
)

Variables

View Source
var GroupMappingNotFound = errors.New("group mapping 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 Action added in v1.4.1

type Action struct {
	AfterEventNs         int    `json:"afterEventNs,omitempty"`
	BeforeEventNs        int    `json:"beforeEventNs,omitempty"`
	Name                 string `json:"name,omitempty"`
	IsLimitedToContainer bool   `json:"isLimitedToContainer"`
	Type                 string `json:"type"`
}

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 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 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 Client

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

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) 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) 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) 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) CreateTeam

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

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) 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) 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) 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) 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) 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) DeleteTeam

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

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) ErrorFromResponse

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

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) 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) 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) 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) GetGroupMappingURL added in v1.4.0

func (client *Client) GetGroupMappingURL(id int) 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) 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) GetRuleByID added in v1.4.2

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

func (*Client) GetRuleByIDURL added in v1.4.2

func (client *Client) GetRuleByIDURL(ruleID int) 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) GetTeamById

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

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) 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) 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) 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) 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) 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) UpdateTeam

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

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 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 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 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"`
}

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 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,omitempty"`
	AllInbound     bool            `json:"allInbound,omitempty"`
	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"`

	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 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 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 NewFormat added in v1.5.0

func NewFormat(
	unit FormatUnit,
	inputFormat string,
	displayFormat string,
	decimals int,
	yAxis string,
	minInterval string,
	nullValueDisplayMode string) *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 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"`
}

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 Items added in v1.4.1

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

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 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"`
}

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 Monitor

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

type MonitorCommon added in v1.4.0

type MonitorCommon interface {
	AlertInterface
}

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 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
	RoutingKey        string                 `json:"routingKey,omitempty"`        // Type: VictorOps
	Url               string                 `json:"url,omitempty"`               // Type: OpsGenie, Webhook and Slack
	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
	Region            string                 `json:"region,omitempty"`            // Type: OpsGenie

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

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 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"`
	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)
}

type PolicyRule added in v1.5.0

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

type Processes added in v1.4.2

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

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, error)
	UpdateRule(ctx context.Context, rule Rule) (Rule, error)
	DeleteRule(ctx context.Context, ruleID int) error
}

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 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 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 SysdigCommon added in v1.1.0

type SysdigCommon interface {
	Common
	GroupMappingInterface
}

type SysdigMonitor added in v1.1.0

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"`
}

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 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)
}

Jump to

Keyboard shortcuts

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