Skip to content

Commit 20fd500

Browse files
authored
docs: Update README.md with more auth details
1 parent 44d5078 commit 20fd500

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ go install github.com/mark-adams/gcp-ip-list/cmd/gcp-ip-list@latest
3030

3131
# Running the tool
3232

33-
Since this tool uses the [Google Cloud Client Libraries for Go](https://github.com/googleapis/google-cloud-go), the application will authenticate with Google using [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials).
33+
This 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:
34+
35+
- Run the application on a GCP resource (VM, Cloud Function, etc.) with an attached service account
36+
- Run the application on your workstation after using `gcloud auth application-default login` to use your user account's credentials
37+
- Run the application on your workstation using a service account's credentials by running `gcloud auth activate-service-account`
38+
39+
For more information on authenticating, see the [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials) documentation.
40+
41+
Since 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.
3442

3543
## Usage
3644
```
@@ -124,9 +132,7 @@ Verified OK
124132

125133
## Could not find default credentials
126134

127-
```
128-
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
129-
```
135+
> 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
130136
131137
This 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.
132138

0 commit comments

Comments
 (0)