WAF

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AwsxWafConfigCmd = &cobra.Command{
	Use:   "getWafConfig",
	Short: "getWafConfig command gets waf configuration",
	Long:  `getWafConfig command gets waf configuration`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getWafConfig command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			instanceId, _ := cmd.Flags().GetString("instanceId")
			if instanceId == "" {
				log.Printf("waf id missing")
				err := cmd.Help()
				if err != nil {
					return
				}
				return
			}

			instances, err := GetWafInstanceById(instanceId, clientAuth, nil)
			if err != nil {
				log.Println("error getting getWafConfig by bucket name: ", err)
				return
			}
			fmt.Println(instances)

		}
	},
}
View Source
var AwsxWafListCmd = &cobra.Command{
	Use:   "getWafList",
	Short: "getWafList command gets list of waf instances of an aws account",
	Long:  `getWafList command gets list of waf instances of an aws account`,

	Run: func(cmd *cobra.Command, args []string) {
		fmt.Println("executing getWafList command")
		var authFlag, clientAuth, err = authenticate.AuthenticateCommand(cmd)
		if err != nil {
			log.Printf("error during authentication: %v\n", err)
			err := cmd.Help()
			if err != nil {
				return
			}
			return
		}
		if authFlag {
			resp, err := ListWafInstances(clientAuth, nil)
			if err != nil {
				log.Println("error getting getWafList: ", err)
				return
			}
			fmt.Println(resp)
		}
	},
}

Functions

func GetWafInstanceById

func GetWafInstanceById(instanceId string, clientAuth *model.Auth, client *waf.WAF) (*waf.GetWebACLOutput, error)

func ListWafInstances

func ListWafInstances(clientAuth *model.Auth, client *waf.WAF) (*waf.ListWebACLsOutput, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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