google / cloud-forensics-utils

Python library to carry out DFIR analysis on the Cloud
Apache License 2.0
459 stars 88 forks source link

listinstances broken for the Azure provider #326

Closed jonathan-greig closed 3 years ago

jonathan-greig commented 3 years ago
$ cloudforensics az <default_resource_group_name> listinstances
[...]
[2021-07-01 14:42:54,492] [tools.az_cli        ] INFO     Instances found:
Traceback (most recent call last):
  File "/[REDACTED]/.local/share/virtualenvs/cloud-forensics-utils-j02neud9/bin/cloudforensics", line 11, in <module>
    load_entry_point('libcloudforensics==20210531', 'console_scripts', 'cloudforensics')()
  File "[REDACTED]/.local/share/virtualenvs/cloud-forensics-utils-j02neud9/lib/python3.9/site-packages/libcloudforensics-20210531-py3.9.egg/tools/cli.py", line 427, in Main
    parsed_args.func(parsed_args)
  File "/[REDACTED]/.local/share/virtualenvs/cloud-forensics-utils-j02neud9/lib/python3.9/site-packages/libcloudforensics-20210531-py3.9.egg/tools/az_cli.py", line 48, in ListInstances
    logger.info('Name: {0:s}, Boot disk: {1:s}'.format(instance, boot_disk))
TypeError: unsupported format string passed to AZComputeVirtualMachine.__format__

Issue is https://github.com/google/cloud-forensics-utils/blob/e010499745273e10bda3f030c734a3469c0a0296/tools/az_cli.py#L46 then https://github.com/google/cloud-forensics-utils/blob/e010499745273e10bda3f030c734a3469c0a0296/tools/az_cli.py#L48 where it trys to format the instance object rather than the instance name (compare to similar in the GCP provider).

jonathan-greig commented 3 years ago

Fixed with #327