audit

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// CSVHeader with columns
	CSVHeader = strings.Join([]string{"Level", "Instance Count", "Group ID", "Port Range", "Protocol", "IP CIDR", "Description"}, ",")
)

Functions

This section is empty.

Types

type AWS

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

AWS Related Services

func NewAWS

func NewAWS(profile, region string) (*AWS, error)

NewAWS for a new AWS variable with EC2 Service initialized

func (*AWS) DescribeInstances

func (a *AWS) DescribeInstances() ([]*ec2.Instance, error)

DescribeInstances to call DescribeInstances API

func (*AWS) DescribeSecurityGroups

func (a *AWS) DescribeSecurityGroups() ([]*ec2.SecurityGroup, error)

DescribeSecurityGroups to call DescribeSecurityGroups API

type Result

type Result struct {
	SecurityGroupID string
	Permissions     *ec2.IpPermission
	IPRange         *ec2.IpRange
	IPv6Range       *ec2.Ipv6Range
	SeverityLevel   SeverityLevel
	InstanceCount   int
	Color           *color.Color
	PortRange       string
}

Result type to structure the log output

func Audit

func Audit(sg *ec2.SecurityGroup) []Result

Audit for auditing the security group

func (*Result) AddColor

func (r *Result) AddColor()

AddColor to update the color

func (*Result) Print

func (r *Result) Print(format ResultFormat)

Print for printing out the logs in color form.

func (*Result) String

func (r *Result) String(rf ResultFormat) string

type ResultFormat

type ResultFormat int

ResultFormat for formatting result type

const (
	// ResultFormatCSV for CSV Formatted String
	ResultFormatCSV ResultFormat = iota
	// ResultFormatLog for Log Formatted String
	ResultFormatLog
	// ResultFormatLogColor for Log Formatted String with Color
	ResultFormatLogColor
)

type SeverityLevel

type SeverityLevel int

SeverityLevel type

const (
	// SeverityLevelNone is the initial level
	SeverityLevelNone SeverityLevel = iota
	// SeverityLevelChecked can be ignored as it has already been checked
	SeverityLevelChecked
	// SeverityLevelSkip can be skipped
	SeverityLevelSkip
	// SeverityLevelWarning can be ok
	SeverityLevelWarning
	// SeverityLevelCritical can be disasterous
	SeverityLevelCritical
)

Jump to

Keyboard shortcuts

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