Fix code scanning alerts (#6551)
* Escape period in URL regex * Fix capital letter range * Fix unintentional range and duplicate period in regex * Formatting
This commit is contained in:
parent
77a09b71b7
commit
d05eae7fed
@ -110,9 +110,12 @@ backend_url_patterns = [
|
||||
),
|
||||
(
|
||||
"meteringmarketplace",
|
||||
re.compile("https?://metering.marketplace.(.+).amazonaws.com"),
|
||||
re.compile("https?://metering.marketplace\\.(.+)\\.amazonaws.com"),
|
||||
),
|
||||
(
|
||||
"meteringmarketplace",
|
||||
re.compile("https?://aws-marketplace\\.(.+)\\.amazonaws.com"),
|
||||
),
|
||||
("meteringmarketplace", re.compile("https?://aws-marketplace.(.+).amazonaws.com")),
|
||||
("mq", re.compile("https?://mq\\.(.+)\\.amazonaws\\.com")),
|
||||
("opsworks", re.compile("https?://opsworks\\.us-east-1\\.amazonaws.com")),
|
||||
("organizations", re.compile("https?://organizations\\.(.+)\\.amazonaws\\.com")),
|
||||
|
@ -39,7 +39,7 @@ SCHEMA_VERSION_ID_PATTERN = re.compile(
|
||||
r"^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$"
|
||||
)
|
||||
MIN_SCHEMA_VERSION_ID_LENGTH = 36
|
||||
SCHEMA_VERSION_METADATA_PATTERN = re.compile(r"^[a-zA-Z0-9+-=._./@]+$")
|
||||
SCHEMA_VERSION_METADATA_PATTERN = re.compile(r"^[a-zA-Z0-9+=._/@-]+$")
|
||||
MAX_SCHEMA_VERSION_METADATA_ALLOWED = 10
|
||||
MAX_SCHEMA_VERSION_METADATA_LENGTH = 128
|
||||
METADATA_KEY = "MetadataKey"
|
||||
|
@ -1981,7 +1981,7 @@ class SimpleSystemManagerBackend(BaseBackend):
|
||||
label.startswith("aws")
|
||||
or label.startswith("ssm")
|
||||
or label[:1].isdigit()
|
||||
or not re.match(r"^[a-zA-z0-9_\.\-]*$", label)
|
||||
or not re.match(r"^[a-zA-Z0-9_\.\-]*$", label)
|
||||
):
|
||||
invalid_labels.append(label)
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user