[EC2Instance2] failed because [Tags.0.Value] is [1234] and the permitted pattern is [^([0-9]|[A-Z]){4}$]
If I remove the ^ and $ the regex matches, however it doesn't do an exact match for exactly 4 characters, so 12345 would then show as valid, as it contains 4 in a row, but with no defined end.
2020-07-30 12:13:33,102 DEBUG [cfn_guard] Parameters are ArgMatches {
args: {
"rule_set": MatchedArg {
occurs: 1,
indices: [
7,
],
vals: [
"cfn-test.cfn",
],
},
"template": MatchedArg {
occurs: 1,
indices: [
5,
],
vals: [
"tests/test_failure/ec2.json",
],
},
"v": MatchedArg {
occurs: 3,
indices: [
1,
2,
3,
],
vals: [],
},
},
subcommand: None,
usage: Some(
"USAGE:\n cfn-guard [FLAGS] --rule_set <RULE_SET_FILE> --template <TEMPLATE_FILE>",
),
}
2020-07-30 12:13:33,103 INFO [cfn_guard] CloudFormation Guard is checking the template 'tests/test_failure/ec2.json' against the rules in 'cfn-test.cfn'
2020-07-30 12:13:33,103 DEBUG [cfn_guard] Entered run
2020-07-30 12:13:33,103 TRACE [cfn_guard] Template file is 'tests/test_failure/ec2.json' and its contents are:
'{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template EC2InstanceWithSecurityGroupSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Resources" : {
"EC2Instance2" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"InstanceType" : { "Ref" : "InstanceType" },
"SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ],
"KeyName" : { "Ref" : "KeyName" },
"Tags": [
{
"Key": "TestKey",
"Value": "1234"
}
],
"ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" },
{ "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] }
}
}
}
}'
2020-07-30 12:13:33,103 TRACE [cfn_guard] Rules file is 'cfn-test.cfn' and its contents are:
AWS::EC2::Instance Tags.0.Key == /(TestKey)/
AWS::EC2::Instance Tags.0.Value == /^([0-9]|[A-Z]){4}$/
2020-07-30 12:13:33,104 INFO [cfn_guard] Loading CloudFormation Template and Rule Set
2020-07-30 12:13:33,104 DEBUG [cfn_guard] Entered run_check
2020-07-30 12:13:33,104 TRACE [cfn_guard] Normalizing booleans in inputs
2020-07-30 12:13:33,104 TRACE [cfn_guard] Cleaned template contents are:
'{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "AWS CloudFormation Sample Template EC2InstanceWithSecurityGroupSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
"Resources" : {
"EC2Instance2" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"InstanceType" : { "Ref" : "InstanceType" },
"SecurityGroups" : [ { "Ref" : "InstanceSecurityGroup" } ],
"KeyName" : { "Ref" : "KeyName" },
"Tags": [
{
"Key": "TestKey",
"Value": "1234"
}
],
"ImageId" : { "Fn::FindInMap" : [ "AWSRegionArch2AMI", { "Ref" : "AWS::Region" },
{ "Fn::FindInMap" : [ "AWSInstanceType2Arch", { "Ref" : "InstanceType" }, "Arch" ] } ] }
}
}
}
}'
2020-07-30 12:13:33,104 TRACE [cfn_guard] Cleaned rules file contents are:
'
AWS::EC2::Instance Tags.0.Key == /(TestKey)/
AWS::EC2::Instance Tags.0.Value == /^([0-9]|[A-Z]){4}$/
'
2020-07-30 12:13:33,104 DEBUG [cfn_guard] Deserializing CloudFormation template
2020-07-30 12:13:33,104 TRACE [cfn_guard] CFN Template is '{
"Description": String(
"AWS CloudFormation Sample Template EC2InstanceWithSecurityGroupSample: Create an Amazon EC2 instance running the Amazon Linux AMI. The AMI is chosen based on the region in which the stack is run. This example creates an EC2 security group for the instance to give you SSH access. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template.",
),
"Resources": Object({
"EC2Instance2": Object({
"Properties": Object({
"ImageId": Object({
"Fn::FindInMap": Array([
String(
"AWSRegionArch2AMI",
),
Object({
"Ref": String(
"AWS::Region",
),
}),
Object({
"Fn::FindInMap": Array([
String(
"AWSInstanceType2Arch",
),
Object({
"Ref": String(
"InstanceType",
),
}),
String(
"Arch",
),
]),
}),
]),
}),
"InstanceType": Object({
"Ref": String(
"InstanceType",
),
}),
"KeyName": Object({
"Ref": String(
"KeyName",
),
}),
"SecurityGroups": Array([
Object({
"Ref": String(
"InstanceSecurityGroup",
),
}),
]),
"Tags": Array([
Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
}),
]),
}),
"Type": String(
"AWS::EC2::Instance",
),
}),
}),
"AWSTemplateFormatVersion": String(
"2010-09-09",
),
}'
2020-07-30 12:13:33,105 TRACE [cfn_guard] CFN resources are: {"EC2Instance2": Object({"Properties": Object({"ImageId": Object({"Fn::FindInMap": Array([String("AWSRegionArch2AMI"), Object({"Ref": String("AWS::Region")}), Object({"Fn::FindInMap": Array([String("AWSInstanceType2Arch"), Object({"Ref": String("InstanceType")}), String("Arch")])})])}), "InstanceType": Object({"Ref": String("InstanceType")}), "KeyName": Object({"Ref": String("KeyName")}), "SecurityGroups": Array([Object({"Ref": String("InstanceSecurityGroup")})]), "Tags": Array([Object({"Key": String("TestKey"), "Value": String("1234")})])}), "Type": String("AWS::EC2::Instance")})}
2020-07-30 12:13:33,105 INFO [cfn_guard] Parsing rule set
2020-07-30 12:13:33,105 DEBUG [cfn_guard::parser] Entered parse_rules
2020-07-30 12:13:33,105 TRACE [cfn_guard::parser] Parse rules entered with rules_file_contents: "\n\nAWS::EC2::Instance Tags.0.Key == /(TestKey)/\nAWS::EC2::Instance Tags.0.Value == /^([0-9]|[A-Z]){4}$/\n\n\n"
2020-07-30 12:13:33,105 TRACE [cfn_guard::parser] Parse rules entered with cfn_resources: {
"EC2Instance2": Object({
"Properties": Object({
"ImageId": Object({
"Fn::FindInMap": Array([
String(
"AWSRegionArch2AMI",
),
Object({
"Ref": String(
"AWS::Region",
),
}),
Object({
"Fn::FindInMap": Array([
String(
"AWSInstanceType2Arch",
),
Object({
"Ref": String(
"InstanceType",
),
}),
String(
"Arch",
),
]),
}),
]),
}),
"InstanceType": Object({
"Ref": String(
"InstanceType",
),
}),
"KeyName": Object({
"Ref": String(
"KeyName",
),
}),
"SecurityGroups": Array([
Object({
"Ref": String(
"InstanceSecurityGroup",
),
}),
]),
"Tags": Array([
Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
}),
]),
}),
"Type": String(
"AWS::EC2::Instance",
),
}),
}
2020-07-30 12:13:33,105 TRACE [cfn_guard::parser] Rules file lines: Lines(
Map {
iter: SplitTerminator(
SplitInternal {
start: 0,
end: 105,
matcher: CharSearcher {
haystack: "\n\nAWS::EC2::Instance Tags.0.Key == /(TestKey)/\nAWS::EC2::Instance Tags.0.Value == /^([0-9]|[A-Z]){4}$/\n\n\n",
finger: 0,
finger_back: 105,
needle: '\n',
utf8_size: 1,
utf8_encoded: [
10,
0,
0,
0,
],
},
allow_trailing_empty: false,
finished: false,
},
),
},
)
2020-07-30 12:13:33,106 DEBUG [cfn_guard::parser] Parsing ''
2020-07-30 12:13:33,106 DEBUG [cfn_guard::parser] Parsing ''
2020-07-30 12:13:33,106 DEBUG [cfn_guard::parser] Parsing 'AWS::EC2::Instance Tags.0.Key == /(TestKey)/'
2020-07-30 12:13:33,111 DEBUG [cfn_guard::parser] line_type is Rule
2020-07-30 12:13:33,111 DEBUG [cfn_guard::parser] Line is an 'AND' rule
2020-07-30 12:13:33,111 TRACE [cfn_guard::parser] Entered destructure_rule
2020-07-30 12:13:33,113 TRACE [cfn_guard::parser] Parsed rule's captures are: Captures(
{
0: Some(
"AWS::EC2::Instance Tags.0.Key == /(TestKey)/",
),
"resource_type": Some(
"AWS::EC2::Instance",
),
"resource_property": Some(
"Tags.0.Key",
),
"operator": Some(
"==",
),
"rule_value": Some(
"/(TestKey)/",
),
},
)
2020-07-30 12:13:33,114 TRACE [cfn_guard::parser] Destructured rules are: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Key",
operation: Require,
value: "(TestKey)",
rule_vtype: Regex,
custom_msg: None,
},
]
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Parsed rule is: CompoundRule {
compound_type: AND,
rule_list: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Key",
operation: Require,
value: "(TestKey)",
rule_vtype: Regex,
custom_msg: None,
},
],
}
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Parsing 'AWS::EC2::Instance Tags.0.Value == /^([0-9]|[A-Z]){4}$/'
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] line_type is Rule
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Line is an 'AND' rule
2020-07-30 12:13:33,114 TRACE [cfn_guard::parser] Entered destructure_rule
2020-07-30 12:13:33,114 TRACE [cfn_guard::parser] Parsed rule's captures are: Captures(
{
0: Some(
"AWS::EC2::Instance Tags.0.Value == /^([0-9]|[A-Z]){4}$/",
),
"resource_type": Some(
"AWS::EC2::Instance",
),
"resource_property": Some(
"Tags.0.Value",
),
"operator": Some(
"==",
),
"rule_value": Some(
"/^([0-9]|[A-Z]){4}$/",
),
},
)
2020-07-30 12:13:33,114 TRACE [cfn_guard::parser] Destructured rules are: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Value",
operation: Require,
value: "^([0-9]|[A-Z]){4}$",
rule_vtype: Regex,
custom_msg: None,
},
]
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Parsed rule is: CompoundRule {
compound_type: AND,
rule_list: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Value",
operation: Require,
value: "^([0-9]|[A-Z]){4}$",
rule_vtype: Regex,
custom_msg: None,
},
],
}
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Parsing ''
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Parsing ''
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Variables dictionary is {"ENV_VSCODE_GIT_ASKPASS_MAIN": "********", "ENV_VSCODE_IPC_HOOK_CLI": "********", "ENV_VSCODE_GIT_ASKPASS_NODE": "********", "ENV_AWS_REGION": "********", "ENV_VSCODE_GIT_IPC_HANDLE": "********", "ENV_APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "********", "ENV__": "********", "ENV_HOME": "********", "ENV_NAME": "********", "ENV_PWD": "********", "ENV_SHLVL": "********", "ENV_AWS_SDK_LOAD_CONFIG": "********", "ENV_GIT_ASKPASS": "********", "ENV_TERM_PROGRAM": "********", "ENV_SHELL": "********", "ENV_LOGNAME": "********", "ENV_TERM": "********", "ENV_HOSTTYPE": "********", "ENV_AMD_ENTRYPOINT": "********", "ENV_LS_COLORS": "********", "ENV_PATH": "********", "ENV_VERBOSE_LOGGING": "********", "ENV_TERM_PROGRAM_VERSION": "********", "ENV_LESSCLOSE": "********", "ENV_USER": "********", "ENV_XDG_DATA_DIRS": "********", "ENV_LESSOPEN": "********", "ENV_WSLENV": "********", "ENV_COLORTERM": "********", "ENV_PIPE_LOGGING": "********", "ENV_LANG": "********"}
2020-07-30 12:13:33,114 DEBUG [cfn_guard::parser] Rule Set is [
CompoundRule {
compound_type: AND,
rule_list: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Key",
operation: Require,
value: "(TestKey)",
rule_vtype: Regex,
custom_msg: None,
},
],
},
CompoundRule {
compound_type: AND,
rule_list: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Value",
operation: Require,
value: "^([0-9]|[A-Z]){4}$",
rule_vtype: Regex,
custom_msg: None,
},
],
},
]
2020-07-30 12:13:33,115 INFO [cfn_guard] Checking resources
2020-07-30 12:13:33,115 INFO [cfn_guard] Applying rule 'CompoundRule {
compound_type: AND,
rule_list: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Key",
operation: Require,
value: "(TestKey)",
rule_vtype: Regex,
custom_msg: None,
},
],
}'
2020-07-30 12:13:33,115 DEBUG [cfn_guard] Applying rule 'Rule { resource_type: "AWS::EC2::Instance", field: "Tags.0.Key", operation: Require, value: "(TestKey)", rule_vtype: Regex, custom_msg: None }'
2020-07-30 12:13:33,115 INFO [cfn_guard] Checking [EC2Instance2] which is of type "AWS::EC2::Instance"
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] Getting ["Tags", "0", "Key"] from {"ImageId":{"Fn::FindInMap":["AWSRegionArch2AMI",{"Ref":"AWS::Region"},{"Fn::FindInMap":["AWSInstanceType2Arch",{"Ref":"InstanceType"},"Arch"]}]},"InstanceType":{"Ref":"InstanceType"},"KeyName":{"Ref":"KeyName"},"SecurityGroups":[{"Ref":"InstanceSecurityGroup"}],"Tags":[{"Key":"TestKey","Value":"1234"}]}
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] field_list is ["Tags", "0", "Key"]
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] next_field is "Tags" and field_list is now ["0", "Key"]
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] props are Object({
"ImageId": Object({
"Fn::FindInMap": Array([
String(
"AWSRegionArch2AMI",
),
Object({
"Ref": String(
"AWS::Region",
),
}),
Object({
"Fn::FindInMap": Array([
String(
"AWSInstanceType2Arch",
),
Object({
"Ref": String(
"InstanceType",
),
}),
String(
"Arch",
),
]),
}),
]),
}),
"InstanceType": Object({
"Ref": String(
"InstanceType",
),
}),
"KeyName": Object({
"Ref": String(
"KeyName",
),
}),
"SecurityGroups": Array([
Object({
"Ref": String(
"InstanceSecurityGroup",
),
}),
]),
"Tags": Array([
Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
}),
]),
})
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] Getting ["0", "Key"] from [{"Key":"TestKey","Value":"1234"}]
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] field_list is ["0", "Key"]
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] next_field is 0 and field_list is now ["Key"]
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] props are Array([
Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
}),
])
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] Getting ["Key"] from {"Key":"TestKey","Value":"1234"}
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] field_list is ["Key"]
2020-07-30 12:13:33,115 TRACE [cfn_guard::util] next_field is "Key" and field_list is now []
2020-07-30 12:13:33,116 TRACE [cfn_guard::util] props are Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
})
2020-07-30 12:13:33,116 DEBUG [cfn_guard] Template val is String("TestKey")
2020-07-30 12:13:33,116 TRACE [cfn_guard::util] Entered dereference_rule_value() with 'Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Key",
operation: Require,
value: "(TestKey)",
rule_vtype: Regex,
custom_msg: None,
}' and Variables '{
"ENV_VERBOSE_LOGGING": "********",
"ENV_PATH": "********",
"ENV_COLORTERM": "********",
"ENV_TERM_PROGRAM_VERSION": "********",
"ENV_LESSOPEN": "********",
"ENV_PIPE_LOGGING": "********",
"ENV_LOGNAME": "********",
"ENV_SHLVL": "********",
"ENV_NAME": "********",
"ENV_VSCODE_GIT_ASKPASS_NODE": "********",
"ENV_VSCODE_IPC_HOOK_CLI": "********",
"ENV_PWD": "********",
"ENV_USER": "********",
"ENV_LESSCLOSE": "********",
"ENV_LANG": "********",
"ENV_WSLENV": "********",
"ENV_XDG_DATA_DIRS": "********",
"ENV_TERM_PROGRAM": "********",
"ENV_AMD_ENTRYPOINT": "********",
"ENV_AWS_REGION": "********",
"ENV_GIT_ASKPASS": "********",
"ENV_SHELL": "********",
"ENV_TERM": "********",
"ENV_APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "********",
"ENV_HOSTTYPE": "********",
"ENV__": "********",
"ENV_VSCODE_GIT_ASKPASS_MAIN": "********",
"ENV_AWS_SDK_LOAD_CONFIG": "********",
"ENV_VSCODE_GIT_IPC_HANDLE": "********",
"ENV_LS_COLORS": "********",
"ENV_HOME": "********",
}'
2020-07-30 12:13:33,116 DEBUG [cfn_guard] rule_val is (TestKey) and val is "TestKey"
2020-07-30 12:13:33,116 DEBUG [cfn_guard] OpCode::Require with rule_val as (TestKey) and val as "TestKey" of RValueType::Regex
2020-07-30 12:13:33,117 INFO [cfn_guard] Result: PASS
2020-07-30 12:13:33,117 INFO [cfn_guard] Applying rule 'CompoundRule {
compound_type: AND,
rule_list: [
Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Value",
operation: Require,
value: "^([0-9]|[A-Z]){4}$",
rule_vtype: Regex,
custom_msg: None,
},
],
}'
2020-07-30 12:13:33,117 DEBUG [cfn_guard] Applying rule 'Rule { resource_type: "AWS::EC2::Instance", field: "Tags.0.Value", operation: Require, value: "^([0-9]|[A-Z]){4}$", rule_vtype: Regex, custom_msg: None }'
2020-07-30 12:13:33,117 INFO [cfn_guard] Checking [EC2Instance2] which is of type "AWS::EC2::Instance"
2020-07-30 12:13:33,117 TRACE [cfn_guard::util] Getting ["Tags", "0", "Value"] from {"ImageId":{"Fn::FindInMap":["AWSRegionArch2AMI",{"Ref":"AWS::Region"},{"Fn::FindInMap":["AWSInstanceType2Arch",{"Ref":"InstanceType"},"Arch"]}]},"InstanceType":{"Ref":"InstanceType"},"KeyName":{"Ref":"KeyName"},"SecurityGroups":[{"Ref":"InstanceSecurityGroup"}],"Tags":[{"Key":"TestKey","Value":"1234"}]}
2020-07-30 12:13:33,117 TRACE [cfn_guard::util] field_list is ["Tags", "0", "Value"]
2020-07-30 12:13:33,117 TRACE [cfn_guard::util] next_field is "Tags" and field_list is now ["0", "Value"]
2020-07-30 12:13:33,117 TRACE [cfn_guard::util] props are Object({
"ImageId": Object({
"Fn::FindInMap": Array([
String(
"AWSRegionArch2AMI",
),
Object({
"Ref": String(
"AWS::Region",
),
}),
Object({
"Fn::FindInMap": Array([
String(
"AWSInstanceType2Arch",
),
Object({
"Ref": String(
"InstanceType",
),
}),
String(
"Arch",
),
]),
}),
]),
}),
"InstanceType": Object({
"Ref": String(
"InstanceType",
),
}),
"KeyName": Object({
"Ref": String(
"KeyName",
),
}),
"SecurityGroups": Array([
Object({
"Ref": String(
"InstanceSecurityGroup",
),
}),
]),
"Tags": Array([
Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
}),
]),
})
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] Getting ["0", "Value"] from [{"Key":"TestKey","Value":"1234"}]
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] field_list is ["0", "Value"]
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] next_field is 0 and field_list is now ["Value"]
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] props are Array([
Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
}),
])
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] Getting ["Value"] from {"Key":"TestKey","Value":"1234"}
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] field_list is ["Value"]
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] next_field is "Value" and field_list is now []
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] props are Object({
"Key": String(
"TestKey",
),
"Value": String(
"1234",
),
})
2020-07-30 12:13:33,118 DEBUG [cfn_guard] Template val is String("1234")
2020-07-30 12:13:33,118 TRACE [cfn_guard::util] Entered dereference_rule_value() with 'Rule {
resource_type: "AWS::EC2::Instance",
field: "Tags.0.Value",
operation: Require,
value: "^([0-9]|[A-Z]){4}$",
rule_vtype: Regex,
custom_msg: None,
}' and Variables '{
"ENV_LESSCLOSE": "********",
"ENV_HOSTTYPE": "********",
"ENV_LS_COLORS": "********",
"ENV_VSCODE_IPC_HOOK_CLI": "********",
"ENV_SHELL": "********",
"ENV_XDG_DATA_DIRS": "********",
"ENV_NAME": "********",
"ENV_TERM_PROGRAM_VERSION": "********",
"ENV_GIT_ASKPASS": "********",
"ENV_AWS_REGION": "********",
"ENV_VERBOSE_LOGGING": "********",
"ENV_WSLENV": "********",
"ENV_TERM_PROGRAM": "********",
"ENV_HOME": "********",
"ENV_SHLVL": "********",
"ENV_USER": "********",
"ENV_PATH": "********",
"ENV_PWD": "********",
"ENV_APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL": "********",
"ENV_COLORTERM": "********",
"ENV_TERM": "********",
"ENV__": "********",
"ENV_PIPE_LOGGING": "********",
"ENV_AWS_SDK_LOAD_CONFIG": "********",
"ENV_VSCODE_GIT_IPC_HANDLE": "********",
"ENV_AMD_ENTRYPOINT": "********",
"ENV_LANG": "********",
"ENV_VSCODE_GIT_ASKPASS_MAIN": "********",
"ENV_VSCODE_GIT_ASKPASS_NODE": "********",
"ENV_LESSOPEN": "********",
"ENV_LOGNAME": "********",
}'
2020-07-30 12:13:33,118 DEBUG [cfn_guard] rule_val is ^([0-9]|[A-Z]){4}$ and val is "1234"
2020-07-30 12:13:33,118 DEBUG [cfn_guard] OpCode::Require with rule_val as ^([0-9]|[A-Z]){4}$ and val as "1234" of RValueType::Regex
2020-07-30 12:13:33,119 INFO [cfn_guard] Result: FAIL
2020-07-30 12:13:33,119 TRACE [cfn_guard::util] Removing spaces and newline characters from '1234'
2020-07-30 12:13:33,119 TRACE [cfn_guard::util] formatted_value is '1234'
2020-07-30 12:13:33,119 DEBUG [cfn_guard] Outcome was: '[
"[EC2Instance2] failed because [Tags.0.Value] is [1234] and the permitted pattern is [^([0-9]|[A-Z]){4}$]",
]'
[EC2Instance2] failed because [Tags.0.Value] is [1234] and the permitted pattern is [^([0-9]|[A-Z]){4}$]
Number of failures: 1