Documentation ¶
Index ¶
- func AWSCloudFrontDestroy(output DomainFrontOutput, configFile string) error
- func AskForConfirmation() bool
- func CheckForEmptyEC2Module(namesToDelete []string, state State) (names []string)
- func ContainsInt(s []int, e int) bool
- func ContainsString(s []string, e string) bool
- func CreateMasterFile(wrappers ConfigWrappers) (masterString string)
- func CreateSingleSOCKS(privateKey string, username string, ipv4 string, port int) (err error)
- func CreateTerraformMain(masterString string, configFile string)
- func DestroySOCKS(ip string)
- func ExecAnsible(hostsFile string, playbook string)
- func ExpandNumberInput(input string) []int
- func FindLargestNumber(nums []int) int
- func GenerateHostFile(instances []ListStruct, domain string, burpFile string, hostFilePath string, ...) string
- func GeneratePlaybookFile(apps []string) string
- func GetDoRegions(configFile string) (regions []string)
- func GetEC2DataToDestroy(instanceNames []string) (newInstanceNames []string)
- func InitializeTerraformFiles(configFile string)
- func IsValidNumberInput(input string) error
- func ListProxies(instances []ListStruct) (output string)
- func ParseIPFile(path string) ([]string, error)
- func PosString(slice []string, element string) int
- func PrintProxyChains(socksList string) (proxies string)
- func PrintSocksd(socksList string) (proxies string)
- func ProviderCheck(providerArray []string) bool
- func RetrieveConfig(configFilePath string) (config configStruct)
- func SplitNmapCommandsIntoHosts(ports []string, hostFile string, command string, count int, evasive bool) (commandList map[int][]string)
- func TerraformApply(configFile string)
- func TerraformDestroy(nameList []string, configFile string)
- func TerraformFirstInitialize(awsAccessID string, awsSecretKey string) string
- func UpdateConfig(configFilePath string, config configStruct)
- func ValidateNumberOfInstances(numberInput []int, listType string, configFile string) error
- func ValidatePorts(ports []string) (allports []string, err error)
- func WriteToFile(path string, content string)
- type APIOutput
- type AWSApiConfigWrapper
- type AWSDomainFront
- type AWSSecurityGroup
- type AzureDomainFront
- type AzureInstance
- type AzureProvider
- type CloudfrontConfigWrapper
- type ConfigWrappers
- func APIDeploy(provider string, targetURI string, wrappers ConfigWrappers) ConfigWrappers
- func CreateWrappersFromState(state State, configFile string) (wrappers ConfigWrappers)
- func DomainFrontDeploy(provider string, origin string, restrictUA string, functionName string, ...) ConfigWrappers
- func InstanceDeploy(providers []string, awsRegions []string, doRegions []string, ...) ConfigWrappers
- type DOConfigWrapper
- type DomainFrontOutput
- type EC2ConfigWrapper
- type GooglefrontConfigWrapper
- type InstanceState
- type ListStruct
- type ModuleState
- type OutputState
- type ResourceState
- type State
- type Token
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AWSCloudFrontDestroy ¶
func AWSCloudFrontDestroy(output DomainFrontOutput, configFile string) error
AWSCloufFrontDestroy uses the deleteCloudFront function to delete the specified cloudfront due to the problems with terraforms destruction process
func AskForConfirmation ¶
func AskForConfirmation() bool
func CheckForEmptyEC2Module ¶
CheckForEmptyEC2Module is a hack to ensure EC2 data resources are destroyed as they cannot be destroyed individually
func ContainsInt ¶
ContainsInt checks to see if the array contains the target int
func ContainsString ¶
ContainsString checks to see if the array contains the target string
func CreateMasterFile ¶
func CreateMasterFile(wrappers ConfigWrappers) (masterString string)
CreateMasterList takes a MasterList object as input and maps it to the corresponding templates, executes them, then adds the resulting string to a complete string containing the main.tf file for terraform
func CreateSingleSOCKS ¶
createSingleSOCKS initiates a SOCKS Proxy on the local host with the specifed ipv4 address
func CreateTerraformMain ¶
CreateTerraformMain takes in a string containing all the necessary calls for the main.tf file
func DestroySOCKS ¶
func DestroySOCKS(ip string)
func ExecAnsible ¶
func ExpandNumberInput ¶
ExpandNumberInput expands input string and returns a list of ints
func FindLargestNumber ¶
func GenerateHostFile ¶
func GenerateHostFile(instances []ListStruct, domain string, burpFile string, hostFilePath string, remoteFilePath string, execCommand string, socatPort string, socatIP string, nmapOutput string, nmapCommands map[int][]string, cobaltStrikeLicense string, cobaltStrikePassword string, cobaltStrikeC2Path string, cobaltStrikeFile string, cobaltStrikeKillDate string, ufwAction string, ufwTcpPort []string, ufwUdpPort []string) string
GenerateHostsFile generates an ansible host file
func GeneratePlaybookFile ¶
GeneratePlaybookFile generates an ansible playbook
func GetDoRegions ¶
GetDoRegions returns the list of available regions for digital ocean
func GetEC2DataToDestroy ¶
func InitializeTerraformFiles ¶
func InitializeTerraformFiles(configFile string)
InitializeTerraformFiles Creates the base templates for the terraform infrastructure
func IsValidNumberInput ¶
IsValidNumberInput takes in a string and checks if the numbers are valid
func ListProxies ¶
func ListProxies(instances []ListStruct) (output string)
func ParseIPFile ¶
func PosString ¶
posString returns the first index of element in slice. If slice does not contain element, returns -1.
func PrintProxyChains ¶
func PrintSocksd ¶
func ProviderCheck ¶
ProviderCheck takes in a user-defined array of providers and validates they are supported
func RetrieveConfig ¶
func RetrieveConfig(configFilePath string) (config configStruct)
func TerraformApply ¶
func TerraformApply(configFile string)
TerraformApply runs the init, plan, and apply commands for our generated terraform templates
func TerraformDestroy ¶
func UpdateConfig ¶
func UpdateConfig(configFilePath string, config configStruct)
func ValidateNumberOfInstances ¶
ValidateNumberOfInstances makes sure that the number input is actually available in our list of active instances
func ValidatePorts ¶
func WriteToFile ¶
WriteToFile opens, clears and writes to file
Types ¶
type AWSApiConfigWrapper ¶
type AWSDomainFront ¶
type AWSDomainFront struct{}
type AWSSecurityGroup ¶
type AWSSecurityGroup struct{}
type AzureDomainFront ¶
type AzureDomainFront struct{}
type AzureInstance ¶
type AzureInstance struct {
Count int
}
type AzureProvider ¶
type AzureProvider struct { Instances []AzureInstance `json:"instances"` DomainFront []AzureDomainFront `json:"domain_front"` }
type CloudfrontConfigWrapper ¶
type ConfigWrappers ¶
type ConfigWrappers struct { EC2 []EC2ConfigWrapper EC2ModuleCount int DO []DOConfigWrapper DropletModuleCount int AWSAPI []AWSApiConfigWrapper AWSAPIModuleCount int Cloudfront []CloudfrontConfigWrapper CloudfrontModuleCount int Googlefront []GooglefrontConfigWrapper GooglefrontModuleCount int }
func APIDeploy ¶
func APIDeploy(provider string, targetURI string, wrappers ConfigWrappers) ConfigWrappers
APIDeploy takes argruments to deploy an API Gateway
func CreateWrappersFromState ¶
func CreateWrappersFromState(state State, configFile string) (wrappers ConfigWrappers)
func DomainFrontDeploy ¶
func DomainFrontDeploy(provider string, origin string, restrictUA string, functionName string, frontedDomain string, wrappers ConfigWrappers) ConfigWrappers
func InstanceDeploy ¶
func InstanceDeploy(providers []string, awsRegions []string, doRegions []string, azureRegions []string, googleRegions []string, count int, keyName string, wrappers ConfigWrappers, configFile string) ConfigWrappers
InstanceDeploy takes input from the user interface in order to divide and deploy appropriate regions it takes in a TerraformOutput struct, makes the appropriate edits, and returns that same struct
type DOConfigWrapper ¶
type DomainFrontOutput ¶
type DomainFrontOutput struct { Name string Origin string ID string Invoke string Provider string Etag string Status string FunctionName string RestrictUA string }
func ListDomainFronts ¶
func ListDomainFronts(state State) (domainFronts []DomainFrontOutput)
func (DomainFrontOutput) String ¶
func (output DomainFrontOutput) String() string
type EC2ConfigWrapper ¶
type InstanceState ¶
type InstanceState struct { // A unique ID for this resource. This is opaque to Terraform // and is only meant as a lookup mechanism for the providers. ID string `json:"id"` // Attributes are basic information about the resource. Any keys here // are accessible in variable format within Terraform configurations: // ${resourcetype.name.attribute}. Attributes map[string]interface{} `json:"attributes"` // Meta is a simple K/V map that is persisted to the State but otherwise // ignored by Terraform core. It's meant to be used for accounting by // external client code. The value here must only contain Go primitives // and collections. Meta map[string]interface{} `json:"meta"` // Tainted is used to mark a resource for recreation. Tainted bool `json:"tainted"` }
type ListStruct ¶
type ListStruct struct { IP string Provider string Region string Name string Place int Username string PrivateKey string }
func InstanceDiff ¶
func InstanceDiff(instancesOld []ListStruct, instancesNew []ListStruct) (instancesOut []ListStruct)
InstanceDiff takes the old list of instances and the new list of instances and proceeds to check each instance in the new list against the old list. If its not in the old list, it appends it to output.
func ListInstances ¶
func ListInstances(state State, configFile string) (hostOutput []ListStruct)
func (*ListStruct) String ¶
func (listStruct *ListStruct) String() string
type ModuleState ¶
type ModuleState struct { // Path is the import path from the root module. Modules imports are // always disjoint, so the path represents amodule tree Path []string `json:"path"` // Locals are kept only transiently in-memory, because we can always // re-compute them. Locals map[string]interface{} `json:"-"` // Outputs declared by the module and maintained for each module // even though only the root module technically needs to be kept. // This allows operators to inspect values at the boundaries. Outputs map[string]*OutputState `json:"outputs"` // Resources is a mapping of the logically named resource to // the state of the resource. Each resource may actually have // N instances underneath, although a user only needs to think // about the 1:1 case. Resources map[string]ResourceState `json:"resources"` // Dependencies are a list of things that this module relies on // existing to remain intact. For example: an module may depend // on a VPC ID given by an aws_vpc resource. // // Terraform uses this information to build valid destruction // orders and to warn the user if they're destroying a module that // another resource depends on. // // Things can be put into this list that may not be managed by // Terraform. If Terraform doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on"` }
type OutputState ¶
type OutputState struct { // Sensitive describes whether the output is considered sensitive, // which may lead to masking the value on screen in some cases. Sensitive bool `json:"sensitive"` // Type describes the structure of Value. Valid values are "string", // "map" and "list" Type string `json:"type"` // Value contains the value of the output, in the structure described // by the Type field. Value interface{} `json:"value"` }
type ResourceState ¶
type ResourceState struct { // This is filled in and managed by Terraform, and is the resource // type itself such as "mycloud_instance". If a resource provider sets // this value, it won't be persisted. Type string `json:"type"` // Dependencies are a list of things that this resource relies on // existing to remain intact. For example: an AWS instance might // depend on a subnet (which itself might depend on a VPC, and so // on). // // Terraform uses this information to build valid destruction // orders and to warn the user if they're destroying a resource that // another resource depends on. // // Things can be put into this list that may not be managed by // Terraform. If Terraform doesn't find a matching ID in the // overall state, then it assumes it isn't managed and doesn't // worry about it. Dependencies []string `json:"depends_on"` // Primary is the current active instance for this resource. // It can be replaced but only after a successful creation. // This is the instances on which providers will act. Primary InstanceState `json:"primary"` // Provider is used when a resource is connected to a provider with an alias. // If this string is empty, the resource is connected to the default provider, // e.g. "aws_instance" goes with the "aws" provider. // If the resource block contained a "provider" key, that value will be set here. Provider string `json:"provider"` }
type State ¶
type State struct { // Version is the state file protocol version. Version int `json:"version"` // TFVersion is the version of Terraform that wrote this state. TFVersion string `json:"terraform_version,omitempty"` // Serial is incremented on any operation that modifies // the State file. It is used to detect potentially conflicting // updates. Serial int64 `json:"serial"` // Modules contains all the modules in a breadth-first order Modules []ModuleState `json:"modules"` }
func TerraformStateMarshaller ¶
func TerraformStateMarshaller() (outputStruct State)
TerraforrmOutputMarshaller runs the terraform output command and marshalls the resulting JSON into a TerraformOutput struct