GCP Region issue
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.6k
- Forks
- 417
- PR merge metrics
- No merged PRs in 30d
Description
I have set up the attack range on my Mac and connected to GCP. However, when I run the attack command, it gives the below error.
Traceback (most recent call last):
File "/Users/a/Desktop/s/attack_range/attack_range.py", line 349, in
main(sys.argv[1:])
~~~~^^^^^^^^^^^^^^
File "/Users/a/Desktop/s/attack_range/attack_range.py", line 345, in main
return args.func(args)
~~~~~~~~~^^^^^^
File "/Users/a/Desktop/s/attack_range/attack_range.py", line 73, in simulate
controller.simulate(args.engine, args.target, args.technique, args.playbook)
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/a/Desktop/s/attack_range/modules/gcp_controller.py", line 143, in simulate
simulation_controller.simulate(target, technique)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
File "/Users/a/Desktop/s/attack_range/modules/art_simulation_controller.py", line 62, in simulate
target_public_ip = gcp_service.get_single_instance_public_ip(
target,
self.config["general"]["key_name"],
self.config["gcp"]["region"],
)
File "/Users/a/Desktop/s/attack_range/modules/gcp_service.py", line 102, in get_single_instance_public_ip
.network_interfaces[0]
^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'network_interfaces'
even though I have this config in the YML
region: europe-west3
zone: europe-west3-a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with attack_range.py and follow the simulate path into modules/gcp_controller.py, modules/art_simulation_controller.py, and modules/gcp_service.py. Reproduce the attack using the reported region and zone settings, then inspect get_single_instance_public_ip around the failing network interface lookup. Done means the configured GCP region and zone no longer lead to this AttributeError during an attack.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, python
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100