Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.

Commit

Permalink
Updates for patch release 5.0.3 (#600)
Browse files Browse the repository at this point in the history
* Fix lint.

* Standard changes for release 2.23.3. Added cloudbuild config for release. Fix gcp tests.
  • Loading branch information
gkowalski-google authored Aug 1, 2020
1 parent 1d5c820 commit 3f8a478
Show file tree
Hide file tree
Showing 17 changed files with 89 additions and 51 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ A Google Cloud Shell Walkthrough has been setup to make it easy for users who ar

If you are familiar with Terraform and would like to run Terraform from a different machine, you can skip this walkthrough and move onto the [How to Deploy](#how-to-deploy) section.

[![Open in Google Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease502&cloudshell_working_dir=examples/install_simple&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)
[![Open in Google Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease503&cloudshell_working_dir=examples/install_simple&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)

## How to Deploy
In order to run this module you will need to be authenticated as a user that has access to the project and can create/authorize service accounts at both the organization and project levels. To login to GCP from a shell:
Expand All @@ -20,7 +20,7 @@ gcloud auth login
The repository has several helper scripts that can be used with the deployment process.

```bash
git clone --branch modulerelease502 --depth 1 https://github.com/forseti-security/terraform-google-forseti.git
git clone --branch modulerelease503 --depth 1 https://github.com/forseti-security/terraform-google-forseti.git
```

### Install Terraform
Expand Down Expand Up @@ -238,7 +238,7 @@ For this module to work, you need the following APIs enabled on the Forseti proj
| forseti\_home | Forseti installation directory | string | `"$USER_HOME/forseti-security"` | no |
| forseti\_repo\_url | Git repo for the Forseti installation | string | `"https://github.com/forseti-security/forseti-security"` | no |
| forseti\_run\_frequency | Schedule of running the Forseti scans | string | `"null"` | no |
| forseti\_version | The version of Forseti to install | string | `"v2.23.2"` | no |
| forseti\_version | The version of Forseti to install | string | `"v2.23.3"` | no |
| forwarding\_rule\_enabled | Forwarding rule scanner enabled. | bool | `"false"` | no |
| forwarding\_rule\_violations\_should\_notify | Notify for forwarding rule violations | bool | `"true"` | no |
| group\_enabled | Group scanner enabled. | bool | `"true"` | no |
Expand Down
44 changes: 44 additions & 0 deletions build/int-release.cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

timeout: 7200s
steps:
- id: prepare
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && prepare_environment']
env:
- 'TF_VAR_org_id=$_ORG_ID'
- 'TF_VAR_folder_id=$_FOLDER_ID'
- 'TF_VAR_billing_account=$_BILLING_ACCOUNT'
- id: create
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do create']
- id: converge
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do converge']
env:
- 'TF_VAR_forseti_version=$_FORSETI_VERSION'
- id: verify
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do verify']
- id: destroy
name: 'gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS'
args: ['/bin/bash', '-c', 'source /usr/local/bin/task_helper_functions.sh && kitchen_do destroy']
tags:
- 'ci'
- 'integration'
substitutions:
_DOCKER_IMAGE_DEVELOPER_TOOLS: 'cft/developer-tools'
_DOCKER_TAG_VERSION_DEVELOPER_TOOLS: '0.4.6'
_FORSETI_VERSION: 'v2.23.3'
4 changes: 2 additions & 2 deletions docs/upgrading_to_v5.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Following these instructions will import existing Forseti infrastructure resourc
### Migrating from the Python Installer
A Cloud Shell walkthrough is provided to assist with migrating Forseti previously deployed with the Python installer. Completing this guide will also result in a Forseti deployment upgraded to the most recent version.

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease502&cloudshell_working_dir=examples/migrate_forseti&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)
[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease503&cloudshell_working_dir=examples/migrate_forseti&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)

### Upgrading Forseti Deployed/Upgraded with Terraform
A Cloud Shell walkthrough is provided to assist with upgrading Forseti previously deployed with Terraform. Completing this guide will also result in a Forseti deployment upgraded to the most recent version.

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease502&cloudshell_working_dir=examples/upgrade_forseti_with_v5.0&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)
[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease503&cloudshell_working_dir=examples/upgrade_forseti_with_v5.0&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)
2 changes: 1 addition & 1 deletion examples/install_simple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This configuration is used to simply install Forseti. It includes a full Cloud Shell [tutorial](./tutorial.md).

[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease502&cloudshell_working_dir=examples/install_simple&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)
[![Open in Cloud Shell](https://gstatic.com/cloudssh/images/open-btn.svg)](https://console.cloud.google.com/cloudshell/open?cloudshell_git_repo=https%3A%2F%2Fgithub.com%2Fforseti-security%2Fterraform-google-forseti.git&cloudshell_git_branch=modulerelease503&cloudshell_working_dir=examples/install_simple&cloudshell_image=gcr.io%2Fgraphite-cloud-shell-images%2Fterraform%3Alatest&cloudshell_tutorial=.%2Ftutorial.md)

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs
Expand Down
6 changes: 3 additions & 3 deletions examples/migrate_forseti/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ to match the region where the Forseti Client VM is deployed.
Starting with Forseti Security 2.23, Terraform will manage your server
configuration file for you. Configuration options will now be input
variables that are defined in the Terraform module. Available variables
and their default values can be found [here](https://github.com/forseti-security/terraform-google-forseti/blob/modulerelease502/variables.tf).
and their default values can be found [here](https://github.com/forseti-security/terraform-google-forseti/blob/modulerelease503/variables.tf).
Default values will be used if values are not explicitly added.
This will ensure upgrading Forseti will be as easy as possible going forward.

Expand Down Expand Up @@ -186,10 +186,10 @@ to your <walkthrough-editor-select-regex
regex="Add any Forseti Server Configuration Variables Here">main.tf</walkthrough-editor-select-regex>.

## Obtain and Run the Import Script
This [import script](https://github.com/forseti-security/terraform-google-forseti/blob/modulerelease502/helpers/import.sh) will import the Forseti GCP resources into a local state file.
This [import script](https://github.com/forseti-security/terraform-google-forseti/blob/modulerelease503/helpers/import.sh) will import the Forseti GCP resources into a local state file.

```sh
curl --location --remote-name https://raw.githubusercontent.com/forseti-security/terraform-google-forseti/modulerelease502/helpers/import.sh
curl --location --remote-name https://raw.githubusercontent.com/forseti-security/terraform-google-forseti/modulerelease503/helpers/import.sh
chmod +x import.sh
./import.sh -h
```
Expand Down
4 changes: 2 additions & 2 deletions examples/on_gke_end_to_end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ This script will also activate necessary APIs required for Terraform to deploy F
| gsuite\_admin\_email | G-Suite administrator email address to manage your Forseti installation | string | n/a | yes |
| helm\_repository\_url | The Helm repository containing the 'forseti-security' Helm charts | string | `"https://forseti-security-charts.storage.googleapis.com/release/"` | no |
| k8s\_forseti\_namespace | The Kubernetes namespace in which to deploy Forseti. | string | `"forseti"` | no |
| k8s\_forseti\_orchestrator\_image\_tag | The tag for the container image for the Forseti orchestrator | string | `"v2.23.2"` | no |
| k8s\_forseti\_server\_image\_tag | The tag for the container image for the Forseti server | string | `"v2.23.2"` | no |
| k8s\_forseti\_orchestrator\_image\_tag | The tag for the container image for the Forseti orchestrator | string | `"v2.23.3"` | no |
| k8s\_forseti\_server\_image\_tag | The tag for the container image for the Forseti server | string | `"v2.23.3"` | no |
| k8s\_tiller\_sa\_name | The Kubernetes Service Account used by Tiller | string | `"tiller"` | no |
| network | The name of the VPC being created | string | `"forseti-gke-network"` | no |
| network\_description | An optional description of the network. The resource must be recreated to modify this field. | string | `""` | no |
Expand Down
4 changes: 2 additions & 2 deletions examples/on_gke_end_to_end/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ variable "k8s_tiller_sa_name" {

variable "k8s_forseti_orchestrator_image_tag" {
description = "The tag for the container image for the Forseti orchestrator"
default = "v2.23.2"
default = "v2.23.3"
}

variable "k8s_forseti_server_image_tag" {
description = "The tag for the container image for the Forseti server"
default = "v2.23.2"
default = "v2.23.3"
}

variable "network" {
Expand Down
4 changes: 2 additions & 2 deletions examples/upgrade_forseti_with_v5.0/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ Add the following clause to the bottom of your main.tf.

## Obtain and Run the Import Script
### Obtain the Import Script
This [import script](https://github.com/forseti-security/terraform-google-forseti/blob/modulerelease502/helpers/import.sh) will import the Forseti GCP resources into a local state file.
This [import script](https://github.com/forseti-security/terraform-google-forseti/blob/modulerelease503/helpers/import.sh) will import the Forseti GCP resources into a local state file.

```sh
curl --location --remote-name https://raw.githubusercontent.com/forseti-security/terraform-google-forseti/modulerelease502/helpers/import.sh
curl --location --remote-name https://raw.githubusercontent.com/forseti-security/terraform-google-forseti/modulerelease503/helpers/import.sh
chmod +x import.sh
./import.sh -h
```
Expand Down
2 changes: 1 addition & 1 deletion modules/client/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ variable "project_id" {

variable "forseti_version" {
description = "The version of Forseti to install"
default = "v2.23.2"
default = "v2.23.3"
}

variable "forseti_repo_url" {
Expand Down
10 changes: 5 additions & 5 deletions modules/cloudsql/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ resource "google_compute_global_address" "private_ip_address" {
purpose = "VPC_PEERING"
address_type = "INTERNAL"
prefix_length = 16
network = "${data.google_compute_network.cloudsql_private_network.self_link}"
depends_on = ["google_project_service.service_networking"]
network = data.google_compute_network.cloudsql_private_network.self_link
depends_on = [google_project_service.service_networking]
}

resource "google_service_networking_connection" "private_vpc_connection" {
count = var.cloudsql_private ? 1 : 0
network = "${data.google_compute_network.cloudsql_private_network.self_link}"
network = data.google_compute_network.cloudsql_private_network.self_link
service = "servicenetworking.googleapis.com"
reserved_peering_ranges = ["${google_compute_global_address.private_ip_address[count.index].name}"]
reserved_peering_ranges = [google_compute_global_address.private_ip_address[count.index].name]
}

#----------------------#
Expand Down Expand Up @@ -92,7 +92,7 @@ resource "google_sql_database_instance" "master" {
}
}

depends_on = [null_resource.services-dependency, "google_service_networking_connection.private_vpc_connection"]
depends_on = [null_resource.services-dependency, google_service_networking_connection.private_vpc_connection]
}

resource "google_sql_database" "forseti-db" {
Expand Down
6 changes: 3 additions & 3 deletions modules/on_gke/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This sub-module deploys Forseti on GKE. In short, this deploys a server contain
| forseti\_home | Forseti installation directory | string | `"$USER_HOME/forseti-security"` | no |
| forseti\_repo\_url | Git repo for the Forseti installation | string | `"https://github.com/forseti-security/forseti-security"` | no |
| forseti\_run\_frequency | Schedule of running the Forseti scans | string | `"null"` | no |
| forseti\_version | The version of Forseti to install | string | `"v2.23.2"` | no |
| forseti\_version | The version of Forseti to install | string | `"v2.23.3"` | no |
| forwarding\_rule\_enabled | Forwarding rule scanner enabled. | bool | `"false"` | no |
| forwarding\_rule\_violations\_should\_notify | Notify for forwarding rule violations | bool | `"true"` | no |
| git\_sync\_image | The container image used by the config-validator git-sync side-car | string | `"gcr.io/google-containers/git-sync"` | no |
Expand Down Expand Up @@ -113,9 +113,9 @@ This sub-module deploys Forseti on GKE. In short, this deploys a server contain
| k8s\_config\_validator\_image\_tag | The tag for the config-validator image. | string | `"latest"` | no |
| k8s\_forseti\_namespace | The Kubernetes namespace in which to deploy Forseti. | string | `"forseti"` | no |
| k8s\_forseti\_orchestrator\_image | The container image for the Forseti orchestrator | string | `"gcr.io/forseti-containers/forseti"` | no |
| k8s\_forseti\_orchestrator\_image\_tag | The tag for the container image for the Forseti orchestrator | string | `"v2.23.2"` | no |
| k8s\_forseti\_orchestrator\_image\_tag | The tag for the container image for the Forseti orchestrator | string | `"v2.23.3"` | no |
| k8s\_forseti\_server\_image | The container image for the Forseti server | string | `"gcr.io/forseti-containers/forseti"` | no |
| k8s\_forseti\_server\_image\_tag | The tag for the container image for the Forseti server | string | `"v2.23.2"` | no |
| k8s\_forseti\_server\_image\_tag | The tag for the container image for the Forseti server | string | `"v2.23.3"` | no |
| k8s\_forseti\_server\_ingress\_cidr | If network_policy is true, k8s_forseti_server_ingress_cidr will restrict connections to the Forseti Server service from the CIDR's specified | string | `""` | no |
| k8s\_tiller\_sa\_name | The Kubernetes Service Account used by Tiller | string | `"tiller"` | no |
| ke\_scanner\_enabled | KE scanner enabled. | bool | `"false"` | no |
Expand Down
6 changes: 3 additions & 3 deletions modules/on_gke/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ variable "gsuite_admin_email" {

variable "forseti_version" {
description = "The version of Forseti to install"
default = "v2.23.2"
default = "v2.23.3"
}

variable "forseti_repo_url" {
Expand Down Expand Up @@ -879,7 +879,7 @@ variable "k8s_forseti_orchestrator_image" {

variable "k8s_forseti_orchestrator_image_tag" {
description = "The tag for the container image for the Forseti orchestrator"
default = "v2.23.2"
default = "v2.23.3"
}

variable "k8s_forseti_server_image" {
Expand All @@ -889,7 +889,7 @@ variable "k8s_forseti_server_image" {

variable "k8s_forseti_server_image_tag" {
description = "The tag for the container image for the Forseti server"
default = "v2.23.2"
default = "v2.23.3"
}

variable "k8s_forseti_server_ingress_cidr" {
Expand Down
2 changes: 1 addition & 1 deletion modules/server/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ variable "project_id" {

variable "forseti_version" {
description = "The version of Forseti to install"
default = "v2.23.2"
default = "v2.23.3"
}

variable "forseti_repo_url" {
Expand Down
2 changes: 1 addition & 1 deletion test/integration/simple_example/controls/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
require "yaml"

forseti_server_vm_ip = attribute("forseti-server-vm-ip")
forseti_version = "2.23.2"
forseti_version = "2.23.3"

control "client" do
title "Forseti client instance resources"
Expand Down
Loading

0 comments on commit 3f8a478

Please sign in to comment.