You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
A few suggestions for making the GCP instance lookup more robust in gcp_service.py:get_single_instance_public_ip:
1. Add a null-check with a helpful error message:
defget_single_instance_public_ip(self, name, zone):
instance=self.compute.instances().get(
project=self.project, zone=zone, instance=name
).execute()
ifnotinstance:
raiseRuntimeError(
f"GCP instance '{name}' not found in zone '{zone}'. ""Verify the instance name and zone are correct in your config."
)
network_interfaces=instance.get('networkInterfaces', [])
ifnotnetwork_interfaces:
raiseRuntimeError(
f"Instance '{name}' has no network interfaces. ""Check that the instance was created with a network interface."
)
# ... rest of IP extraction
2. Add retry logic with exponential backoff for the GCP API call, since transient 429s/503s are common:
3. Validate region/zone consistency in your config validation step — ensure the zone string matches the region prefix (e.g., us-central1-a starts with us-central1). This prevents confusing errors where the API returns empty results because the zone doesn't exist in the specified region.
Activity
P4T12ICK commentedon Feb 9, 2026
We just have a new release of Attack Range v5 including a UI and API. Can you try it again? thank you.
janderik commentedon Jul 22, 2026
A few suggestions for making the GCP instance lookup more robust in
gcp_service.py:get_single_instance_public_ip:1. Add a null-check with a helpful error message:
2. Add retry logic with exponential backoff for the GCP API call, since transient 429s/503s are common:
3. Validate region/zone consistency in your config validation step — ensure the zone string matches the region prefix (e.g.,
us-central1-astarts withus-central1). This prevents confusing errors where the API returns empty results because the zone doesn't exist in the specified region.