Skip to content

Commit

Permalink
GCP -> Google Cloud
Browse files Browse the repository at this point in the history
There's more, but this is a start.

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Jun 12, 2024
1 parent c57b6e2 commit 7bbdc02
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
40 changes: 20 additions & 20 deletions docs/cnquery/cnquery-gcp/README.mdx
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
---
title: Query Google Cloud
id: cnquery-gcp-intro
sidebar_label: Google Cloud Platform (GCP)
sidebar_label: Google Cloud (GCP)
displayed_sidebar: cnquery
sidebar_position: 1
description: Explore and analyze your Google Cloud infrastructure with cnquery
image: /img/featured_img/mondoo-gcp.jpg
---

With cnquery, you can explore and interrogate your entire Google Cloud Platform (GCP) project, including its compute instances. It's like having a powerful search engine for your GCP environment. For example, you can analyze firewalls, search for Compute Engine instance configuration details, or find all Cloud Storage buckets that anonymous or public users can access... all with a single tool.
With cnquery, you can explore and interrogate your entire Google Cloud (GCP) project, including its compute instances. It's like having a powerful search engine for your Google Cloud environment. For example, you can analyze firewalls, search for Compute Engine instance configuration details, or find all Cloud Storage buckets that anonymous or public users can access... all with a single tool.

cnquery provides the answers you need about every GCP configuration. For a list of GCP resources you can query, read [Mondoo Google Cloud Platform (GCP) Resource Pack Reference](/mql/resources/gcp-pack/) and [Mondoo Core Resource Pack Reference](/mql/resources/core-pack/).
cnquery provides the answers you need about every Google Cloud configuration. For a list of Google Cloud resources you can query, read [Mondoo Google Cloud (GCP) Resource Pack Reference](/mql/resources/gcp-pack/) and [Mondoo Core Resource Pack Reference](/mql/resources/core-pack/).

## Connect cnquery with your GCP environment
## Connect cnquery with your Google Cloud environment

### Requirements

To explore your GCP environment with cnquery, you must have:
To explore your Google Cloud environment with cnquery, you must have:

