securityhubcollector

package
v0.0.0-...-806063b Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildAcctMap

func BuildAcctMap(jsonTeams Teams) map[string]string

BuildAcctMap - builds a map of accounts to teams from a map of teams to accounts. The JSON file (and the Teams object we extract from it) maps teams to a list of accounts (because that is easiest for humans), but what we really want for building our output is to have a mapping of accounts to teams, because accounts are what we actually get from the security hub finding.

Types

type HubCollector

type HubCollector struct {
	Logger    *zap.Logger
	HubClient securityhubiface.SecurityHubAPI
	Outfile   string
	AcctMap   map[string]string
}

HubCollector is a generic struct used to hold setting info

func (*HubCollector) ConvertFindingToRows

func (h *HubCollector) ConvertFindingToRows(finding *securityhub.AwsSecurityFinding) [][]string

ConvertFindingToRows - converts a single finding to the record format we're using

func (*HubCollector) GetSecurityHubFindings

func (h *HubCollector) GetSecurityHubFindings() ([]*securityhub.AwsSecurityFinding, error)

GetSecurityHubFindings - gets all security hub findings from a single AWS account

func (*HubCollector) WriteFindingsToOutput

func (h *HubCollector) WriteFindingsToOutput(findings []*securityhub.AwsSecurityFinding) (err error)

WriteFindingsToOutput - takes a list of security

type Team

type Team struct {
	Name     string   `json:"name"`
	Accounts []string `json:"accounts"`
}

Team is a struct describing a single team and its accounts as we expect in the JSON file describing team mappings

type Teams

type Teams struct {
	Teams []Team `json:"teams"`
}

Teams is a struct describing the format we expect in the JSON file describing the team mappings

func ReadTeamMap

func ReadTeamMap(jsonFile string) (jsonTeams Teams, err error)

ReadTeamMap - takes the JSON encoded file that maps teams to accounts and converts it into a Teams object that we can use later.

Jump to

Keyboard shortcuts

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