{"id":41367610,"url":"https://github.com/mark-adams/gcp-ip-list","last_synced_at":"2026-01-23T08:38:05.893Z","repository":{"id":285958387,"uuid":"957049590","full_name":"mark-adams/gcp-ip-list","owner":"mark-adams","description":"A CLI tool (and library) written in Go to simplify the process of retrieving IP addresses from infrastructure hosted on Google Cloud Platform (GCP).","archived":false,"fork":false,"pushed_at":"2025-04-03T19:59:36.000Z","size":34,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-12T15:55:57.239Z","etag":null,"topics":["gcp","gcp-security","golang","security","security-tools"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mark-adams.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-29T12:38:13.000Z","updated_at":"2025-07-24T02:49:07.000Z","dependencies_parsed_at":"2025-04-03T15:37:30.544Z","dependency_job_id":"24e7c75b-87ac-4af4-a518-580fd830d233","html_url":"https://github.com/mark-adams/gcp-ip-list","commit_stats":null,"previous_names":["mark-adams/gcp-ip-list"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mark-adams/gcp-ip-list","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-adams%2Fgcp-ip-list","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-adams%2Fgcp-ip-list/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-adams%2Fgcp-ip-list/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-adams%2Fgcp-ip-list/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mark-adams","download_url":"https://codeload.github.com/mark-adams/gcp-ip-list/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mark-adams%2Fgcp-ip-list/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28685065,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gcp","gcp-security","golang","security","security-tools"],"created_at":"2026-01-23T08:38:04.134Z","updated_at":"2026-01-23T08:38:05.888Z","avatar_url":"https://github.com/mark-adams.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GCP IP List\n\n[![godoc](http://img.shields.io/badge/godoc-reference-blue.svg?style=flat)](https://godoc.org/github.com/mark-adams/gcp-ip-list) [![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/mark-adams/gcp-ip-list/main/LICENSE) [![Build Status](https://github.com/mark-adams/gcp-ip-list/actions/workflows/test.yml/badge.svg)](https://github.com/mark-adams/gcp-ip-list/actions/workflows/test.yml) \n\n\n`gcp-ip-list` is a CLI tool (and library) written in Go to simplify the process of retrieving IP addresses from infrastructure hosted on Google Cloud Platform (GCP).\n\nMost enumeration tooling today uses the normal CRUD REST APIs provided by Google to retrieve GCP assets and their IP address information. This is less than ideal because it typically involves interacting with several different Google APIs and puts additional load on the very same APIs that are used as the control plane for GCP customers. In addition, it is quite slow especially if you have a large number of projects.\n\nThis tool takes a different approach and queries information about assets from Google's [Cloud Asset Inventory API](https://cloud.google.com/asset-inventory/docs/overview) instead. This allows us to use a single API to pull down all the data about assets that could potentially have public IP addresses assigned to them which allows us to download data for organizations of any size much more efficiently.\n\n# Installation\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003ctd\u003eHomebrew (macOS or Linux)\u003c/td\u003e\n        \u003ctd\u003e\n            \u003ccode\u003ebrew tap mark-adams/gcp-ip-list \u0026\u0026 brew install gcp-ip-list\u003c/code\u003e\n        \u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\nPre-built binaries are also avalable from the [Releases page](https://github.com/mark-adams/gcp-ip-list/releases)\n\nIf your system has a [supported version of Go](https://go.dev/dl/), you can build from source.\n\n```\ngo install github.com/mark-adams/gcp-ip-list/cmd/gcp-ip-list@latest\n```\n\n# Running the tool\n\nThis application authenticates with GCP using [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). Some examples of how you might authneticate include:\n\n- Run the application on a GCP resource (VM, Cloud Function, etc.) with an attached service account\n- Run the application on your workstation after using `gcloud auth application-default login` to use your user account's credentials\n- Run the application on your workstation using a service account's credentials by running `gcloud auth activate-service-account`\n\nFor more information on authenticating, see the [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) documentation.\n\nSince this application uses the Cloud Asset Inventory APIs, your user account / service account will need to have the Cloud Asset Viewer (`roles/cloudasset.viewer`) IAM role assigned for the targeted scope's (i.e. organization, folder, or project) IAM policy.\n\n## Usage\n```\n$ gcp-ip-list -h       \nUsage of gcp-ip-list:\n  -format string\n        The output format (csv, json, table, list) (default \"table\")\n  -private\n        Include private IPs only\n  -public\n        Include public IPs only\n  -scope string\n        The scope (organization, folder, or project) to search (i.e. projects/abc-123 or organizations/123456)\n  -version\n        Display the current version\n```\n\n### Use as a library\nCore functionality of the CLI is exposed via Go APIs as well in the `github.com/mark-adams/gcp-ip-list/pkg/go` package via the `GetAllAddressesFromAssetInventory()` and `GetAddressesFromAssetInventory()` functions in case you want to incoporate this functionality into your own application.\n\n## Examples\n\n### Table output\n```\n$ gcp-ip-list --scope=projects/sample-project -public\n+----------------+--------------+---------------------------------------+-------------------------------------------------------------------------------------------------------------------------+\n|    ADDRESS     | ADDRESS TYPE |             RESOURCE TYPE             |                                                      RESOURCE NAME                                                      |\n+----------------+--------------+---------------------------------------+-------------------------------------------------------------------------------------------------------------------------+\n| 35.244.150.176 | public       | compute.googleapis.com/ForwardingRule | //compute.googleapis.com/projects/sample-project/global/forwardingRules/ip-list-test-forwarding-rule-external        |\n| 34.54.75.78    | public       | compute.googleapis.com/ForwardingRule | //compute.googleapis.com/projects/sample-project/global/forwardingRules/ip-list-test-forwarding-rule-external-static |\n| 34.83.163.216  | public       | compute.googleapis.com/Instance       | //compute.googleapis.com/projects/sample-project/zones/us-west1-a/instances/ip-list-test-vm                          |\n| 34.105.8.244   | public       | compute.googleapis.com/Router         | //compute.googleapis.com/projects/sample-project/regions/us-west1/routers/ip-list-test-router                        |\n| 34.19.43.198   | public       | container.googleapis.com/Cluster      | //container.googleapis.com/projects/sample-project/locations/us-west1/clusters/ip-list-test-cluster                  |\n| 34.127.47.18   | public       | sqladmin.googleapis.com/Instance      | //cloudsql.googleapis.com/projects/sample-project/instances/ip-list-test-db                                          |\n+----------------+--------------+---------------------------------------+-------------------------------------------------------------------------------------------------------------------------+\n```\n\n### List output\n\n```\n$ gcp-ip-list --scope=projects/sample-project -public -format=list\n35.244.150.176\n34.54.75.78\n34.83.163.216\n34.105.8.244\n34.19.43.198\n34.127.47.18\n```\n\nThis mode is handy for piping to your favorite port scanning tool like `nmap` or `naabu`:\n```\ngcp-ip-list --scope=projects/sample-project -public -format=list | nmap -iL -\n```\n\n### CSV \u0026 JSON output\n\nYou can get the same output as the default table format but in CSV or JSON as well:\n\n```\ngcp-ip-list --scope=projects/sample-project -public -format=csv\n```\n\n```\ngcp-ip-list --scope=projects/sample-project -public -format=json\n```\n\n# Contributing\nSee our [Contribution guidelines](CONTRIBUTING.md)\n\n## Terraform resources\nThe `terraform` directory contains sample resources that are handy when doing local development on `gcp-ip-list`.\nIf you add support for a new resource type, please add the appropriate Terraform resources in the same PR.\n\n# Releases\nNew releases can be found on the [Releases](page).\n\n## Verifying signatures\nBinaries built by this project are signed using Sigstore.\n\nTo verify the signature for a given binary, you can use [cosign](https://github.com/sigstore/cosign):\n\n```\n$ cosign verify-blob gcp-ip-list_Darwin_x86_64/gcp-ip-list \\                                                 \n       --bundle gcp-ip-list_Darwin_x86_64.cosign.bundle \\\n       --certificate-oidc-issuer=https://token.actions.githubusercontent.com \\\n       --certificate-identity=https://github.com/mark-adams/gcp-ip-list/.github/workflows/release.yml@refs/tags/\u003cversion\u003e\nVerified OK\n```\n\n# Troubleshooting\n\n## Could not find default credentials\n\n\u003e error getting public addresses: error setting up client: credentials: could not find default credentials. See https://cloud.google.com/docs/authentication/external/set-up-adc for more information\n\nThis means that you're likely running the tool locally from your workstation without having application default credentials set up. You can follow the link in the message or run `gcloud auth application-default login` to authenticate with GCP and obtain the proper credentials.\n\n## Cloud Asset API has not been used in project X before\n\nThis tool depends on the Cloud Asset Inventory API being enabled. Luckily, the error message points you in the right direction. Look for \"Enable it by visiting https://...\" in the error message and visit that page to enable the API.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-adams%2Fgcp-ip-list","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmark-adams%2Fgcp-ip-list","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmark-adams%2Fgcp-ip-list/lists"}