secure

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2020 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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

	RuleType string `json:"ruleType"`
}

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

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(Policy) (Policy, error)
	DeletePolicy(int) error
	UpdatePolicy(Policy) (Policy, error)
	GetPolicyById(int) (Policy, error)

	CreateRule(Rule) (Rule, error)
	GetRuleByID(int) (Rule, error)
	UpdateRule(Rule) (Rule, error)
	DeleteRule(int) error

	CreateNotificationChannel(NotificationChannel) (NotificationChannel, error)
	GetNotificationChannelById(int) (NotificationChannel, error)
	DeleteNotificationChannel(int) error
	UpdateNotificationChannel(NotificationChannel) (NotificationChannel, error)

	CreateUser(User) (User, error)
	GetUserById(int) (User, error)
	DeleteUser(int) error
	UpdateUser(User) (User, error)

	CreateTeam(Team) (Team, error)
	GetTeamById(int) (Team, error)
	DeleteTeam(int) error
	UpdateTeam(Team) (Team, error)
}

func NewSysdigSecureClient

func NewSysdigSecureClient(sysdigSecureAPIToken string, url 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 User

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

-------- User --------

func UserFromJSON

func UserFromJSON(body []byte) User

func (*User) ToJSON

func (u *User) ToJSON() io.Reader

type UserRoles

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

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

Jump to

Keyboard shortcuts

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