model

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SecurityFindingTypeConsoleSignin                  string = "Console Signin"
	SecurityFindingTypeConsoleSigninNoMfa             string = "Console Signin No MFA"
	SecurityFindingTypeUnauthorizedAPICalls           string = "Unauthorized API Calls"
	SecurityFindingTypeRootLogin                      string = "Root Login"
	SecurityFindingTypeCloudTrailConfigurationChanges string = "Cloud Trail Configuration Changes"
	SecurityFindingFailedAuthentication               string = "Failed Authentication"
	SecurityFindingDisableOrDeleteCMK                 string = "Disable or Delete CMK"
	SecurityFindingS3BucketPolicyChanges              string = "S3 Bucket Policy Changes"
	SecurityFindingAWSConfigChanges                   string = "AWS Config Changes"
	SecurityFindingSecurityGroupChanges               string = "Security Group Changes"
	SecurityFindingIAMChanges                         string = "IAM Changes"

	SecurityFindingNACLChanges       string = "NACL Changes"
	SecurityFindingNetworkGWChanges  string = "Network GW Changes"
	SecurityFindingRouteTableChanges string = "Route Table Changes"
	SecurityFindingVPCChanges        string = "VPC Changes"
)

Variables

View Source
var CombiningLogicalOperators = []Operator{OperatorAnd, OperatorOr}

Functions

func GetMandatoryArrayValue

func GetMandatoryArrayValue(jsonMap *map[string]interface{}, key string) (*[]interface{}, error)

func GetMandatoryMapValue

func GetMandatoryMapValue(jsonMap *map[string]interface{}, key string) (*map[string]interface{}, error)

func GetMandatoryStringValue

func GetMandatoryStringValue(jsonMap *map[string]interface{}, key string) (string, error)

func GetOptionalStringValue

func GetOptionalStringValue(jsonMap *map[string]interface{}, key string, defaultValue *string) *string

Types

type AccountContext

type AccountContext struct {
	Id              string
	Name            string
	Region          string
	SpaceId         string
	Team            string
	EnvironmentType string
	Session         *session.Session
	AccountNames    map[string]string
	AccountContexts map[string]*AccountContext
}

type Action

type Action struct {
	Prioritize int
	Alert      bool
	Archive    bool
}

type CriteriaPart

type CriteriaPart struct {
	Path     *string
	Operator *Operator
	Value    *string
	Criteria []*CriteriaPart
}

type Operator

type Operator string
const (
	OperatorEquals    Operator = "=="
	OperatorNotEquals Operator = "!="
	OperatorAnd       Operator = "&&"
	OperatorOr        Operator = "||"
	OperatorUndefined Operator = "?"
)

type OrganizationContext

type OrganizationContext struct {
	MasterAccountContext *AccountContext
	LogAccountContext    *AccountContext
	AccountContexts      []*AccountContext
}

type ProcessingRun

type ProcessingRun struct {
	Id          string    `json:"id"`
	SpaceId     string    `json:"spaceId"`
	Key         string    `json:"key"`
	PeriodStart time.Time `json:"modified"`
	PeriodEnd   time.Time `json:"modified"`
	Created     time.Time `json:"created"`
	Modified    time.Time `json:"modified"`
	// contains filtered or unexported fields
}

type Resource

type Resource struct {
	Id              string           `json:"id"`
	ParentId        *string          `json:"parent_id"`
	Key             string           `json:"key"`
	Category        ResourceCategory `json:"category"`
	Type            string           `json:"type"`
	SpaceId         string           `json:"spaceId"`
	AccountId       string           `json:"accountId"`
	AccountName     string           `json:"accountName"`
	Region          string           `json:"region"`
	Team            string           `json:"team"`
	EnvironmentType string           `json:"environmentType"`

	Labels            *map[string]interface{} `json:"labels"`
	Metadata          *map[string]interface{} `json:"metadata"`
	VulnerabilityKeys []string                `json:"vulnerabilityKeys" pg:",array"`

	State ResourceState `json:"state"`

	Created       time.Time `json:"created"`
	Modified      time.Time `json:"modified"`
	LastObserved  time.Time `json:"lastObserved"`
	FirstObserved time.Time `json:"firstObserved"`

	ParentKey *string `pg:"-"`
	// contains filtered or unexported fields
}

type ResourceCategory

type ResourceCategory string
const (
	ResourceCategoryAccount           ResourceCategory = "account"
	ResourceCategoryRegion            ResourceCategory = "region"
	ResourceCategoryDomainName        ResourceCategory = "domain-name"
	ResourceCategoryIp                ResourceCategory = "ip"
	ResourceCategoryPort              ResourceCategory = "port"
	ResourceCategoryAwsConfigResource ResourceCategory = "aws-config-resource"
)

type ResourceState

type ResourceState string
const (
	ResourceStateActive   ResourceState = "active"
	ResourceStateArchived ResourceState = "archived"
)

type Rule

