secure

package
v0.5.41 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2022 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SupportedBenchmarkTaskSchemas = []string{
	"aws_foundations_bench-1.3.0",
	"gcp_foundations_bench-1.2.0",
	"azure_foundations_bench-1.3.0",
}

Functions

This section is empty.

Types

type Action

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

type BenchmarkTask added in v0.5.19

type BenchmarkTask struct {
	ID       int    `json:"id,omitempty"`
	Name     string `json:"name"`
	Schema   string `json:"schema"`
	Scope    string `json:"scope"`
	Schedule string `json:"schedule"`
	Enabled  bool   `json:"enabled"`
}

func BenchmarkTaskFromJSON added in v0.5.19

func BenchmarkTaskFromJSON(body []byte) *BenchmarkTask

func (*BenchmarkTask) ToJSON added in v0.5.19

func (t *BenchmarkTask) ToJSON() io.Reader

type CloudAccount added in v0.5.17

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

func CloudAccountFromJSON added in v0.5.17

func CloudAccountFromJSON(body []byte) *CloudAccount

func (*CloudAccount) ToJSON added in v0.5.17

func (e *CloudAccount) ToJSON() io.Reader

type Condition

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

type Containers

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

type Details

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"`
	Condition  *Condition   `json:"condition,omitempty"`
	Priority   string       `json:"priority,omitempty"`
	Exceptions []*Exception `json:"exceptions,omitempty"`

	RuleType string `json:"ruleType"`
}

type Exception added in v0.5.16

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

type Items

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

type List

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

func ListFromJSON

func ListFromJSON(body []byte) (list List, err error)

func (*List) ToJSON

func (l *List) ToJSON() io.Reader

type Macro

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

func MacroFromJSON

func MacroFromJSON(body []byte) (macro Macro, err error)

func (*Macro) ToJSON

func (l *Macro) ToJSON() io.Reader

type MacroCondition

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

type NotificationChannel

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"`
	Options NotificationChannelOptions `json:"options"`
}

func NotificationChannelFromJSON

func NotificationChannelFromJSON(body []byte) NotificationChannel

func NotificationChannelListFromJSON

func NotificationChannelListFromJSON(body []byte) []NotificationChannel

func (*NotificationChannel) ToJSON

func (n *NotificationChannel) ToJSON() io.Reader

type NotificationChannelOptions

