Ensure validation regexps match entire string
This commit is contained in:
parent
9ba8567d59
commit
680182a177
2 changed files with 4 additions and 4 deletions
|
@ -29,7 +29,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
logGroupNameRegexp = regexp.MustCompile(`[\.\-_/#A-Za-z0-9]+`)
|
logGroupNameRegexp = regexp.MustCompile(`^[\.\-_/#A-Za-z0-9]+$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
// NewLogGroupProvider creates a provider that handles Cloudwatch LogGroup operations.
|
// NewLogGroupProvider creates a provider that handles Cloudwatch LogGroup operations.
|
||||||
|
|
|
@ -29,9 +29,9 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
actionRegexp = regexp.MustCompile(`(lambda:[*]|lambda:[a-zA-Z]+|[*])`)
|
actionRegexp = regexp.MustCompile(`^(lambda:[*]|lambda:[a-zA-Z]+|[*])$`)
|
||||||
sourceAccountRegexp = regexp.MustCompile(`\d{12}`)
|
sourceAccountRegexp = regexp.MustCompile(`^\d{12}$`)
|
||||||
sourceARNRegexp = regexp.MustCompile(`arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)`)
|
sourceARNRegexp = regexp.MustCompile(`^arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)$`)
|
||||||
)
|
)
|
||||||
|
|
||||||
type policy struct {
|
type policy struct {
|
||||||
|
|
Loading…
Reference in a new issue