internal

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2023 License: MIT Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TxtLoggerName = "root"
	TxtLog        = TxtLogger()
	UtilsFs       = afero.NewOsFs()
)
View Source
var Cache = cache.New(120*time.Minute, 0)
View Source
var ErrDirectoryDoesNotExist = errors.New("directory does not exist")

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 GetARMresourcesClient added in v1.10.0

func GetARMresourcesClient(tenantID, subscriptionID string) *armresources.Client

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 GetStorageAccountBlobClient added in v1.10.0

func GetStorageAccountBlobClient(tenantID, storageAccountName string) (*azblob.Client, error)

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 LoadCacheFromFiles added in v1.11.0

func LoadCacheFromFiles(directory string) error

func LoadCacheFromGobFiles added in v1.11.0

func LoadCacheFromGobFiles(directory string) error

func LoadFileLinesIntoArray

func LoadFileLinesIntoArray(input string) []string

func MockFileSystem

func MockFileSystem(switcher bool) afero.Fs

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 ReorganizeAWSProfiles added in v1.11.0

func ReorganizeAWSProfiles(allProfiles []string, mgmtProfile string) []string

func SaveCacheToFiles added in v1.11.0

func SaveCacheToFiles(directory string, accountID string) error

func SaveCacheToGobFiles added in v1.11.0

func SaveCacheToGobFiles(directory string, accountID string) error

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 LootClient added in v1.10.0

type LootClient struct {
	DirectoryName string
	LootFiles     []LootFile
}

type LootFile added in v1.10.0

type LootFile struct {
	Name        string
	FilePointer afero.File
	Contents    string
}

type OutputClient added in v1.10.0

type OutputClient struct {
	Verbosity        int
	CallingModule    string
	PrefixIdentifier string
	Table            TableClient
	Loot             LootClient
}

func (*OutputClient) WriteFullOutput added in v1.10.0

func (o *OutputClient) WriteFullOutput(tables []TableFile, lootFiles []LootFile)

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

type TableClient added in v1.10.0

type TableClient struct {
	Wrap          bool
	DirectoryName string
	TableFiles    []TableFile
}

type TableFile added in v1.10.0

type TableFile struct {
	Name             string
	TableFilePointer afero.File
	CSVFilePointer   afero.File
	JSONFilePointer  afero.File
	Header           []string
	Body             [][]string
}

Directories

Path Synopsis
aws

Jump to

Keyboard shortcuts

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