Documentation
¶
Index ¶
- Constants
- func AZUREPolicy(permissions []string) (string, error)
- func Apply(target string, region string) error
- func Compare(directory string, arn string, init bool) (bool, error)
- func CompareIAMPolicy(Policy string, OldPolicy string) (bool, error)
- func GCPPolicy(permissions []string) (string, error)
- func GetAWSDataPermissions(result ResourceV2) ([]string, error)
- func GetAWSPermissions(result ResourceV2) ([]string, error)
- func GetAWSResourcePermissions(result ResourceV2) ([]string, error)
- func GetAZUREDataPermissions(result ResourceV2) ([]string, error)
- func GetAZUREPermissions(result ResourceV2) ([]string, error)
- func GetAZUREResourcePermissions(result ResourceV2) ([]string, error)
- func GetBlockAttributes(attributes []string, block *hclsyntax.Block) []string
- func GetGCPDataPermissions(result ResourceV2) ([]string, error)
- func GetGCPPermissions(result ResourceV2) ([]string, error)
- func GetGCPResourcePermissions(result ResourceV2) ([]string, error)
- func GetHCLType(resourceName string) string
- func GetModulePath(block *hclsyntax.Block) string
- func GetPermissionMap(raw []byte, attributes []string) ([]string, error)
- func GetPolicyVersion(client *iam.Client, PolicyArn string, Version string) (*string, error)
- func GetResourceBlocks(file string) (*hclsyntax.Body, error)
- func GetTF(dirName string) ([]string, error)
- func GetVersion(client *iam.Client, PolicyArn string) (*string, error)
- func Init(dirName string) (*string, []string, error)
- func InvokeGithubDispatchEvent(repository string, workflowFileName string, branch string) error
- func LocateTerraform() (string, error)
- func Make(directory string) (*string, error)
- func Readme(dirName string, output string, init bool, autoAppend bool) error
- func Remote(target string, repository string, region string) error
- func ReplaceSection(source string, middle string, autoadd bool) error
- func Scan(dirName string, output string, file *string, init bool, write bool) error
- func SetRepoSecret(repository string, keyText string, keyName string) (*github.Response, error)
- func SortActions(myPolicy string) (*string, error)
- func WaitForPolicyChange(client *iam.Client, arn string, Version string, Wait int) (int, error)
- func Watch(arn string, wait int) error
- func WriteOutput(OutPolicy OutputPolicy, output, location string) error
- type AwsOutput
- type OutputPolicy
- type Policy
- type ResourceV2
- type Sorted
- type Statement
Constants ¶
const Version = "9.9.9"
Version controls the applications version
Variables ¶
This section is empty.
Functions ¶
func AZUREPolicy ¶
AZUREPolicy creates an Azure role definition
func CompareIAMPolicy ¶
CompareIAMPolicy takes to IAm policies and compares
func GetAWSDataPermissions ¶
func GetAWSDataPermissions(result ResourceV2) ([]string, error)
GetAWSDataPermissions gets permissions required for datasource's
func GetAWSPermissions ¶
func GetAWSPermissions(result ResourceV2) ([]string, error)
GetAWSPermissions for AWS resources
func GetAWSResourcePermissions ¶
func GetAWSResourcePermissions(result ResourceV2) ([]string, error)
GetAWSResourcePermissions looks up permissions required for resources
func GetAZUREDataPermissions ¶
func GetAZUREDataPermissions(result ResourceV2) ([]string, error)
GetAZUREDataPermissions gets permissions required for datasources
func GetAZUREPermissions ¶
func GetAZUREPermissions(result ResourceV2) ([]string, error)
GetAZUREPermissions for GCP resources
func GetAZUREResourcePermissions ¶
func GetAZUREResourcePermissions(result ResourceV2) ([]string, error)
GetAZUREResourcePermissions looks up permissions required for resources
func GetBlockAttributes ¶
GetBlockAttributes walks through a blocks getting all blocks and attributes
func GetGCPDataPermissions ¶
func GetGCPDataPermissions(result ResourceV2) ([]string, error)
GetGCPDataPermissions gets permissions required for datasources
func GetGCPPermissions ¶
func GetGCPPermissions(result ResourceV2) ([]string, error)
GetGCPPermissions for GCP resources
func GetGCPResourcePermissions ¶
func GetGCPResourcePermissions(result ResourceV2) ([]string, error)
GetGCPResourcePermissions looks up permissions required for resources
func GetModulePath ¶
GetModulePath extracts the source location from a module
func GetPermissionMap ¶
GetPermissionMap Anonymous parsing
func GetPolicyVersion ¶
GetPolicyVersion Obtains the versioned IAM policy
func GetResourceBlocks ¶
GetResourceBlocks breaks down a file into resources
func GetVersion ¶
GetVersion gets the version of the IAM policy
func Init ¶
Init can download and install terraform if required and then terraform init your specified directory
func InvokeGithubDispatchEvent ¶
InvokeGithubDispatchEvent uses your gitHub api key (if sufficiently enabled) to invoke a gitHub action workflow
func LocateTerraform ¶
LocateTerraform finds the Terraform executable or installs it
func ReplaceSection ¶
ReplaceSection find a section in a readme and replaces the section
func SetRepoSecret ¶
SetRepoSecret sets an encrypted gitHub action secret
func SortActions ¶
SortActions sorts the actions list of an IAM policy
func WaitForPolicyChange ¶
WaitForPolicyChange looks at IAM policy change
func WriteOutput ¶
func WriteOutput(OutPolicy OutputPolicy, output, location string) error
WriteOutput writes out the policy as json or terraform
Types ¶
type OutputPolicy ¶
OutputPolicy is the main output type
func GetPolicy ¶
func GetPolicy(actions Sorted) (OutputPolicy, error)
GetPolicy creates new iam polices from a list of Permissions
func MakePolicy ¶
func MakePolicy(dirName string, file *string, init bool) (OutputPolicy, error)
MakePolicy does the guts of determining a policy from code
func (OutputPolicy) AsString ¶
func (Out OutputPolicy) AsString(format string) string
AsString converts object into string
type ResourceV2 ¶
type ResourceV2 struct {
TypeName string
Name string
ResourceName string
Provider string
Attributes []string
}
ResourceV2 is what resources get parsed into
func GetResources ¶
func GetResources(file string, dirName string) ([]ResourceV2, error)
GetResources retrieves all the resources in a tf file
type Sorted ¶
Sorted is to help split out permission to the relevant auth
func GetPermission ¶
func GetPermission(result ResourceV2) (Sorted, error)
GetPermission determines the IAM permissions required and returns a list of permission
Source Files
¶
- aws.go
- aws_datasource.go
- azure.go
- azure_datasource.go
- azure_policy.go
- compare.go
- credentials.go
- data.go
- files.go
- files_azure.go
- files_azure_datasource.go
- files_datasource.go
- files_gcp.go
- files_gcp_datasource.go
- gcp.go
- gcp_datasource.go
- gcp_policy.go
- gitHub.go
- make.go
- policy.go
- readme.go
- scan.go
- secrets.go
- types.go
- utils.go
- version.go
- watch.go