- [cnquery installed on your workstation](/cnquery/)
- A [Google Platform account](https://cloud.google.com/free)
- [Google Cloud SDK](https://cloud.google.com/sdk/install) installed

### Provide access credentials

In your terminal, log into GCP with this command:
In your terminal, log into Google Cloud with this command:

```bash
gcloud auth login --update-adc
```

### Configure the GCP project you want explore
### Configure the Google Cloud project you want explore

To query a GCP project, you must set up the project:
To query a Google Cloud project, you must set up the project:

```bash
gcloud config set project PROJECTID
```

For `PROJECTID`, substitute the ID of the project you want to query.

GCP confirms the setup:
Google Cloud confirms the setup:

```bash
Updated property [core/project].
Expand All @@ -52,7 +52,7 @@ To verify your configuration, enter:
gcloud config list
```

GCP returns results similar to these:
Google Cloud returns results similar to these:

```
[core]
Expand All @@ -63,9 +63,9 @@ project = gcp-project-id
Your active configuration is: [default]
```

### Verify with a quick GCP query
### Verify with a quick Google Cloud query

To quickly confirm that cnquery has access to your GCP environment, run this query from your terminal, substituting your project ID for YOUR_PROJECT_ID:
To quickly confirm that cnquery has access to your Google Cloud environment, run this query from your terminal, substituting your project ID for YOUR_PROJECT_ID:

```bash
cnquery run gcp project YOUR_PROJECT_ID -c gcp.project
Expand All @@ -79,45 +79,45 @@ cnquery returns the name of the project:
gcp.project: gcp.project name="lune-edge"
```

You've successfully used cnquery to answer your first question about your GCP environment. Now you're ready to explore.
You've successfully used cnquery to answer your first question about your Google Cloud environment. Now you're ready to explore.

## Query a Google Cloud project

To answer any question about your environment, use cnquery's interactive shell. It has auto-complete to guide you, which is especially helpful when you're new to cnquery and learning MQL.

To launch a shell into your GCP environment to run queries, substitute ORGANIZATION-ID with the ID of the organization you want to access and run:
To launch a shell into your Google Cloud environment to run queries, substitute ORGANIZATION-ID with the ID of the organization you want to access and run:

```bash
cnquery shell gcp org ORGANIZATION-ID
```

To launch a shell into your GCP environment on the project level, substitute PROJECT-ID with the ID of the project you want to access and run:
To launch a shell into your Google Cloud environment on the project level, substitute PROJECT-ID with the ID of the project you want to access and run:

```bash
cnquery shell gcp project PROJECT-ID
```

To launch a shell into your GCP environment on the folder level, substitute FOLDER-ID with the ID of the folder you want to access and run:
To launch a shell into your Google Cloud environment on the folder level, substitute FOLDER-ID with the ID of the folder you want to access and run:

```bash
cnquery shell gcp folder FOLDER-ID
```

### Discover capabilities with the `help` command

Once inside the shell, use the `help` command to learn what GCP resources you can query. This command lists all the GCP resources:
Once inside the shell, use the `help` command to learn what Google Cloud resources you can query. This command lists all the Google Cloud resources:

```coffeescript
help gcp
```

From the resulting list, you can drill down further. For example, enter this command to list all the GCP DNS resources you can query:
From the resulting list, you can drill down further. For example, enter this command to list all the Google Cloud DNS resources you can query:

```coffeescript
help gcp.dns
```

From the resulting list, you can drill down even further. You can also learn about available GCP resources in the [Mondoo Google Cloud Platform (GCP) Resource Pack Reference](/mql/resources/gcp-pack/).
From the resulting list, you can drill down even further. You can also learn about available Google Cloud resources in the [Mondoo Google Cloud Platform (GCP) Resource Pack Reference](/mql/resources/gcp-pack/).

### Query Compute Engine instances

Expand Down Expand Up @@ -294,6 +294,6 @@ gcp.project.computeService.instances.where: [
## Learn more about querying Google Cloud

- To learn more about how the MQL query language works, read [Write Effective MQL](/mql/mql.write/).
- For a list of all the GCP resources and fields you can query, read the [Mondoo Google Cloud Platform (GCP) Resource Pack Reference](/mql/resources/gcp-pack/).
- For a list of all the Google Cloud resources and fields you can query, read the [Mondoo Google Cloud (GCP) Resource Pack Reference](/mql/resources/gcp-pack/).

---
2 changes: 1 addition & 1 deletion docs/cnquery/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Download and install cnquery on your assets.

- [Azure](/cnquery/cnquery-azure/)

- [GCP](/cnquery/cnquery-gcp/)
- [Google Cloud](/cnquery/cnquery-gcp/)

- [Kubernetes](/cnquery/cnquery-k8s/)

Expand Down
22 changes: 11 additions & 11 deletions docs/cnspec/cloud/gcp/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ description: Assess Google Cloud Security with cnspec
image: /img/featured_img/mondoo-gcp.jpg
---

cnspec assesses your full GCP environment for misconfigurations that put your organization at risk. You can scan your GCP account for compliance with security policies created by Mondoo or the community, or [create your own policies](/cnspec/cnspec-policies/write/). You also can write individual tests to run on the fly or include in automated tasks.
cnspec assesses your full Google Cloud environment for misconfigurations that put your organization at risk. You can scan your Google Cloud account for compliance with security policies created by Mondoo or the community, or [create your own policies](/cnspec/cnspec-policies/write/). You also can write individual tests to run on the fly or include in automated tasks.

cnspec can test any aspect of your GCP configuration. For a list of GCP resources you can test, read [Mondoo Google Cloud Platform (GCP) Resource Pack Reference](/mql/resources/gcp-pack/) and [Mondoo Core Resource Pack Reference](/mql/resources/core-pack/).
cnspec can test any aspect of your Google Cloud configuration. For a list of Google Cloud resources you can test, read [Mondoo Google Cloud (GCP) Resource Pack Reference](/mql/resources/gcp-pack/) and [Mondoo Core Resource Pack Reference](/mql/resources/core-pack/).

:::info

You can also use cnspec with HashiCorp Packer to [build secure VM images in Google Cloud](/cnspec/cloud/gcp/packer/).

:::

## Connect cnspec with your GCP environment
## Connect cnspec with your Google Cloud environment

### Requirements

To test your GCP environment with cnspec, you must have:
To test your Google Cloud environment with cnspec, you must have:

- [cnspec installed on your workstation](/cnspec/)
- A [Google Platform account](https://cloud.google.com/free)
Expand All @@ -30,23 +30,23 @@ To test your GCP environment with cnspec, you must have:

### Provide access credentials

In your terminal, log into GCP with this command:
In your terminal, log into Google Cloud with this command:

```bash
gcloud auth login --update-adc
```

### Configure the GCP project you want assess
### Configure the Google Cloud project you want assess

To test a GCP project, you must set up the project:
To test a Google Cloud project, you must set up the project:

```bash
gcloud config set project PROJECTID
```

For `PROJECTID`, substitute the ID of the project you want to assess.

GCP confirms the setup:
Google Cloud confirms the setup:

```bash
Updated property [core/project].
Expand All @@ -58,7 +58,7 @@ To verify your configuration, enter:
gcloud config list
```

GCP returns results similar to these:
Google Cloud returns results similar to these:

```ini
[core]
Expand All @@ -69,9 +69,9 @@ project = gcp-project-id
Your active configuration is: [default]
```

### Verify with a quick GCP check
### Verify with a quick Google Cloud check

To quickly confirm that cnspec has access to your GCP environment, run this check from your terminal:
To quickly confirm that cnspec has access to your Google Cloud environment, run this check from your terminal:

```bash
cnspec run gcp project PROJECT-ID -c 'gcp.project.id!="foo"'
Expand Down
12 changes: 6 additions & 6 deletions docs/cnspec/cloud/gcp/packer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,12 @@ packer {

variable "zone" {
default = "us-east5-a"
description = "GCP zone to build the image in"
description = "Google Cloud zone to build the image in"
}

variable "project_id" {
type = string
description = "GCP Project ID to build the image in"
description = "Google Cloud Project ID to build the image in"
}

variable "image_prefix" {
Expand Down Expand Up @@ -194,23 +194,23 @@ To learn about the various options to override variables set in the Packer templ
**Zone**
By default the template will build the image in GCP's us-east5-a zone:
By default the template will build the image in Google Cloud's us-east5-a zone:
```
variable "zone" {
default = "us-east5-a"
description = "GCP zone to build the image in"
description = "Google Cloud zone to build the image in"
}
```
**Project ID**
You must set the `project_id` variable with the ID of the project from your GCP account:
You must set the `project_id` variable with the ID of the project from your Google Cloud account:
```
variable "project_id" {
type = string
description = "GCP Project ID to build the image in"
description = "Google Cloud Project ID to build the image in"
}
```
Expand Down
2 changes: 1 addition & 1 deletion sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ module.exports = {
{
type: "doc",
id: "cnquery/cnquery-gcp/cnquery-gcp-intro",
label: "GCP",
label: "Google Cloud",
},
{
type: "category",
Expand Down

0 comments on commit 7bbdc02

Please sign in to comment.