utils

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const AzureOutputDirectory = "/azure/"
View Source
const CloudFoxClientDirName = ".cloudfox"
View Source
const LogFileName = "cloudfox.log"

Variables

View Source
var (
	TxtLoggerName = "root"
	TxtLogger     = txtLogger()
)

Functions

func AWSConfigFileLoader

func AWSConfigFileLoader(AWSProfile string) aws.Config

func AWSWhoami

func AWSWhoami(awsProfile string) sts.GetCallerIdentityOutput

func AzGetResourceGroups

func AzGetResourceGroups(subscriptionID string, authorizer autorest.Authorizer) []string

func AzGetScopeInformation

func AzGetScopeInformation() map[string]map[string][]string

func AzNewGraphAuthorizer

func AzNewGraphAuthorizer(tenantID string) autorest.Authorizer

func AzNewResourceManagerAuthorizer

func AzNewResourceManagerAuthorizer() autorest.Authorizer

func Contains

func Contains(element string, array []string) bool

Checks if element is part of array.

func GetLogDirPath

func GetLogDirPath() *string

This function returns ~/.cloudfox. If the folder does not exist the function creates it.

func GetRegionsForService

func GetRegionsForService(awsProfile string, service string) []string

func InitLogging

func InitLogging() *os.File

Initializes logging. Don't forget to use 'defer file.close()' after invoking this function.

func LoadFileLinesIntoArray

func LoadFileLinesIntoArray(input string) []string

func OutputSelector

func OutputSelector(verbosity int, outputType string, header []string, body [][]string, outputDirectory string, fileName string, callingModule string)

verbosity = 1 (Output and loot printed to file). verbosity = 2 (Output and loot printed to file, output printed screen). verbosity = 3 (Output and loot printed to file and screen). outputType = "table", "csv"

Types

type OutputData

type OutputData struct {
	Headers       []*simpletable.Cell
	Body          [][]interface{}
	FilePath      string
	FullFilename  string
	CallingModule string
	Verbosity     int
	Directory     string
}

func (*OutputData) OutputSelector

func (o *OutputData) OutputSelector(Type string)

type OutputData2

type OutputData2 struct {
	Headers       []string
	Body          [][]string
	FilePath      string
	FullFilename  string
	CallingModule string
	Verbosity     int
	Directory     string
}

This struct is here to mantain compatibility with legacy cloudfox code

Jump to

Keyboard shortcuts

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