-
Notifications
You must be signed in to change notification settings - Fork 9
Policy to stop a VM #66
Comments
Remediation spec v2 allows you to call methods generated by the python discovery-based client. You're limited to methods on that same "resource" (resource here being the python client's understanding, not rpelibs), but this your use case should be possible. The best way to figure out the syntax for the remediation step, is the google-api-python-client documentation located here: https://github.com/googleapis/google-api-python-client/blob/master/docs/dyn/index.md For methods available on compute instances, the document you want is here: https://googleapis.github.io/google-api-python-client/docs/dyn/compute_v1.instances.html The
You would need to set the remediation method to Without testing it, I think this is what you want:
|
Yes! you're right! that did work in fact! |
Hello, we want to create a policy that stops VMs. (we are using real-time-enforcer)
We are facing issues on finding the proper way of doing it...
On the remediate steps section of the rego policy, we specify the params needed by the GcpComputeInstance class, and an empty body as it is stated on the stop API: https://cloud.google.com/compute/docs/reference/rest/v1/instances/stop
But, looking at the code, I think that the call is going to the parent endpoint, not with "stop"
How can we easily do this? is there a way we can "hardcode" the API endpoint in the rego policy, so RPE can use it?
The text was updated successfully, but these errors were encountered: