Documentation ¶
Index ¶
- Constants
- Variables
- func Authorize(emailid, token string, asRoot bool) (string, error)
- func DeAuthorize(asRoot bool) (string, error)
- func FileExists(filename string) bool
- func FortifyK8sCluster(tenant, clusterName string, force bool) (string, error)
- func RunAs(cmdstr, user string, pipeInput string) (string, error)
- func RunCmd(cmdstr string) (string, error)
- func RunCmdWithInput(cmdstr string, pipeInput string) (string, error)
- func RunControl(cmdArgs []string, user string, exitOnFailure bool, pipeInput string) (string, error)
- func RunControlOut(cmdArgs []string, user string, exitOnFailure bool, out *bytes.Buffer, ...) error
- func RunStrControl(cmdstr, user string, exitOnFailure bool, pipeInput string) (string, error)
- func SetAraalictlPath(newPath string)
- func TenantAddUser(tenantID, userEmail, userName string) (string, error)
- func TenantCreate(userEmail, tenantName, UserName string) (string, error)
- func TenantDelete(tenantID string) (string, error)
- func TenantDeleteUser(tenantID, userEmail, userName string) (string, error)
- func UpdateLinks(zone, app, tenant string, links []Link) (string, error)
- type AlertCard
- type AlertInfo
- type AlertPage
- type App
- type Compute
- type ComputeCount
- type DirectionCounts
- type EndPoint
- type FortifyHelmValues
- type Insight
- type Link
- type Vulnerability
- type Zone
Constants ¶
const ONE_DAY = 24 * 60 * time.Minute
Constants
Variables ¶
var ActlPath = "/opt/araali/bin/araalictl"
Araalictl path
var CommandDebug = false
CommandDebug - logs every command that is executed
Functions ¶
func FortifyK8sCluster ¶
FortifyK8sCluster - for tenant
func RunControl ¶
func RunControl(cmdArgs []string, user string, exitOnFailure bool, pipeInput string) (string, error)
RunControl takes a command and runs it, control is for whether to exit
func RunControlOut ¶
func RunControlOut(cmdArgs []string, user string, exitOnFailure bool, out *bytes.Buffer, in *bytes.Buffer) error
RunControlOut takes a command and runs it, control is for whether to exit, allows output to go to stdout
func RunStrControl ¶
RunStrControl takes a command string and runs it, control is for whether to exit
func TenantAddUser ¶
TenantAddUser - to add a user to a tenant
func TenantCreate ¶
TenantCreate - to create a tenant
func TenantDelete ¶
TenantDelete - to delete a tenant
func TenantDeleteUser ¶
TenantDeleteUser - to delete a user from a tenant
Types ¶
type AlertCard ¶
type AlertCard struct { TotalAlerts uint64 `yaml:"alert_summary"` AlertDetails []Zone `yaml:"alert_details,omitempty"` }
func GetAlertCard ¶
GetAlertCard - get AlertCard for tenant.
type AlertInfo ¶
type AlertInfo struct { CommunicationAlertType string `yaml:"communication_alert_type,omitempty"` ProcessAlertType string `yaml:"process_alert_type,omitempty"` ReOpenCount uint32 `yaml:"reopen_count,omitempty"` Status string `yaml:"status,omitempty"` }
AlertInfo object
type AlertPage ¶
type AlertPage struct { PagingToken string Alerts []Link // contains filtered or unexported fields }
AlertPage
func GetAlerts ¶
func GetAlerts(tenant string, startTime, endTime int64, count int32, fetchAll bool) (AlertPage, error)
GetAlerts - get all alerts for a tenant between specified time. tenant: this is optional can be set to emtpy. startTime: is optional, should be epoch expressed in seconds. If 0 will be set to currentTime - 1 day. endTime: is optional, should be epoch expressed in seconds. If 0 will be set to currentTime. count: is optional, should be number of alerts we want to fetch at a time. If 0 will be defaulted 100. Sample usage: startTime := time.Now().Add(-(3 * araalictl.ONE_DAY)).Unix() alertPage := araalictl.GetAlerts("", startTime, 0, 25) fmt.Printf("Fetched %d alerts.\n", len(alertPage.Alerts))
for { if !alertPage.HasNext() { fmt.Println("Done fetching!") break } alertPage.NextPage() fmt.Printf("Fetched %d alerts.\n", len(alertPage.Alerts)) }
type App ¶
type App struct { ZoneName string AppName string `yaml:"app_name"` Links []Link `yaml:"links,omitempty"` DefinedCounts DirectionCounts `yaml:"defined_policies,omitempty"` DeniedCounts DirectionCounts `yaml:"denied_policies,omitempty"` AlertCounts DirectionCounts `yaml:"alerts,omitempty"` ServiceCounts DirectionCounts `yaml:"services,omitempty"` ComputeCounts ComputeCount `yaml:"compute,omitempty"` AraaliUrl string `yaml:"araali_url,omitempty"` }
type Compute ¶
type Compute struct { Name string `yaml:"name"` IpAddress string `yaml:"ip_address"` Uuid string `yaml:"uuid"` Image string `yaml:"image"` Zone string `yaml:"zone"` Apps []App `yaml:"apps"` Processes []string `yaml:"processes"` State string `yaml:"state"` AssetType string `yaml:"asset_type"` ProcessCapabilities []string `yaml:"process_capabilities"` IpAddresses []string `yaml:"ip_addresses"` OriginalUuid string `yaml:"original_uuid` Vulnerabilities []Vulnerability `yaml:"vulnerabilities"` Mode string `yaml:"mode"` OsName string `yaml:"os_name"` }
func GetCompute ¶
GetCompute - return VMs and containers for given zone/app with vulnerability info
type ComputeCount ¶
type DirectionCounts ¶
type DirectionCounts struct { Total uint64 `yaml:"total,omitempty"` Ingress uint64 `yaml:"ingress,omitempty"` PerimeterIngress uint64 `yaml:"perimeter_ingress,omitempty"` Internal uint64 `yaml:"internal,omitempty"` Egress uint64 `yaml:"egress,omitempty"` PerimeterEgress uint64 `yaml:"perimeter_egress,omitempty"` }
type EndPoint ¶
type EndPoint struct { Zone string `yaml:"zone,omitempty"` App string `yaml:"app,omitempty"` Process string `yaml:"process,omitempty"` BinaryName string `yaml:"binary_name,omitempty"` ParentProcess string `yaml:"parent_process,omitempty"` DnsPattern string `yaml:"dns_pattern,omitempty"` Subnet string `yaml:"subnet,omitempty"` NetMask uint32 `yaml:"netmask,omitempty"` DstPort uint32 `yaml:"dst_port,omitempty"` OrigZone string `yaml:"orig_zone,omitempty"` OrigApp string `yaml:"orig_app,omitempty"` OrigProcess string `yaml:"orig_process,omitempty"` OrigBinaryName string `yaml:"orig_binary_name,omitempty"` OrigParentProcess string `yaml:"orig_parent_process,omitempty"` OrigDnsPattern string `yaml:"orig_dns_pattern,omitempty"` OrigSubnet string `yaml:"orig_subnet,omitempty"` OrigNetMask uint32 `yaml:"orig_netmask,omitempty"` OrigDstPort uint32 `yaml:"orig_dst_port,omitempty"` // contains filtered or unexported fields }
Endpoint Object
type FortifyHelmValues ¶
type FortifyHelmValues struct { WorkloadId string `yaml:"workload_id"` ClusterName string `yaml:"cluster_name"` Fog string `yaml:"fog"` Zone string `yaml:"zone"` App string `yaml:"app"` Enforce bool `yaml:"enforce"` Upgrade bool `yaml:"upgrade"` AutoK8SImage string `yaml:"autok8s_image"` FwImage string `yaml:"fw_image"` FwInitImage string `yaml:"fw_init_image"` }
FortifyHelmValues
func FortifyK8SGenerateHelm ¶
func FortifyK8SGenerateHelm(tenantID, clusterName string) (*FortifyHelmValues, error)
FortifyK8SGenerateHelm - Generates values.yaml for araali fortification helm chart
type Insight ¶
type Insight struct { InsightType string `yaml:"insighttype"` Url string `yaml:"url,omitempty"` Count int `yaml:"count"` }
InsightCounts
func GetInsights ¶
type Link ¶
type Link struct { Client EndPoint Server EndPoint Type string Speculative bool State string Timestamp uint64 UniqueId string `yaml:"unique_id"` NewState string `yaml:"new_state,omitempty"` PagingToken string `yaml:"paging_token,omitempty"` AlertInfo AlertInfo `yaml:"alert_info,omitempty"` }
Link Object