type NotificationChannelOptions struct {
	EmailRecipients []string `json:"emailRecipients,omitempty"` // Type: email
	SnsTopicARNs    []string `json:"snsTopicARNs,omitempty"`    // Type: SNS
	APIKey          string   `json:"apiKey,omitempty"`          // Type: VictorOps, OpsGenie
	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

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

type Policy

type Policy struct {
	ID                     int      `json:"id,omitempty"`
	Name                   string   `json:"name"`
	Description            string   `json:"description"`
	Severity               int      `json:"severity"`
	Enabled                bool     `json:"enabled"`
	RuleNames              []string `json:"ruleNames"`
	Actions                []Action `json:"actions"`
	Scope                  string   `json:"scope,omitempty"`
	Version                int      `json:"version,omitempty"`
	NotificationChannelIds []int    `json:"notificationChannelIds"`
	Type                   string   `json:"type"`
}

func PolicyFromJSON

func PolicyFromJSON(body []byte) (result Policy)

func (*Policy) ToJSON

func (policy *Policy) ToJSON() io.Reader

type Processes

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

type ReadPaths

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

type ReadWritePaths

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

type Rule

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

func RuleFromJSON

func RuleFromJSON(body []byte) (rule Rule, err error)

func (*Rule) ToJSON

func (r *Rule) ToJSON() io.Reader

type Syscalls

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

type SysdigSecureClient

type SysdigSecureClient interface {
	CreatePolicy(context.Context, Policy) (Policy, error)
	DeletePolicy(context.Context, int) error
	UpdatePolicy(context.Context, Policy) (Policy, error)
	GetPolicyById(context.Context, int) (Policy, error)

	CreateRule(context.Context, Rule) (Rule, error)
	GetRuleByID(context.Context, int) (Rule, error)
	UpdateRule(context.Context, Rule) (Rule, error)
	DeleteRule(context.Context, int) error

	CreateNotificationChannel(context.Context, NotificationChannel) (NotificationChannel, error)
	GetNotificationChannelById(context.Context, int) (NotificationChannel, error)
	GetNotificationChannelByName(context.Context, string) (NotificationChannel, error)
	DeleteNotificationChannel(context.Context, int) error
	UpdateNotificationChannel(context.Context, NotificationChannel) (NotificationChannel, error)

	CreateTeam(context.Context, Team) (Team, error)
	GetTeamById(context.Context, int) (Team, error)
	DeleteTeam(context.Context, int) error
	UpdateTeam(context.Context, Team) (Team, error)

	CreateList(context.Context, List) (List, error)
	GetListById(context.Context, int) (List, error)
	DeleteList(context.Context, int) error
	UpdateList(context.Context, List) (List, error)

	CreateMacro(context.Context, Macro) (Macro, error)
	GetMacroById(context.Context, int) (Macro, error)
	DeleteMacro(context.Context, int) error
	UpdateMacro(context.Context, Macro) (Macro, error)

	CreateVulnerabilityExceptionList(context.Context, *VulnerabilityExceptionList) (*VulnerabilityExceptionList, error)
	GetVulnerabilityExceptionListByID(context.Context, string) (*VulnerabilityExceptionList, error)
	DeleteVulnerabilityExceptionList(context.Context, string) error
	UpdateVulnerabilityExceptionList(context.Context, *VulnerabilityExceptionList) (*VulnerabilityExceptionList, error)

	CreateVulnerabilityException(context.Context, string, *VulnerabilityException) (*VulnerabilityException, error)
	GetVulnerabilityExceptionByID(context.Context, string, string) (*VulnerabilityException, error)
	DeleteVulnerabilityException(context.Context, string, string) error
	UpdateVulnerabilityException(context.Context, string, *VulnerabilityException) (*VulnerabilityException, error)

	CreateCloudAccount(context.Context, *CloudAccount) (*CloudAccount, error)
	GetCloudAccountById(context.Context, string) (*CloudAccount, error)
	DeleteCloudAccount(context.Context, string) error
	UpdateCloudAccount(context.Context, string, *CloudAccount) (*CloudAccount, error)
	GetTrustedCloudIdentity(context.Context, string) (string, error)

	CreateBenchmarkTask(context.Context, *BenchmarkTask) (*BenchmarkTask, error)
	GetBenchmarkTask(context.Context, string) (*BenchmarkTask, error)
	DeleteBenchmarkTask(context.Context, string) error
	SetBenchmarkTaskEnabled(context.Context, string, bool) error
}

func NewSysdigSecureClient

func NewSysdigSecureClient(sysdigSecureAPIToken string, url string, insecure bool) SysdigSecureClient

func WithExtraHeaders

func WithExtraHeaders(client SysdigSecureClient, extraHeaders map[string]string) SysdigSecureClient

type TCPListenPorts

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

type Team

type Team struct {
	ID                  int         `json:"id,omitempty"`
	Version             int         `json:"version,omitempty"`
	Theme               string      `json:"theme"`
	Name                string      `json:"name"`
	Description         string      `json:"description"`
	ScopeBy             string      `json:"show"`
	Filter              string      `json:"filter"`
	CanUseSysdigCapture bool        `json:"canUseSysdigCapture"`
	UserRoles           []UserRoles `json:"userRoles,omitempty"`
	DefaultTeam         bool        `json:"default"`
	Products            []string    `json:"products"`
}

-------- Team --------

func TeamFromJSON

func TeamFromJSON(body []byte) Team

func (*Team) ToJSON

func (t *Team) ToJSON() io.Reader

type UDPListenPorts

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

type UserRoles

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

type UserRulesFile

type UserRulesFile struct {
	Content string `json:"content"`
	Version int    `json:"version"`
}

func UserRulesFileFromJSON

func UserRulesFileFromJSON(body []byte) UserRulesFile

func (*UserRulesFile) ToJSON

func (userRulesFile *UserRulesFile) ToJSON() io.Reader

type UsersList

type UsersList struct {
	ID    int    `json:"id"`
	Email string `json:"username"`
}

-------- UsersList --------

func UsersListFromJSON

func UsersListFromJSON(body []byte) []UsersList

type VulnerabilityException added in v0.5.10

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

func VulnerabilityExceptionFromJSON added in v0.5.10

func VulnerabilityExceptionFromJSON(body []byte) *VulnerabilityException

func (*VulnerabilityException) ToJSON added in v0.5.10

func (e *VulnerabilityException) ToJSON() io.Reader

type VulnerabilityExceptionList added in v0.5.10

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

func VulnerabilityExceptionListFromJSON added in v0.5.10

func VulnerabilityExceptionListFromJSON(body []byte) *VulnerabilityExceptionList

func (*VulnerabilityExceptionList) ToJSON added in v0.5.10

func (l *VulnerabilityExceptionList) ToJSON() io.Reader

Jump to

Keyboard shortcuts

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