diff --git a/ScoutSuite/output/data/html/partials/aws/services.ec2.regions.id.snapshots.html b/ScoutSuite/output/data/html/partials/aws/services.ec2.regions.id.snapshots.html
index 19e46be31..3dc32e97e 100644
--- a/ScoutSuite/output/data/html/partials/aws/services.ec2.regions.id.snapshots.html
+++ b/ScoutSuite/output/data/html/partials/aws/services.ec2.regions.id.snapshots.html
@@ -8,7 +8,9 @@
{{name}}
Information
- Id: {{id}}
- - Description: {{Description}}
+ - Date: {{StartTime}}
+ - Description:{{Description}}
+ - State: {{State}}
- Encrypted: {{Encrypted}}
- Is encrypted: {{Encrypted}}
- Volume: {{> resource_link resource_path = (concat 'services.ec2.regions' region 'volumes' VolumeId )}}
diff --git a/ScoutSuite/providers/aws/provider.py b/ScoutSuite/providers/aws/provider.py
index 8a688e16d..06168617a 100644
--- a/ScoutSuite/providers/aws/provider.py
+++ b/ScoutSuite/providers/aws/provider.py
@@ -78,6 +78,7 @@ def preprocessing(self, ip_ranges=None, ip_ranges_name_key=None):
# Various data processing calls
self._add_security_group_name_to_ec2_grants()
+ self._add_last_snapshot_date_to_ec2_volumes()
self._process_cloudtrail_trails(self.services['cloudtrail'])
self._add_cidr_display_name(ip_ranges, ip_ranges_name_key)
self._merge_route53_and_route53domains()
@@ -114,6 +115,13 @@ def _add_security_group_name_to_ec2_grants(self):
self.add_security_group_name_to_ec2_grants_callback,
{'AWSAccountId': self.aws_account_id})
+ def _add_last_snapshot_date_to_ec2_volumes(self):
+ for region in self.services['ec2']['regions'].values():
+ for volumeId, volume in region.get('volumes').items():
+ completed_snapshots = [s for s in region['snapshots'].values() if s['VolumeId'] == volumeId and s['State'] == 'completed']
+ mostRecent = sorted(completed_snapshots, key=lambda s: s['StartTime'], reverse=True)[0]
+ volume['LastSnapshotDate'] = mostRecent['StartTime']
+
def add_security_group_name_to_ec2_grants_callback(self, current_config, path, current_path, ec2_grant, callback_args):
sg_id = ec2_grant['GroupId']
if sg_id in current_path: