Collect Forseti Open Source logs
This document explains how to ingest Forseti Open Source logs to Google Security Operations using Google Cloud Storage V2.
Forseti Security is a community-driven collection of open-source tools designed to improve the security of Google Cloud Platform environments. Forseti take inventory snapshots of GCP resources, scans for access control compliance, and provides visibility into Cloud IAM policies.
Before you begin
Make sure that you have the following prerequisites:
- A Google SecOps instance.
- A GCP project with the Cloud Storage API enabled.
- Permissions to create and manage GCS buckets and IAM policies.
- An existing Forseti Security deployment.
- Access to the Forseti server configuration file (
forseti_conf_server.yaml).
Create Google Cloud Storage bucket
Using Google Cloud Console
- Go to the Google Cloud Console.
- Select your project or create a new one.
- In the navigation menu, go to Cloud Storage > Buckets.
- Click Create bucket.
Provide the following configuration details:
Setting Value Name your bucket Enter a globally unique name (e.g., forseti-violations-export)Location type Choose based on your needs (Region, Dual-region, Multi-region) Location Select the location (e.g., us-central1)Storage class Standard (recommended for frequently accessed logs) Access control Uniform (recommended) Protection tools Optional: Enable object versioning or retention policy Click Create.
Using gcloud command-line tool
Alternatively, create a bucket using the
gcloudcommand:gcloud storage buckets create gs://forseti-violations-export \ --location=us-central1 \ --default-storage-class=STANDARDReplace
forseti-violations-exportwith your required globally unique bucket name.Replace
us-central1with your preferred region.
Configure Forseti Security to export violations to GCS
Forseti Security uses a notifier configuration in the forseti_conf_server.yaml file to export scanner violations to GCS.
- Connect to your Forseti server VM using SSH:
bash gcloud compute ssh forseti-server-vm --project=YOUR_PROJECT_ID --zone=YOUR_ZONE - Open the configuration file for editing:
bash sudo nano /home/ubuntu/forseti-security/configs/forseti_conf_server.yamlIf using GCS-based configuration, download it first:bash gsutil cp gs://YOUR_FORSETI_SERVER_BUCKET/configs/forseti_conf_server.yaml ~/forseti_conf_server.yaml - Navigate to the
notifiersection and locate theresourcessubsection. For each violation resource type you want to export, configure the
gcs_violationsnotifier:notifier: resources: - resource: iam_policy_violations should_notify: true notifiers: - name: gcs_violations configuration: data_format: csv gcs_path: gs://forseti-violations-export/violations/ - resource: firewall_rule_violations should_notify: true notifiers: - name: gcs_violations configuration: data_format: csv gcs_path: gs://forseti-violations-export/violations/ - resource: cloudsql_acl_violations should_notify: true notifiers: - name: gcs_violations configuration: data_format: csv gcs_path: gs://forseti-violations-export/violations/ - resource: bucket_acl_violations should_notify: true notifiers: - name: gcs_violations configuration: data_format: csv gcs_path: gs://forseti-violations-export/violations/ - resource: config_validator_violations should_notify: true notifiers: - name: gcs_violations configuration: data_format: csv gcs_path: gs://forseti-violations-export/violations/Key Parameters:
resource: The violation type (e.g.,iam_policy_violations).data_format: Set tocsvorjson.gcs_path: The Cloud Storage path (must include a trailing slash).
Save the file and, if necessary, upload it back to GCS.
Reload the configuration:
bash forseti server configuration reloadVerify:
bash forseti server configuration get | grep gcs_violations
Retrieve the Google SecOps service account
Configure a feed in Google SecOps
- Go to SIEM Settings > Feeds.
- Click Add New Feed and select Configure a single feed.
- Feed name: Enter a name (e.g.,
Forseti Violations). - Source type: Select Google Cloud Storage V2.
- Log type: Select Forseti Open Source.
- Click Get Service Account.
- Copy the unique service account email (e.g.,
chronicle-12345678@chronicle-gcp-prod.iam.gserviceaccount.com). - Click Next.
- Specify input parameters:
- Storage bucket URL:
gs://forseti-violations-export/violations/ - Source deletion option: Select according to your preference (e.g., Never for testing).
- Storage bucket URL:
- Click Next, review the configuration, and click Submit.
Grant IAM permissions to the Google SecOps service account
Using Google Cloud Console
- Go to Cloud Storage > Buckets.
- Click your bucket name and go to the Permissions tab.
- Click Grant access.
- Add principals: Paste the Google SecOps service account email.
- Assign roles: Select Storage Object Viewer. (Use Storage Object Admin if you selected a deletion option in the feed).
- Click Save.
Using gcloud command-line tool
gcloud storage buckets add-iam-policy-binding gs://forseti-violations-export \ --member="serviceAccount:CHRONICLE_SERVICE_ACCOUNT_EMAIL" \ --role="roles/storage.objectViewer"
UDM mapping table
| Log Field | UDM Mapping | Logic |
|---|---|---|
data.resource_data.instanceGroupUrls |
about |
Merged from array of instanceGroupUrls. |
data.resource_data.nodePools.*.statusMessage |
metadata.description |
Value from nodePool.statusMessage. |
data.resource_type |
metadata.event_type |
Specific types for KMS/FW; else GENERIC_EVENT. |
data.scanner_index_id |
metadata.product_log_id |
Value copied directly as string. |
| N/A | metadata.product_name |
Set to FORSETI SECURITY. |
| N/A | metadata.vendor_name |
Set to FORSETI. |
data.resource_data.direction |
network.direction |
Set to INBOUND if direction is INGRESS. |
data.resource_data.endpoint |
principal.ip |
Value copied directly. |
data.full_name, serviceAccount |
principal.user.userid |
Extracted from full_name or serviceAccount. |
data.violation_type |
security_result.category |
Mapped to POLICY_VIOLATION or ACL_VIOLATION. |
data.rule_name |
security_result.rule_name |
Value copied directly. |
data.full_name |
target.asset.attribute.cloud.project.id |
Extracted from full_name using grok. |
data.resource_type |
target.resource.resource_type |
Mapped to specific type based on resource_type. |
Need more help? Get answers from Community members and Google SecOps professionals.