Skip to content

Commit c36bb00

Browse files
Deprecate cloud-bench (#155)
* Deprecate cloud-bench * Add sunset notice * Fix terraform_docs
1 parent bd56fe9 commit c36bb00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+21
-1077
lines changed

.terraform-registry

-3
This file was deleted.

CODEOWNERS

-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
11
* @sysdiglabs/cloud-native
2-
3-
# compliance
4-
/modules/services/cloud-bench/ @haresh-suresh @nkraemer-sysdig @sysdiglabs/cloud-native

CONTRIBUTE.md

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
- Use **conventional commits** | https://www.conventionalcommits.org/en/v1.0.0
44
- Current suggested **scopes** to be used within feat(scope), fix(scope), ...
55
- threat
6-
- bench
76
- scan
87
- docs
98
- tests

README.md

+9-127
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,19 @@
1-
# Sysdig Secure for Cloud in GCP
1+
# Sunset Notice
22

3-
Terraform module that deploys the [**Sysdig Secure for Cloud** stack in **Google Cloud**](https://docs.sysdig.com/en/docs/installation/sysdig-secure-for-cloud/deploy-sysdig-secure-for-cloud-on-gcp/).
4-
<br/>
5-
6-
Provides unified threat-detection, compliance, forensics and analysis through these major components:
7-
8-
9-
* **[Threat Detection](https://docs.sysdig.com/en/docs/sysdig-secure/insights/)**: Tracks abnormal and suspicious activities in your cloud environment based on Falco language. Managed through `cloud-connector` module. <br/>
10-
11-
* **[Compliance](https://docs.sysdig.com/en/docs/sysdig-secure/posture/compliance/compliance-unified-/)**: Enables the evaluation of standard compliance frameworks. Requires both modules `cloud-connector` and `cloud-bench`. <br/>
12-
13-
* **[Image Scanning](https://docs.sysdig.com/en/docs/sysdig-secure/scanning/)**: Automatically scans all container images pushed to the registry (GCR) and the images that run on the GCP workload (currently CloudRun). Managed through `cloud-connector`. <br/>Disabled by Default, can be enabled through `deploy_scanning` input variable parameters.<br/>
14-
15-
For other Cloud providers check: [AWS](https://github.com/sysdiglabs/terraform-aws-secure-for-cloud), [Azure](https://github.com/sysdiglabs/terraform-azurerm-secure-for-cloud)
16-
17-
<br/>
3+
> [!CAUTION]
4+
> Sysdig released a new onboarding experience for GCP in November 2024. We recommend connecting your cloud accounts by [following these instructions](https://docs.sysdig.com/en/docs/sysdig-secure/connect-cloud-accounts/).
5+
>
6+
> This repository should be used solely in cases where Agentless Threat Detection cannot be used.
187
198
## Usage
209

2110
There are several ways to deploy Secure for Cloud in you GCP infrastructure,
2211

23-
- **[`/examples`](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples)** for the most common scenarios
24-
- [Single Project](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples/single-project/)
25-
- [Single Project with a pre-existing Kubernetes Cluster](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples/single-project-k8s/README.md)
26-
- [Organizational](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples/organization/README.md)
27-
- Many module,examples and use-cases, we provide ways to **re-use existing resources (as optionals)** in your
28-
infrastructure. Check input summary on each example/module.
29-
- **[`/use-cases`](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/use-cases)** with self-baked customer-specific alternative scenarios.
30-
31-
Find specific overall service arquitecture diagrams attached to each example/use-case.
12+
- [Single Project](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples/single-project/)
13+
- [Single Project with a pre-existing Kubernetes Cluster](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples/single-project-k8s/README.md)
14+
- [Organizational](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/tree/master/examples/organization/README.md)
3215

33-
In the long-term our purpose is to evaluate those use-cases and if they're common enough, convert them into examples to make their usage easier.
34-
35-
If you're unsure about what/how to use this module, please fill the [questionnaire](https://github.com/sysdiglabs/terraform-aws-secure-for-cloud/blob/master/use-cases/_questionnaire.md) report as an issue and let us know your context, we will be happy to help.
36-
37-
38-
### Notice
39-
* [GCP regions](https://cloud.google.com/compute/docs/regions-zones/#available)
40-
* Do not confuse required `region` with GCP location or zone. [Identifying a region or zone](https://cloud.google.com/compute/docs/regions-zones/#identifying_a_region_or_zone)
41-
* All Sysdig Secure for Cloud features but [Image Scanning](https://docs.sysdig.com/en/docs/sysdig-secure/scanning/) are enabled by default. You can enable it through `deploy_scanning` input variable parameter of each example.<br/>
42-
* For **free subscription** users, beware that organizational examples may not deploy properly due to the [1 cloud-account limitation](https://docs.sysdig.com/en/docs/administration/administration-settings/subscription/#cloud-billing-free-tier). Open an Issue so we can help you here!
43-
* This example will create resources that **cost money**. Run `terraform destroy` when you don't need them anymore.
44-
* For a normal load, it should be <150$/month aprox.
45-
* [Cloud Logging API](https://cloud.google.com/service-usage/docs/enabled-service#default) is activated by default so no extra cost here
46-
* Cloud Run instance comes as the most expensive service. Default [cpu/memory specs](https://github.com/sysdiglabs/terraform-google-secure-for-cloud/blob/master/modules/services/cloud-connector/variables.tf#L73-L83), for an ingestion of 35KK events/hour, for 2 instances 24x7 usage
47-
* Cloud Run ingests events from a pub/sub topic, with no retention. It's cost is quite descpreciable, but you can check with the calculator based on the events of the Log Explorer console and 4KB of size per event aprox.<br/>Beware that the logs we consume are scoped to the projects, and we exclude kubernetes events `logName=~"^projects/SCOPED_PROJECT_OR_ORG/logs/cloudaudit.googleapis.com"`
48-
<br/>
16+
If you're unsure about how to use this module, please contact your Sysdig representative. Our experts will guide you through the process and assist you in setting up your account securely and correctly.
4917

5018
## Prerequisites
5119

@@ -84,16 +52,6 @@ Besides, the following GCP **APIs must be enabled** ([how do I check it?](#q-how
8452
* [Cloud Build API](https://console.cloud.google.com/marketplace/product/google/cloudbuild.googleapis.com)
8553
* [Identity and access management API](https://console.cloud.google.com/marketplace/product/google/iam.googleapis.com)
8654

87-
##### Cloud Benchmarks
88-
* [Identity and access management API](https://console.cloud.google.com/marketplace/product/google/iam.googleapis.com)
89-
* [IAM Service Account Credentials API](https://console.cloud.google.com/marketplace/product/google/iamcredentials.googleapis.com)
90-
* [Cloud Resource Manager API](https://console.cloud.google.com/marketplace/product/google/cloudresourcemanager.googleapis.com)
91-
* [Security Token Service API](https://console.cloud.google.com/marketplace/product/google/sts.googleapis.com)
92-
* [Cloud Asset API](https://console.cloud.google.com/marketplace/product/google/cloudasset.googleapis.com)
93-
94-
95-
<br/>
96-
9755
## Confirm the Services are Working
9856

9957
Check official documentation on [Secure for cloud - GCP, Confirm the Services are working](https://docs.sysdig.com/en/docs/installation/sysdig-secure-for-cloud/deploy-sysdig-secure-for-cloud-on-gcp/#confirm-the-services-are-working)
@@ -128,8 +86,6 @@ It may take some time, but you should see logs detecting the new image in the `c
12886
12987
And a CloudBuild being launched successfully.
13088
131-
<br/>
132-
13389
## Troubleshooting
13490
13591
### Q: Module does not find project ID
@@ -155,29 +111,6 @@ output "me" {
155111
}
156112
```
157113
158-
### Q: In organizaitonal setup, Compliance trust-relationship is not being deployed on our projects
159-
160-
As for 2023 April, organizations with projects under organizational unit folders, is supported with the
161-
[organizational compliance example](./examples/organization-org_compliance)
162-
163-
<br/>S: If you want to target specific projects, you can still use the `benchmark_project_ids` parameter so you can define
164-
the projects where compliance role is to be deployed explicitly.
165-
<br/>You can use the [fetch-gcp-rojects.sh](./resources/fetch-gcp-projects.sh) utility to list organization member projects
166-
<br/>Let us know if this workaround won't be enough, and we will work on implementing a solution.
167-
168-
### Q: Compliance is not working. How can I check everything is properly setup
169-
170-
A: On your GCP infrastructure, per-project where Comliance has been setup, check following points<br/>
171-
1. there is a Workload Identity Pool and associated Workload Identity Pool Provider configured, which must have an ID of `sysdigcloud` (display name doesn't matter)
172-
2. the pool should have a connected service account with the name `sfcsysdigcloudbench`, with the email `sfcsysdigcloudbench@PROJECTID.iam.gserviceaccount.com`
173-
3. this serviceaccount should allow access to the following format `principalset: principalSet://iam.googleapis.com/projects/<PROJECTID>/locations/global/workloadIdentityPools/sysdigcloud/attribute.aws_role/arn:aws:sts::***:assumed-role/***`
174-
4. the serviceaccount should have the `viewer role` on the target project, as well as a custom role containing the "storage.buckets.getIamPolicy", "bigquery.tables.list", "cloudasset.assets.listIamPolicy" and "cloudasset.assets.listResource" permissions
175-
5. the pool provider should allow access to Sysdig's trusted identity, retrieved through
176-
```
177-
$ curl https://<SYSDIG_SECURE_URL>/api/cloud/v2/gcp/trustedIdentity \
178-
--header 'Authorization: Bearer <SYSDIG_SECURE_API_TOKEN>'
179-
```
180-
181114
### Q: Getting "Error creating Service: googleapi: got HTTP response code 404" "The requested URL /serving.knative.dev/v1/namespaces/***/services was not found on this server"
182115
183116
```
@@ -193,57 +126,6 @@ A: This error is given by the Terraform GCP provider when an invalid region is u
193126
### Q: Error because it cannot resolve the address below, "https://-run.googleapis.com/apis/serving.knative.dev"
194127
A: GCP region was not provided in the provider block
195128
196-
### Q: Why do we need `google-beta` provider?
197-
198-
A: Some resources we use, such as the [`google_iam_workload_identity_pool_provider`](https://registry.terraform.io/providers/hashicorp/google/latest/docs/resources/iam_workload_identity_pool_provider) are only available in the beta version.<br/>
199-
200-
### Q: Getting "Error creating WorkloadIdentityPool: googleapi: Error 409: Requested entity already exists"<br/>
201-
A: Currently Sysdig Backend does not support dynamic WorkloadPool and it's name is fixed to `sysdigcloud`.
202-
<br/>Moreover, Google, only performs a soft-deletion of this resource.
203-
https://cloud.google.com/iam/docs/manage-workload-identity-pools-providers#delete-pool
204-
> You can undelete a pool for up to 30 days after deletion. After 30 days, deletion is permanent. Until a pool is permanently deleted, you cannot reuse its name when creating a new workload identity pool.<br/>
205-
206-
<br/>S: For the moment, federation workload identity pool+provider have fixed name.
207-
Therea are several options here
208-
209-
- For single-account, in case you want to reuse it, you can make use of the `reuse_workload_identity_pool` attribute available in some
210-
examples.
211-
- For organizational setups, you can make use of a single workload-identity for all the organization, with the [/organization-org_compliance](./examples/organization-org_compliance)
212-
- Alternatively, you can reactivate and import it, into your terraform state manually.
213-
```bash
214-
# re-activate pool and provider
215-
$ gcloud iam workload-identity-pools undelete sysdigcloud --location=global
216-
$ gcloud iam workload-identity-pools providers undelete sysdigcloud --workload-identity-pool="sysdigcloud" --location=global
217-
218-
# import to terraform state
219-
# for this you have to adapt the import resource to your specific usage
220-
# ex.: for single-project, input your project-id
221-
$ terraform import 'module.secure-for-cloud_example_single-project.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool.pool' <PROJECT_ID>/sysdigcloud
222-
$ terraform import 'module.secure-for-cloud_example_single-project.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool_provider.pool_provider' <PROJECT_ID>/sysdigcloud/sysdigcloud
223-
224-
# ex.: for organization example you should change its reference too, per project
225-
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool.pool' <PROJECT_ID>/sysdigcloud
226-
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["<PROJECT_ID>"].google_iam_workload_identity_pool_provider.pool_provider' <PROJECT_ID>/sysdigcloud/sysdigcloud
227-
```
228-
229-
The import resource to use, is the one pointed out in your terraform plan/apply error messsage
230-
```
231-
-- for
232-
Error: Error creating WorkloadIdentityPool: googleapi: Error 409: Requested entity already exists
233-
with module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool,
234-
on .... in resource "google_iam_workload_identity_pool" "pool":
235-
resource "google_iam_workload_identity_pool" "pool" {
236-
237-
-- use
238-
' module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool' as your import resource
239-
240-
-- such as
241-
$ terraform import 'module.secure-for-cloud_example_organization.module.cloud_bench[0].module.trust_relationship["org-child-project-1"].google_iam_workload_identity_pool.pool' 'org-child-project-1/sysdigcloud'
242-
243-
```
244-
245-
Note: if you're using terragrunt, run `terragrunt import`
246-
247129
### Q: Getting "Error creating Topic: googleapi: Error 409: Resource already exists in the project (resource=gcr)"
248130
```text
249131
│ Error: Error creating Topic: googleapi: Error 409: Resource already exists in the project (resource=gcr).

0 commit comments

Comments
 (0)