Skip to content

Latest commit

 

History

History
53 lines (35 loc) · 3.47 KB

File metadata and controls

53 lines (35 loc) · 3.47 KB

GCP - Orgpolicy Privesc

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}

orgpolicy

orgpolicy.policy.set

An attacker leveraging orgpolicy.policy.set can manipulate organizational policies, which will allow him to remove certain restrictions impeding specific operations. For instance, the constraint appengine.disableCodeDownload usually blocks downloading of App Engine source code. However, by using orgpolicy.policy.set, an attacker can deactivate this constraint, thereby gaining access to download the source code, despite it initially being protected.

{% code overflow="wrap" %}

# Get info
gcloud resource-manager org-policies describe <org-policy> [--folder <id> | --organization <id> | --project <id>]

# Disable
gcloud resource-manager org-policies disable-enforce <org-policy> [--folder <id> | --organization <id> | --project <id>]

{% endcode %}

A python script for this method can be found here.

References

{% hint style="success" %} Learn & practice AWS Hacking:HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking: HackTricks Training GCP Red Team Expert (GRTE)

Support HackTricks
{% endhint %}