cloud-inquisitor icon indicating copy to clipboard operation
cloud-inquisitor copied to clipboard

EBS Volume Auditor Report shows deleted volumes

Open TheM0ng00se opened this issue 7 years ago • 2 comments

An issue was reported with the Volume Auditor Report:

  • The Volume Auditor Report is showing EBS Volumes that have been deleted (The IssueID is not being removed when the finding clears)

TheM0ng00se avatar Feb 16 '18 17:02 TheM0ng00se

This is a larger issue, where the EBS auditor does not correctly handle deleted volumes, causing the auditor to error out, reference https://github.com/RiotGames/cinq-auditor-ebs/issues/6 for more infomration

bunjiboys avatar May 16 '18 17:05 bunjiboys

Move the content in the link above here:

When a volume which has an associated issue is deleted, before being fixed, the issue is not correctly removed, but instead causes the auditor to crash with a NoneType exception

Traceback (most recent call last):
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_scheduler_sqs/__init__.py", line 348, in execute_worker
    worker.run()
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_auditor_ebs/__init__.py", line 46, in run
    data = self.update_data()
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_auditor_ebs/__init__.py", line 71, in update_data
    fixed_issues = self.process_fixed_issues(volumes, existing_issues)
  File "/opt/pyenv/lib/python3.5/site-packages/cinq_auditor_ebs/__init__.py", line 175, in process_fixed_issues
    fixed_issues.setdefault(issue.volume.account, []).append(issue)
AttributeError: 'NoneType' object has no attribute 'account'

To avoid this, we need to check if the issue.volume reference is None during the cleanup phase, as this will only be None if the resource it references doesn't exist, ie. the volume has been deleted

HTTP500 avatar Sep 12 '18 16:09 HTTP500