api

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetSCCHealthStatus

func GetSCCHealthStatus(url string) int

GetSCCHealthStatus gets Google Security Command Center health information and returns 1 on healthy response, 0 otherwise Check is performed by fetching list of incidents from Google Cloud Status Dashboard and checking if there are ongoing incidents with cloud-security-command-center; url parameter should be set to https://status.cloud.google.com/incidents.json for proper result retrieval

func GetSCCLatestEventTime

func GetSCCLatestEventTime(sources map[string]string) (map[string]time.Duration, error)

GetSCCLatestEventTime return map of sources and their latest event update time difference with now original: https://github.com/GoogleCloudPlatform/golang-samples/blob/master/securitycenter/findings/list_filtered_findings.go

func GetSCCSourcesByName

func GetSCCSourcesByName(orgID string, nameRegex string) (map[string]string, error)

GetSCCSourcesByName returns Security Command Center sources for given numeric orgID, filtered by name by given regex original: https://github.com/GoogleCloudPlatform/golang-samples/blob/master/securitycenter/findings/list_sources.go

Types

type ComplianceInfo

type ComplianceInfo struct {
	Name              string `json:"name"`
	Description       string `json:"description"`
	PoliciesCount     int    `json:"assignedPolicies"`
	PassedAssetsCount int    `json:"passedResources"`
	FailedAssetsCount int    `json:"failedResources"`
	TotalAssetsCount  int    `json:"totalResources"`
}

ComplianceInfo store assets compliance information for single policy

type CompliancePosture

type CompliancePosture struct {
	ComplianceDetails []ComplianceInfo `json:"complianceDetails"`
}

CompliancePosture stores overall posture statistics and is required to unwrap the nested JSON scheme

type Prisma

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

Prisma contain credentials for API access

func NewPrisma

func NewPrisma(username, password, apiURL string) *Prisma

NewPrisma returns new Prisma client

func (*Prisma) GatherComplianceInfo

func (p *Prisma) GatherComplianceInfo() ([]ComplianceInfo, error)

GatherComplianceInfo get assets compliance information for last day https://api.docs.prismacloud.io/reference#compliance-posture

func (*Prisma) GetAPIHealthStatus

func (p *Prisma) GetAPIHealthStatus() int

GetAPIHealthStatus gets Prisma API health information and returns 1 on healthy response, 0 otherwise https://api.docs.prismacloud.io/reference#health-check

Jump to

Keyboard shortcuts

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