I have Python3 script that pulls information from AWS regarding to the AWS Network Firewall Managed Rule Group -
def get_current_version(rule_group_arn):
response = network_firewall.describe_rule_group_metadata(RuleGroupArn=rule_group_arn)
return response
print(get_current_version("arn:aws:network-firewall:eu-central-1:aws-managed:stateful-rulegroup/ThreatSignaturesDoSStrictOrder"))
When I execute it, I get response:
{'RuleGroupArn': 'arn:aws:network-firewall:eu-central-1:aws-managed:stateful-rulegroup/ThreatSignaturesDoSStrictOrder', 'RuleGroupName': 'ThreatSignaturesDoSStrictOrder', 'Description': 'Signatures that detect Denial of Service attempts.', 'Type': 'STATEFUL', 'Capacity': 200, 'StatefulRuleOptions': {'RuleOrder': 'STRICT_ORDER'}, 'LastModifiedTime': datetime.datetime(2022, 6, 21, 12, 54, 12, 241000, tzinfo=tzlocal()), 'ResponseMetadata': {'RequestId': 'a4ea84ee-f908-4f2c-9ff1-6b4542b1313c', 'HTTPStatusCode': 200, 'HTTPHeaders': {'x-amzn-requestid': 'a4ea84ee-f908-4f2c-9ff1-6b4542b1313c', 'content-type': 'application/x-amz-json-1.0', 'content-length': '354', 'date': 'Tue, 27 Sep 2022 18:10:26 GMT'}, 'RetryAttempts': 0}}
I want to run similar function in the Lamda, so I wrote this code:
def lambda_handler(event, context):
response = network_firewall.describe_rule_group_metadata(RuleGroupArn="arn:aws:network-firewall:eu-central-1:aws-managed:stateful-rulegroup/ThreatSignaturesDoSStrictOrder")
return response
However, response I get is different than previous one, namely one field is missing: LastModifiedTime and this field is crucial for my code's logic.
{
"RuleGroupArn": "arn:aws:network-firewall:eu-central-1:aws-managed:stateful-rulegroup/ThreatSignaturesDoSStrictOrder",
"RuleGroupName": "ThreatSignaturesDoSStrictOrder",
"Description": "Signatures that detect Denial of Service attempts.",
"Type": "STATEFUL",
"Capacity": 200,
"StatefulRuleOptions": {
"RuleOrder": "STRICT_ORDER"
},
"ResponseMetadata": {
"RequestId": "45bafe6f-8df4-479a-b0bb-c4572dc7f039",
"HTTPStatusCode": 200,
"HTTPHeaders": {
"x-amzn-requestid": "45bafe6f-8df4-479a-b0bb-c4572dc7f039",
"content-type": "application/x-amz-json-1.0",
"content-length": "354",
"date": "Tue, 27 Sep 2022 18:37:07 GMT"
},
"RetryAttempts": 0
}
}
I've read documentation and it states that field should be present. Maybe I'm missing some point.
Thanks in advance for help!