internal

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2023 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TxtLoggerName = "root"
	TxtLog        = TxtLogger()
	UtilsFs       = afero.NewOsFs()
)

Functions

func AWSConfigFileLoader

func AWSConfigFileLoader(AWSProfile string, version string) aws.Config

func AWSWhoami

func AWSWhoami(awsProfile string, version string) (*sts.GetCallerIdentityOutput, error)

func BuildAWSPath

func BuildAWSPath(Caller sts.GetCallerIdentityOutput) string

func CheckErr

func CheckErr(e error, msg string)

func ConfirmSelectedProfiles

func ConfirmSelectedProfiles(AWSProfiles []string) bool

func Contains

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

Checks if element is part of array.

func GetAADUsersClient

func GetAADUsersClient(tenantID string) graphrbac.UsersClient

func GetAllAWSProfiles

func GetAllAWSProfiles(AWSConfirm bool) []string

func GetEnabledRegions

func GetEnabledRegions(awsProfile string, version string) []string

func GetLogDirPath

func GetLogDirPath() *string

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

func GetNICClient

func GetNICClient(subscriptionID string) network.InterfacesClient

func GetPublicIPClient

func GetPublicIPClient(subscriptionID string) network.PublicIPAddressesClient

func GetResourceGroupsClient

func GetResourceGroupsClient(subscriptionID string) resources.GroupsClient

func GetRoleAssignmentsClient

func GetRoleAssignmentsClient(subscriptionID string) authorization.RoleAssignmentsClient

func GetRoleDefinitionsClient

func GetRoleDefinitionsClient(subscriptionName string) authorization.RoleDefinitionsClient

func GetSelectedAWSProfiles

func GetSelectedAWSProfiles(AWSProfilesListPath string) []string

func GetStorageClient

func GetStorageClient(subscriptionID string) storage.AccountsClient

func GetSubscriptionsClient

func GetSubscriptionsClient() subscriptions.Client

func GetTenantsClient

func GetTenantsClient() subscriptions.TenantsClient

func GetVirtualMachinesClient

func GetVirtualMachinesClient(subscriptionID string) compute.VirtualMachinesClient

func LoadFileLinesIntoArray

func LoadFileLinesIntoArray(input string) []string

func MockFileSystem

func MockFileSystem(switcher bool)

func OutputSelector

func OutputSelector(verbosity int, outputType string, header []string, body [][]string, outputDirectory string, fileName string, callingModule string, wrapTable bool, prefixIdentifier 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" prefixIdentifier = this string gets printed with control message calling module (e.g. aws profile, azure resource group, gcp project, etc)

func PrintTableToScreen

func PrintTableToScreen(header []string, body [][]string, wrapLines bool)

func SpinUntil

func SpinUntil(callingModuleName string, counter *CommandCounter, done chan bool, spinType string)

func TxtLogger

func TxtLogger() *logrus.Logger

txtLogger - Returns the txt logger

Types

type CommandCounter

type CommandCounter struct {
	Total     int
	Pending   int
	Complete  int
	Error     int
	Executing int
}

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