config

package
v2.1.9 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

View Source
const EnvPrefix string = "AZUREHOUND"

Variables

View Source
var (
	// Global Configurations
	ConfigFile = Config{
		Name:       "config",
		Shorthand:  "c",
		Usage:      fmt.Sprintf("AzureHound configuration file (default: %s)", DefaultConfigFile),
		Persistent: true,
		Default:    DefaultConfigFile,
	}
	VerbosityLevel = Config{
		Name:       "verbosity",
		Shorthand:  "v",
		Usage:      fmt.Sprintf("AzureHound verbosity level (defaults to %d) [Min: %d, Max: %d]", 0, -1, 2),
		Persistent: true,
		Default:    0,
	}
	JsonLogs = Config{
		Name:       "json",
		Shorthand:  "",
		Usage:      "Output logs as json",
		Persistent: true,
		Default:    false,
	}
	JWT = Config{
		Name:       "jwt",
		Shorthand:  "j",
		Usage:      "Use an acquired JWT to authenticate into Azure",
		Persistent: true,
		Default:    "",
	}
	LogFile = Config{
		Name:       "log-file",
		Shorthand:  "",
		Usage:      "Output logs to this file",
		Persistent: true,
		Default:    "",
	}
	Proxy = Config{
		Name:       "proxy",
		Shorthand:  "",
		Usage:      "Sets the proxy URL for the AzureHound service",
		Persistent: true,
		Default:    "",
	}
	RefreshToken = Config{
		Name:       "refresh-token",
		Shorthand:  "r",
		Usage:      "Use an acquired refresh token to authenticate into Azure",
		Persistent: true,
		Default:    "",
	}
	Pprof = Config{
		Name:       "pprof",
		Usage:      "During graceful shutdown, prints the pprof profile with the provided name to stderr",
		Persistent: true,
		Default:    "",
	}

	// Azure Configurations
	AzAppId = Config{
		Name:       "app",
		Shorthand:  "a",
		Usage:      "The Application Id that the Azure app registration portal assigned when the app was registered.",
		Persistent: true,
		Default:    "",
	}
	AzSecret = Config{
		Name:       "secret",
		Shorthand:  "s",
		Usage:      "The Application Secret that was generated for the app in the app registration portal.",
		Persistent: true,
		Default:    "",
	}
	AzCert = Config{
		Name:       "cert",
		Shorthand:  "",
		Usage:      "The path to the certificate uploaded to the app registration portal.",
		Persistent: true,
		Default:    "",
	}
	AzKey = Config{
		Name:       "key",
		Shorthand:  "k",
		Usage:      "The path to the key file for a certificate uploaded to the app registration portal.",
		Persistent: true,
		Default:    "",
	}
	AzKeyPass = Config{
		Name:       "keypass",
		Shorthand:  "",
		Usage:      "The passphrase to use in conjuction with --key ${key file}.",
		Persistent: true,
		Default:    "",
	}
	AzRegion = Config{
		Name:       "region",
		Shorthand:  "",
		Usage:      fmt.Sprintf("The region of the Azure Cloud deployment (defaults to '%s') [%s]", constants.Cloud, strings.Join(AzRegions, ", ")),
		Persistent: true,
		Default:    constants.Cloud,
	}
	AzTenant = Config{
		Name:       "tenant",
		Shorthand:  "t",
		Usage:      "The directory tenant that you want to request permission from. This can be in GUID or friendly name format.",
		Required:   true,
		Persistent: true,
		Default:    "",
	}
	AzAuthUrl = Config{
		Name:       "auth",
		Shorthand:  "",
		Usage:      "The Azure ActiveDirectory Authority URL.",
		Persistent: true,
		Default:    "",
	}
	AzGraphUrl = Config{
		Name:       "graph",
		Shorthand:  "",
		Usage:      "The Microsoft Graph URL.",
		Persistent: true,
		Default:    "",
	}
	AzMgmtUrl = Config{
		Name:       "mgmt",
		Shorthand:  "",
		Usage:      "The URL of the Azure Resource Manager.",
		Persistent: true,
		Default:    "",
	}
	AzUsername = Config{
		Name:       "username",
		Shorthand:  "u",
		Usage:      "The user principal name for the Azure Portal",
		Persistent: true,
		Default:    "",
	}
	AzPassword = Config{
		Name:       "password",
		Shorthand:  "p",
		Usage:      "The user's password for the Azure Portal",
		Persistent: true,
		Default:    "",
	}
	AzSubId = Config{
		Name:       "subscriptionId",
		Shorthand:  "b",
		Usage:      "The subscription ID to use as a filter.",
		Persistent: true,
		Default:    []string{},
	}
	AzMgmtGroupId = Config{
		Name:       "mgmtGroupId",
		Shorthand:  "m",
		Usage:      "The management group ID to use as a filter.",
		Persistent: true,
		Default:    []string{},
	}

	// BHE Configurations
	BHEUrl = Config{
		Name:       "instance",
		Shorthand:  "i",
		Usage:      "The BloodHound Enterprise instance URL.",
		Persistent: true,
		Required:   true,
		Default:    "",
	}

	BHEToken = Config{
		Name:       "token",
		Shorthand:  "",
		Usage:      "The BloodHound Enterprise token.",
		Persistent: true,
		Required:   true,
		Default:    "",
	}

	BHETokenId = Config{
		Name:       "tokenId",
		Shorthand:  "",
		Usage:      "The BloodHound Enterprise token ID.",
		Persistent: true,
		Required:   true,
		Default:    "",
	}

	// Command specific configurations
	KeyVaultAccessTypes = Config{
		Name:       "access-types",
		Shorthand:  "",
		Usage:      fmt.Sprintf("Filter key vault policies by one or more access type. [%s]\n\tNote: may be used multiple times or values may be provided as comma-separated list\n", strings.Join(enums.KeyVaultAccessPolicies(), ", ")),
		Persistent: true,
		Default:    []enums.KeyVaultAccessType{},
	}

	OutputFile = Config{
		Name:       "output",
		Shorthand:  "o",
		Usage:      "The path to the file in which to output data",
		Persistent: true,
		Default:    "",
	}

	GlobalConfig = []Config{
		ConfigFile,
		VerbosityLevel,
		JsonLogs,
		JWT,
		LogFile,
		Proxy,
		RefreshToken,
		Pprof,
	}

	AzureConfig = []Config{
		AzAppId,
		AzSecret,
		AzCert,
		AzKey,
		AzKeyPass,
		AzRegion,
		AzTenant,
		AzAuthUrl,
		AzGraphUrl,
		AzMgmtUrl,
		AzUsername,
		AzPassword,
		AzSubId,
		AzMgmtGroupId,
	}

	BloodHoundEnterpriseConfig = []Config{
		BHEUrl,
		BHETokenId,
		BHEToken,
	}
)
View Source
var (

	// DefaultConfigFile is the path to the default configuration file.
	//
	// - $HOME/.config/azurehound/config.json (Unix/Darwin)
	// - %USERPROFILE%\.config\azurehound\config.json (Windows)
	DefaultConfigFile = filepath.Join(homeDir, ".config", "azurehound", "config.json")
)
View Source
var Init = config.Init
View Source
var LoadValues = config.LoadValues

Functions

func ConfigFileUsed

func ConfigFileUsed() string

func Options

func Options() config.Options

func SetAzureDefaults

func SetAzureDefaults()

func SystemConfigDirs

func SystemConfigDirs() []string

func ValidateURL

func ValidateURL(input string) error

Types

type Config

type Config = config.Config

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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