type Rule struct {
	Id       string
	Category string
	Key      string
	Priority int
	Enabled  bool
	Criteria []*CriteriaPart
	Action   Action
}

type RuleApplyResult

type RuleApplyResult struct {
	SecurityFinding  *SecurityFinding
	Author           string
	Comment          string
	Changed          bool
	Prioritized      bool
	Alerted          bool
	AlertActivated   bool
	AlertDeactivated bool
}

type SecurityFinding

type SecurityFinding struct {
	Id              string                  `json:"id"`
	SpaceId         string                  `json:"spaceId"`
	AccountId       string                  `json:"accountId"`
	AccountName     string                  `json:"accountName"`
	Region          string                  `json:"region"`
	Team            string                  `json:"team"`
	EnvironmentType string                  `json:"environmentType"`
	ResourceType    *string                 `json:"resourceType"`
	ResourceId      *string                 `json:"resourceId"`
	Category        SecurityFindingCategory `json:"category"`
	Type            string                  `json:"type"`
	Key             string                  `json:"key"`
	SourceType      string                  `json:"sourceType"`
	SourceId        string                  `json:"sourceId"`
	Title           string                  `json:"title"`
	Description     string                  `json:"description" pg:",use_zero"`

	Labels   *map[string]interface{} `json:"labels"`
	Metadata *map[string]interface{} `json:"metadata"`

	JiraIssueKey *string `json:"jiraIssueKey"`

	Priority         int  `pg:",use_zero" json:"priority"`
	OriginalPriority int  `pg:",use_zero" json:"originalPriority"`
	SourcePriority   int  `pg:",use_zero" json:"sourcePriority"`
	RulePriority     *int `pg:",use_zero" json:"rulePriority"`
	ManualPriority   *int `pg:",use_zero" json:"manualPriority"`

	State      SecurityFindingState      `json:"state"`
	AlertState SecurityFindingAlertState `json:"alertState"`

	LastComment string `json:"lastComment"`
	LastAuthor  string `json:"lastAuthor"`

	Created       time.Time `json:"created"`
	Modified      time.Time `json:"modified"`
	LastObserved  time.Time `json:"lastObserved"`
	FirstObserved time.Time `json:"firstObserved"`
	// contains filtered or unexported fields
}

type SecurityFindingAlertState

type SecurityFindingAlertState string
const (
	AlertStateInactive SecurityFindingAlertState = "inactive"
	AlertStateActive   SecurityFindingAlertState = "active"
)

type SecurityFindingCategory

type SecurityFindingCategory string
const (
	CategoryCompliance    SecurityFindingCategory = "compliance"
	CategoryAnomaly       SecurityFindingCategory = "anomaly"
	CategoryVulnerability SecurityFindingCategory = "vulnerability"
	CategoryWarning       SecurityFindingCategory = "warning"
	CategoryNotification  SecurityFindingCategory = "notification"
)

type SecurityFindingReportRow

type SecurityFindingReportRow struct {
	Id              string                  `json:"id"`
	SpaceId         string                  `json:"spaceId"`
	Key             string                  `json:"key"`
	AccountId       string                  `json:"accountId"`
	AccountName     string                  `json:"accountName"`
	Region          string                  `json:"region"`
	Team            string                  `json:"team"`
	EnvironmentType string                  `json:"environmentType"`
	SourceType      string                  `json:"sourceType"`
	Category        SecurityFindingCategory `json:"category"`
	Type            string                  `json:"type"`
	Priority        int                     `pg:",use_zero" json:"priority"`
	FindingCount    int                     `pg:",use_zero" json:"findingCount"`
	RowDate         time.Time               `json:"rowDate"`
	Created         time.Time               `json:"created"`
	Modified        time.Time               `json:"modified"`
	// contains filtered or unexported fields
}

type SecurityFindingState

type SecurityFindingState string
const (
	StateActive   SecurityFindingState = "active"
	StateArchived SecurityFindingState = "archived"
)

type StateChange

type StateChange struct {
	Id                string
	SpaceId           string `json:"spaceId"`
	SecurityFindingId string

	Metadata *map[string]interface{}
	State    SecurityFindingState
	Priority int `pg:",use_zero"`
	Comment  string
	Author   string

	Created  time.Time
	Modified time.Time
	// contains filtered or unexported fields
}

type Version

type Version struct {
	Type    string    `pg:"type,pk" json:"type"`
	Version string    `pg:"version,pk" json:"version"`
	Created time.Time `json:"created"`
	// contains filtered or unexported fields
}

type Vulnerability

type Vulnerability struct {
	Id  string `json:"id"`
	Key string `json:"key"`

	Source   string  `json:"source"`
	Summary  string  `json:"summary"`
	Severity int     `json:"severity"`
	Score    float64 `json:"score"`

	Metadata   *map[string]interface{} `json:"metadata"`
	References []string                `json:"references" pg:",array"`

	Created  time.Time `json:"created"`
	Modified time.Time `json:"modified"`
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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