|
1 | | -# Check Point CloudGuard Network Repository Overview |
2 | | -Check Point CloudGuard Network (formerly known as CloudGuard IaaS) repository. |
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
3 | 7 |
|
4 | | -The repository contains: |
| 8 | +# Terraform Modules for CloudGuard Network Security (CGNS) - GCP |
5 | 9 |
|
6 | | -* Terraform modules |
7 | | -* Community-supported content |
8 | 10 |
|
9 | | -## Related Products and Solutions |
10 | | -* CloudGuard Network Security for GCP |
| 11 | +## Introduction |
| 12 | +This repository provides a structured set of Terraform modules for deploying Check Point CloudGuard Network Security in GCP. These modules automate the creation of Virtual Networks, Security Gateways, High-Availability architectures, and more, enabling secure and scalable cloud deployments. |
11 | 13 |
|
12 | | -## References |
13 | | -* For more information about Check Point CloudGuard for Public Cloud, see https://www.checkpoint.com/products/iaas-public-cloud-security/ |
14 | | -* CloudGuard documentation is available at https://supportcenter.checkpoint.com/supportcenter/portal?eventSubmit_doGoviewsolutiondetails=&solutionid=sk132552& |
15 | | -* CloudGuard Network CheckMates community is available at https://community.checkpoint.com/t5/CloudGuard-IaaS/bd-p/cloudguard-iaas |
| 14 | + |
| 15 | +## Before you begin |
| 16 | +1. Create a project in the [Google Cloud Console](https://console.cloud.google.com/) and set up billing on that project. |
| 17 | +2. [Install Terraform](https://learn.hashicorp.com/tutorials/terraform/install-cli) and read the Terraform getting started guide that follows. This guide will assume basic proficiency with Terraform - it is an introduction to the Google provider. |
| 18 | + |
| 19 | +### Configuring the Provider |
| 20 | +The **main.tf** file includes the following provider configuration block used to configure the credentials you use to authenticate with GCP, as well as a default project and location for your resources: |
| 21 | +``` |
| 22 | +provider "google" { |
| 23 | + credentials = file(var.service_account_path) |
| 24 | + project = var.project |
| 25 | + region = var.region |
| 26 | +} |
| 27 | +... |
| 28 | +``` |
| 29 | + |
| 30 | +1. [Create a Service Account](https://cloud.google.com/docs/authentication/getting-started) (or use the existing one). Next, download the JSON key file. Name it something you can remember and store it somewhere secure on your machine. <br/> |
| 31 | +2. Select "Editor" Role or verify you have the following permissions: |
| 32 | + ``` |
| 33 | + compute.autoscalers.create |
| 34 | + compute.autoscalers.delete |
| 35 | + compute.autoscalers.get |
| 36 | + compute.autoscalers.update |
| 37 | + compute.disks.create |
| 38 | + compute.firewalls.create |
| 39 | + compute.firewalls.delete |
| 40 | + compute.firewalls.get |
| 41 | + compute.firewalls.update |
| 42 | + compute.instanceGroupManagers.create |
| 43 | + compute.instanceGroupManagers.delete |
| 44 | + compute.instanceGroupManagers.get |
| 45 | + compute.instanceGroupManagers.use |
| 46 | + compute.instanceGroups.delete |
| 47 | + compute.instanceTemplates.create |
| 48 | + compute.instanceTemplates.delete |
| 49 | + compute.instanceTemplates.get |
| 50 | + compute.instanceTemplates.useReadOnly |
| 51 | + compute.instances.create |
| 52 | + compute.instances.setMetadata |
| 53 | + compute.instances.setTags |
| 54 | + compute.networks.get |
| 55 | + compute.networks.updatePolicy |
| 56 | + compute.regions.list |
| 57 | + compute.subnetworks.get |
| 58 | + compute.subnetworks.use |
| 59 | + compute.subnetworks.useExternalIp |
| 60 | + iam.serviceAccounts.actAs |
| 61 | + ``` |
| 62 | +3. ```credentials``` - Your service account key file is used to complete a two-legged OAuth 2.0 flow to obtain access tokens to authenticate with the GCP API as needed; Terraform will use it to reauthenticate automatically when tokens expire. <br/> |
| 63 | +The provider credentials can be provided either as static credentials or as [Environment Variables](https://www.terraform.io/docs/providers/google/guides/provider_reference.html#credentials-1). |
| 64 | + - Static credentials can be provided by adding the path to your service-account json file, project-id and region in /gcp/modules/autoscale-into-new-vpc/**terraform.tfvars** file as follows: |
| 65 | + ``` |
| 66 | + service_account_path = "service-accounts/service-account-file-name.json" |
| 67 | + project = "project-id" |
| 68 | + region = "us-central1" |
| 69 | + ``` |
| 70 | + - In case the Environment Variables are used, perform modifications described below:<br/> |
| 71 | + a. The next lines in the main.tf file, in the provider google resource, need to be deleted or commented: |
| 72 | + ``` |
| 73 | + provider "google" { |
| 74 | + // credentials = file(var.service_account_path) |
| 75 | + // project = var.project |
| 76 | + |
| 77 | + region = var.region |
| 78 | + } |
| 79 | + ``` |
| 80 | + b.In the terraform.tfvars file leave empty double quotes for credentials and project variables: |
| 81 | + ``` |
| 82 | + service_account_path = "" |
| 83 | + project = "" |
| 84 | + ``` |
| 85 | +## Usage |
| 86 | +- Fill all variables in the /gcp/autoscale-into-existing-vpc/**terraform.tfvars** file with proper values (see below for variables descriptions). |
| 87 | +- From a command line initialize the Terraform configuration directory: |
| 88 | + ``` |
| 89 | + terraform init |
| 90 | + ``` |
| 91 | +- Create an execution plan: |
| 92 | + ``` |
| 93 | + terraform plan |
| 94 | + ``` |
| 95 | +- Create or modify the deployment: |
| 96 | + ``` |
| 97 | + terraform apply |
| 98 | + ``` |
| 99 | +
|
| 100 | +## Repository Structure |
| 101 | +`Submodules:` Contains modular, reusable, production-grade Terraform components, each with its own documentation. |
| 102 | +
|
| 103 | +`Examples:` Demonstrates how to use the modules. |
| 104 | +
|
| 105 | + |
| 106 | +**Submodules:** |
| 107 | +* [`network-security-integration`](https://registry.terraform.io/modules/chkp-olgami/olgami/gcp/latest/submodules/network-security-integration) - Deploys GCP Network Security Integration. |
| 108 | +
|
| 109 | +Internal Submodules - |
| 110 | +
|
| 111 | +* [`firewall-rule`](https://registry.terraform.io/modules/chkp-olgami/olgami/gcp/latest/submodules/firewall-rule) - Deploys firewall rules on GCP VPCs. |
| 112 | +* [`internal-load-balancer`](https://registry.terraform.io/modules/chkp-olgami/olgami/gcp/latest/submodules/internal-load-balancer) - Deploys internal load balanncer. |
| 113 | +* [`network-and-subnet`](https://registry.terraform.io/modules/chkp-olgami/olgami/gcp/latest/submodules/network-and-subnet) - Deploys VPC and subnetwork in the VPC. |
| 114 | +* [`network-security-integration-common`](https://registry.terraform.io/modules/chkp-olgami/olgami/gcp/latest/submodules/network-security-integration-common) - Deploys Network Security Integration. |
| 115 | +
|
| 116 | +
|
| 117 | +*** |
| 118 | +
|
| 119 | +# Best Practices for Using CloudGuard Modules |
| 120 | +
|
| 121 | +## Step 1: Use the Required Module |
| 122 | +Add the required module in your Terraform configuration file (`main.tf`) to deploy resources. For example: |
| 123 | +
|
| 124 | +```hcl |
| 125 | +provider "google" { |
| 126 | + features {} |
| 127 | +} |
| 128 | +
|
| 129 | +module "example_module" { |
| 130 | + source = "CheckPointSW/cloudguard-network-security/gcp//modules/{module_name}" |
| 131 | + version = "{chosen_version}" |
| 132 | + # Add the required inputs |
| 133 | +} |
| 134 | +``` |
| 135 | +--- |
| 136 | + |
| 137 | +## Step 2: Deploy with Terraform |
| 138 | +Use Terraform commands to deploy resources securely. |
| 139 | + |
| 140 | +### Initialize Terraform |
| 141 | +Prepare the working directory and download required provider plugins: |
| 142 | +```hcl |
| 143 | +terraform init |
| 144 | +``` |
| 145 | + |
| 146 | +### Plan Deployment |
| 147 | +Preview the changes Terraform will make: |
| 148 | +```hcl |
| 149 | +terraform plan |
| 150 | +``` |
| 151 | +### Apply Deployment |
| 152 | +Apply the planned changes and deploy the resources: |
| 153 | +```hcl |
| 154 | +terraform apply |
| 155 | +``` |
0 commit comments