-
Notifications
You must be signed in to change notification settings - Fork 910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default Google API Alerts #2747
Closed
Closed
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ This module implements the creation and management of one GCP project including | |
- [VPC Service Controls](#vpc-service-controls) | ||
- [Project Related Outputs](#project-related-outputs) | ||
- [Managing project related configuration without creating it](#managing-project-related-configuration-without-creating-it) | ||
- [API Alerts](#api-alerts) | ||
- [Files](#files) | ||
- [Variables](#variables) | ||
- [Outputs](#outputs) | ||
|
@@ -1357,15 +1358,54 @@ module "bucket" { | |
parent = var.project_id | ||
id = "${var.prefix}-bucket" | ||
} | ||
|
||
# tftest inventory=data.yaml e2e | ||
``` | ||
|
||
## API Alerts | ||
There are events within Google Cloud that should be monitored and alerted on to ensure that you are aware of any potential security issues. | ||
These actions are typically seen in cases of security breaches, or potential security breaches, although they can be genuine actions that are not security related, but are still important to monitor. | ||
These events are typically | ||
- Owner Role Assignment/Changes | ||
- Audit Logging Configuration Changes | ||
- Custom Roles Creation/editing/deletion | ||
- VPC Network Firewall Rule Changes | ||
- VPC Network Route Changes | ||
- VPC Network Changes | ||
- Cloud Storage IAM Permission Changes | ||
- SQL Instances Configuration Changes | ||
|
||
|
||
Although you may not use the services listed above, such as SQL, it is still important to monitor these events for compliance purposes | ||
|
||
To enable these alerts by default on all projects created, it is recommended to default the variable `api_slerts` within `variables.tf` to true, along with adding a default email address. | ||
|
||
You can alternatively enable these alerts on a per-project basis by setting the variable `enable_api_alerts` to true on the module, along with the `default_api_alerts_email` variable | ||
|
||
```terraform | ||
module "project" { | ||
source = "./fabric/modules/project" | ||
billing_account = var.billing_account_id | ||
name = "project" | ||
parent = var.folder_id | ||
prefix = var.prefix | ||
services = [ | ||
"stackdriver.googleapis.com" | ||
] | ||
api_alerts = { | ||
enable_api_alerts = true | ||
default_api_alerts_email = "[email protected]" | ||
} | ||
} | ||
``` | ||
|
||
<!-- TFDOC OPTS files:1 --> | ||
<!-- BEGIN TFDOC --> | ||
## Files | ||
|
||
| name | description | resources | | ||
|---|---|---| | ||
| [api_metrics_alerts.tf](./api_metrics_alerts.tf) | Add API Alerts | <code>google_logging_metric</code> · <code>google_monitoring_alert_policy</code> · <code>google_monitoring_notification_channel</code> | | ||
| [cmek.tf](./cmek.tf) | Service Agent IAM Bindings for CMEK | <code>google_kms_crypto_key_iam_member</code> | | ||
| [iam.tf](./iam.tf) | IAM bindings. | <code>google_project_iam_binding</code> · <code>google_project_iam_custom_role</code> · <code>google_project_iam_member</code> | | ||
| [logging.tf](./logging.tf) | Log sinks and supporting resources. | <code>google_bigquery_dataset_iam_member</code> · <code>google_logging_project_exclusion</code> · <code>google_logging_project_sink</code> · <code>google_project_iam_audit_config</code> · <code>google_project_iam_member</code> · <code>google_pubsub_topic_iam_member</code> · <code>google_storage_bucket_iam_member</code> | | ||
|
@@ -1388,6 +1428,7 @@ module "bucket" { | |
| name | description | type | required | default | | ||
|---|---|:---:|:---:|:---:| | ||
| [name](variables.tf#L165) | Project name and id suffix. | <code>string</code> | ✓ | | | ||
| [api_alerts](variables.tf#L318) | Enable default API alerts for the project, when API alerts are required for compliance reasons | <code title="object({ enabled = optional(bool, false) email = optional(string, null) })">object({…})</code> | | <code>{}</code> | | ||
| [auto_create_network](variables.tf#L17) | Whether to create the default network for the project. | <code>bool</code> | | <code>false</code> | | ||
| [billing_account](variables.tf#L23) | Billing account id. | <code>string</code> | | <code>null</code> | | ||
| [compute_metadata](variables.tf#L29) | Optional compute metadata key/values. Only usable if compute API has been enabled. | <code>map(string)</code> | | <code>{}</code> | | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
api_slerts