Ensure validation regexps match entire string

This commit is contained in:
Luke Hoban 2017-06-28 15:47:15 -07:00
parent 9ba8567d59
commit 680182a177
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ const (
)
var (
logGroupNameRegexp = regexp.MustCompile(`[\.\-_/#A-Za-z0-9]+`)
logGroupNameRegexp = regexp.MustCompile(`^[\.\-_/#A-Za-z0-9]+$`)
)
// NewLogGroupProvider creates a provider that handles Cloudwatch LogGroup operations.

View file

@ -29,9 +29,9 @@ const (
)
var (
actionRegexp = regexp.MustCompile(`(lambda:[*]|lambda:[a-zA-Z]+|[*])`)
sourceAccountRegexp = regexp.MustCompile(`\d{12}`)
sourceARNRegexp = regexp.MustCompile(`arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)`)
actionRegexp = regexp.MustCompile(`^(lambda:[*]|lambda:[a-zA-Z]+|[*])$`)
sourceAccountRegexp = regexp.MustCompile(`^\d{12}$`)
sourceARNRegexp = regexp.MustCompile(`^arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)$`)
)
type policy struct {