• Stars
    star
    289
  • Rank 138,137 (Top 3 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Community Security Analytics provides a set of community-driven audit & threat queries for Google Cloud

Community Security Analytics (CSA)

Community Security Analytics Logo

As organizations go through the Autonomic Security modernization journey, this repository serves as a community-driven list of sample security analytics for auditing cloud usage and for detecting threats to your data & workloads in Google Cloud. These may assist detection engineers, threat hunters and data governance analysts.

CSA is a set of foundational security analytics designed to provide organizations with a rich baseline of pre-built queries and rules that they can readily use to start analyzing their Google Cloud logs including Cloud Audit logs, VPC Flow logs, DNS logs, and more using cloud-native or third-party analytics tools. The source code is provided as is, without warranty. See Copyright & License below.

Current release include:

The security use cases below are grouped in 6 categories depending on underlying activity type and log sources:

  1. ๐Ÿšฆ Login & Access Patterns
  2. ๐Ÿ”‘ IAM, Keys & Secrets Admin Activity
  3. ๐Ÿ—๏ธ Cloud Provisoning Activity
  4. โ˜๏ธ Cloud Workload Usage
  5. ๐Ÿ’ง Data Usage
  6. โšก Network Activity

To learn more about the variety of Google Cloud logs, how to enable and natively export these logs to destinations like Chronicle or BigQuery for in-depth analytics, refer to Google Cloud Security and access analytics solution guide.

Caution: CSA is not meant to be a comprehensive set of threat detections, but a collection of community-contributed samples to get you started with detective controls. Use CSA in your threat detection and response capabilities (e.g. Security Command Center, Chronicle, BigQuery, Siemplify, or third-party SIEM) in conjunction with threat prevention capabilities (e.g. Security Command Center, Cloud Armor, BeyondCorp). To learn more about Googleโ€™s approach to modern Security Operations, check out the Autonomic Security Operations whitepaper.

Security Analytics Use Cases

Security Monitoring

# Cloud Security Threat Log Source Audit Detect ATT&CKยฎ Techniques
1
๐Ÿšฆ Login & Access Patterns
1.01 Login from a highly-privileged account Workspace Login Audit (Cloud Identity Logs) โœ… T1078.004
1.02 Suspicious login attempt flagged by Google Workspace Workspace Login Audit (Cloud Identity Logs) โœ… T1078.004
1.03 Excessive login failures from any user identity Workspace Login Audit (Cloud Identity Logs) โœ… T1078.004, T1110
1.10 Access attempts violating VPC Service Controls Audit Logs - Policy โœ… โœ… T1078.004, T1537
1.20 Access attempts violating IAP (i.e. BeyondCorp) access controls HTTP(S) LB Logs โœ… โœ…
1.30 Cloud Console accesses Audit Logs - Data Access โœ… T1078.004
2
๐Ÿ”‘ IAM, Keys & Secrets Changes
2.02 User added to highly-privileged Google Group Workspace Admin Audit โœ… โœ… T1078.004, T1484.001
2.20 Permissions granted over a Service Account Audit Logs - Admin Activity โœ… โœ… T1484.002
2.21 Permissions granted to impersonate Service Account Audit Logs - Admin Activity โœ… โœ… T1484.002
2.22 Permissions granted to create or manage Service Account keys Audit Logs - Admin Activity โœ… โœ… T1484.002
2.30 Service accounts or keys created by non-approved identity Audit Logs - Admin Activity โœ… โœ… T1136.003
2.40 User access added (or removed) from IAP-protected HTTPS services Audit Logs - Admin Activity โœ… โœ… T1484.002
3
๐Ÿ—๏ธ Cloud Provisioning Activity
3.01 Changes made to logging settings Audit Logs - Admin Activity โœ… โœ… T1562.008
3.02 Disabling VPC Flows logging Audit Logs - Admin Activity โœ… T1562.008
3.11 Unusual number of firewall rules modified in the last 7 days Audit Logs - Admin Activity โœ… T1562.007
3.12 Firewall rules modified or deleted in the last 24 hrs Audit Logs - Admin Activity โœ… โœ… T1562.007
3.13 VPN tunnels created or deleted Audit Logs - Admin Activity โœ… โœ… T1133
3.14 DNS zones modified or deleted Audit Logs - Admin Activity โœ… โœ… T1578
3.15 Cloud Storage buckets modified or deleted by unfamiliar user identities Audit Logs - Admin Activity โœ… โœ… T1578
3.20 VMs deleted in the last 7 days Audit Logs - Admin Activity โœ… T1578
3.21 Cloud SQL databases created, modified or deleted Audit Logs - Admin Activity โœ… T1578
4
โ˜๏ธ Cloud Workload Usage
4.01 Unusually high API usage by any user identity Audit Logs โœ… โœ… T1106
4.10 Autoscaling usage in the past month Audit Logs - Admin Activity โœ… T1496
4.11 Autoscaling usage per day in the past month Audit Logs - Admin Activity โœ… T1496
4.20 Resource access by certain user identities in the past month Audit Logs โœ… T1106
4.21 Resource access by certain user identities in the past month (aggregated by day) Audit Logs โœ… T1106
5
๐Ÿ’ง Data Usage
5.01 Which users most frequently accessed data in the past week? Audit Logs - Data Access โœ… T1530
5.02 Which users accessed most amount of data in the past week? Audit Logs - Data Access โœ… T1530
5.03 How much data was accessed by each user per day in the past week? Audit Logs - Data Access โœ… T1530
5.04 Which users accessed data in a given table in the past month? Audit Logs - Data Access โœ… T1078.004
5.05 What tables are most frequently accessed and by whom? Audit Logs - Data Access โœ… T1530
5.06 Top 10 queries against BigQuery in the past week Audit Logs - Data Access โœ… T1530
5.07 Any queries doing very large scans? Audit Logs - Data Access โœ… โœ… T1530
5.08 Any destructive queries or jobs (i.e. update or delete)? Audit Logs โœ… โœ… T1565.001
5.10 Recent data read with granular access and permissions details Audit Logs - Data Access โœ… T1074, T1213
5.11 Recent dataset activity with granular permissions details Audit Logs - Admin Activity โœ… T1074, T1213
5.20 Most common data (and metadata) access actions in the past month Audit Logs - Data Access โœ… โœ… T1530
5.30 Cloud Storage buckets enumerated by unfamiliar user identities Audit Logs - Data Access โœ… โœ… T1530
5.31 Cloud Storage objects accessed from a new IP Audit Logs - Data Access โœ… โœ… T1530
6
โšก Network Activity
6.01 Hosts reaching out to many other hosts or ports per hour VPC Flow Logs โœ… โœ… T1046
6.10 Connections from a new IP to an in-scope network VPC Flow Logs โœ… โœ… T1018
6.15 List all IP addresses with any associated entities VPC Flow Logs โœ… T1018, T1046
6.20 Connections blocked by Cloud Armor HTTP(S) LB Logs โœ… โœ… T1071
6.21 Log4j 2 vulnerability exploit attempts HTTP(S) LB Logs โœ… T1190
6.22 Any remote IP addresses attemting to exploit Log4j 2 vulnerability? HTTP(S) LB Logs โœ… T1190
6.23 Spring4Shell vulnerability exploit attempts (CVE-2022-22965) HTTP(S) LB Logs โœ… T1190
6.30 Virus or malware detected by Cloud IDS Cloud IDS Threat Logs โœ… T1059
6.31 Traffic sessions of high severity threats detected by Cloud IDS Cloud IDS Threat Logs, Cloud IDS Traffic Logs โœ… T1071
6.40 Top 10 DNS queried domains Cloud DNS Logs โœ… โœ… T1071.004

Dataform for CSA on BigQuery

The dataform folder contains the Dataform repo to automate deployment of CSA queries in BigQuery for optimized performance and cost. Use this Dataform repo to operationalize CSA use cases as reports and alerts powered by BigQuery. This Dataform project deploys and orchestrates pre-built ELT pipelines to filter, normalize and model log data leveraging incremental summary tables, lookup tables and views for fast, cost-effective and simpler querying. See underlying README for more details.

CI/CD for CSA on Chronicle

The cicd folder contains a set of scripts to help you with storing CSA YARA-L detection rules as code and testing/deploying updates you and your team make in an automated fashion. Whether you use GitHub Actions, Google Cloud Build or Azure DevOps, you can use the corresponding scripts to automatically test and deploy new or modified rules into your Chronicle instance. See underlying README for more details.

Support

This is not an officially supported Google product. Queries, rules and other assets in Community Security Analytics (CSA) are community-supported. Please don't hesitate to open a GitHub issue if you have any question or a feature request.

Contributions are also welcome via Github pull requests if you have fixes or enhancements to source code or docs. Please refer to our Contributing guidelines.

Copyright & License

Copyright 2022 Google LLC

Queries, rules and other assets under Community Security Analytics (CSA) are licensed under the Apache license, v2.0. Details can be found in LICENSE file.

More Repositories

1

microservices-demo

Sample cloud-first application with 10 microservices showcasing Kubernetes, Istio, and gRPC.
Go
15,783
star
2

terraformer

CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code
Go
11,610
star
3

training-data-analyst

Labs and demos for courses for GCP Training (http://cloud.google.com/training).
Jupyter Notebook
7,479
star
4

python-docs-samples

Code samples used on cloud.google.com
Jupyter Notebook
6,985
star
5

generative-ai

Sample code and notebooks for Generative AI on Google Cloud
Jupyter Notebook
5,282
star
6

golang-samples

Sample apps and code written for Google Cloud in the Go programming language.
Go
4,136
star
7

nodejs-docs-samples

Node.js samples for Google Cloud Platform products.
JavaScript
2,762
star
8

tensorflow-without-a-phd

A crash course in six episodes for software developers who want to become machine learning practitioners.
Jupyter Notebook
2,735
star
9

professional-services

Common solutions and tools developed by Google Cloud's Professional Services team. This repository and its contents are not an officially supported Google product.
Python
2,730
star
10

gcsfuse

A user-space file system for interacting with Google Cloud Storage
Go
1,977
star
11

community

Java
1,908
star
12

PerfKitBenchmarker

PerfKit Benchmarker (PKB) contains a set of benchmarks to measure and compare cloud offerings. The benchmarks use default settings to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.
Python
1,855
star
13

java-docs-samples

Java and Kotlin Code samples used on cloud.google.com
Java
1,610
star
14

ml-design-patterns

Source code accompanying O'Reilly book: Machine Learning Design Patterns
Jupyter Notebook
1,600
star
15

continuous-deployment-on-kubernetes

Get up and running with Jenkins on Google Kubernetes Engine
Shell
1,582
star
16

cloudml-samples

Cloud ML Engine repo. Please visit the new Vertex AI samples repo at https://github.com/GoogleCloudPlatform/vertex-ai-samples
Python
1,507
star
17

asl-ml-immersion

This repos contains notebooks for the Advanced Solutions Lab: ML Immersion
Jupyter Notebook
1,469
star
18

localllm

Python
1,449
star
19

cloud-builders

Builder images and examples commonly used for Google Cloud Build
Go
1,354
star
20

cloud-foundation-fabric

End-to-end modular samples and landing zones toolkit for Terraform on GCP.
HCL
1,343
star
21

vertex-ai-samples

Sample code and notebooks for Vertex AI, the end-to-end machine learning platform on Google Cloud
Jupyter Notebook
1,331
star
22

cloud-builders-community

Community-contributed images for Google Cloud Build
Go
1,233
star
23

data-science-on-gcp

Source code accompanying book: Data Science on the Google Cloud Platform, Valliappa Lakshmanan, O'Reilly 2017
Jupyter Notebook
1,230
star
24

berglas

A tool for managing secrets on Google Cloud
Go
1,223
star
25

cloud-sql-proxy

A utility for connecting securely to your Cloud SQL instances
Go
1,218
star
26

kubernetes-engine-samples

Sample applications for Google Kubernetes Engine (GKE)
HCL
1,178
star
27

functions-framework-nodejs

FaaS (Function as a service) framework for writing portable Node.js functions
TypeScript
1,162
star
28

cloud-vision

Sample code for Google Cloud Vision
Python
1,093
star
29

DataflowTemplates

Cloud Dataflow Google-provided templates for solving in-Cloud data tasks
Java
1,078
star
30

bigquery-utils

Useful scripts, udfs, views, and other utilities for migration and data warehouse operations in BigQuery.
Java
1,030
star
31

php-docs-samples

A collection of samples that demonstrate how to call Google Cloud services from PHP.
PHP
944
star
32

buildpacks

Builders and buildpacks designed to run on Google Cloud's container platforms
Go
937
star
33

deploymentmanager-samples

Deployment Manager samples and templates.
Jinja
928
star
34

bank-of-anthos

Retail banking sample application showcasing Kubernetes and Google Cloud
Java
926
star
35

cloud-foundation-toolkit

The Cloud Foundation toolkit provides GCP best practices as code.
Go
916
star
36

flask-talisman

HTTP security headers for Flask
Python
896
star
37

DataflowJavaSDK

Google Cloud Dataflow provides a simple, powerful model for building both batch and streaming parallel data processing pipelines.
857
star
38

gsutil

A command line tool for interacting with cloud storage services.
Python
857
star
39

k8s-config-connector

GCP Config Connector, a Kubernetes add-on for managing GCP resources
Go
826
star
40

nodejs-getting-started

A tutorial for creating a complete application using Node.js on Google Cloud Platform
JavaScript
800
star
41

keras-idiomatic-programmer

Books, Presentations, Workshops, Notebook Labs, and Model Zoo for Software Engineers and Data Scientists wanting to learn the TF.Keras Machine Learning framework
Jupyter Notebook
797
star
42

gcr-cleaner

Delete untagged image refs in Google Container Registry or Artifact Registry
Go
795
star
43

metacontroller

Lightweight Kubernetes controllers as a service
Go
790
star
44

getting-started-python

Code samples for using Python on Google Cloud Platform
Python
756
star
45

magic-modules

Add Google Cloud Platform support to Terraform
HTML
753
star
46

awesome-google-cloud

A curated list of awesome stuff for Google Cloud.
742
star
47

mlops-on-gcp

Jupyter Notebook
728
star
48

dotnet-docs-samples

.NET code samples used on https://cloud.google.com
C#
719
star
49

click-to-deploy

Source for Google Click to Deploy solutions listed on Google Cloud Marketplace.
Ruby
709
star
50

cloud-sdk-docker

Google Cloud CLI Docker Image - Docker Image containing the gcloud CLI and its bundled components.
Dockerfile
697
star
51

iap-desktop

IAP Desktop is a Windows application that provides zero-trust Remote Desktop and SSH access to Linux and Windows VMs on Google Cloud.
C#
687
star
52

tf-estimator-tutorials

This repository includes tutorials on how to use the TensorFlow estimator APIs to perform various ML tasks, in a systematic and standardised way
Jupyter Notebook
671
star
53

functions-framework-python

FaaS (Function as a service) framework for writing portable Python functions
Python
670
star
54

flink-on-k8s-operator

[DEPRECATED] Kubernetes operator for managing the lifecycle of Apache Flink and Beam applications.
Go
659
star
55

terraform-google-examples

Collection of examples for using Terraform with Google Cloud Platform.
HCL
573
star
56

functions-framework-dart

FaaS (Function as a service) framework for writing portable Dart functions
Dart
531
star
57

cloud-run-button

Let anyone deploy your GitHub repos to Google Cloud Run with a single click
Go
520
star
58

govanityurls

Use a custom domain in your Go import path
Go
513
star
59

bigquery-oreilly-book

Source code accompanying: BigQuery: The Definitive Guide by Lakshmanan & Tigani to be published by O'Reilly Media
Jupyter Notebook
499
star
60

getting-started-java

Java
478
star
61

ml-on-gcp

Machine Learning on Google Cloud Platform
Python
476
star
62

ipython-soccer-predictions

Sample iPython notebook with soccer predictions
Jupyter Notebook
473
star
63

covid-19-open-data

Datasets of daily time-series data related to COVID-19 for over 20,000 distinct locations around the world.
Python
470
star
64

ai-platform-samples

Official Repo for Google Cloud AI Platform. Find samples for Vertex AI, Google Cloud's new unified ML platform at: https://github.com/GoogleCloudPlatform/vertex-ai-samples
Jupyter Notebook
453
star
65

practical-ml-vision-book

Jupyter Notebook
441
star
66

gradle-appengine-templates

Freemarker based templates that build with the gradle-appengine-plugin
439
star
67

distributed-load-testing-using-kubernetes

Distributed load testing using Kubernetes on Google Container Engine
Smarty
438
star
68

terraform-validator

Terraform Validator is not an officially supported Google product; it is a library for conversion of Terraform plan data to CAI Assets. If you have been using terraform-validator directly in the past, we recommend migrating to `gcloud beta terraform vet`.
Go
436
star
69

hackathon-toolkit

GCP Hackathon Toolkit
HTML
434
star
70

monitoring-dashboard-samples

TypeScript
428
star
71

nodejs-docker

The Node.js Docker image used by Google App Engine Flexible.
TypeScript
406
star
72

cloud-ops-sandbox

Cloud Operations Sandbox is an open source collection of tools that helps practitioners to learn O11y and R9y practices from Google and apply them using Cloud Operations suite of tools.
HCL
398
star
73

cloud-code-vscode

Cloud Code for Visual Studio Code: Issues, Documentation and more
392
star
74

k8s-stackdriver

Go
390
star
75

professional-services-data-validator

Utility to compare data between homogeneous or heterogeneous environments to ensure source and target tables match
Python
375
star
76

cloud-code-samples

Code templates to make working with Kubernetes feel like editing and debugging local code.
Java
374
star
77

require-so-slow

`require`s taking too much time? Profile 'em.
TypeScript
373
star
78

functions-framework-go

FaaS (Function as a service) framework for writing portable Go functions
Go
373
star
79

k8s-multicluster-ingress

kubemci: Command line tool to configure L7 load balancers using multiple kubernetes clusters
Go
372
star
80

compute-image-packages

Packages for Google Compute Engine Linux images.
Python
370
star
81

healthcare

Python
367
star
82

android-docs-samples

Java
365
star
83

stackdriver-errors-js

Client-side JavaScript exception reporting library for Cloud Error Reporting
JavaScript
358
star
84

google-cloud-iot-arduino

Google Cloud IOT Example on ESP8266
C++
340
star
85

istio-samples

Istio demos and sample applications for GCP
Shell
331
star
86

ios-docs-samples

iOS samples that demonstrate APIs and services of Google Cloud Platform.
Swift
325
star
87

mlops-with-vertex-ai

An end-to-end example of MLOps on Google Cloud using TensorFlow, TFX, and Vertex AI
Jupyter Notebook
317
star
88

cloud-code-intellij

Plugin to support the Google Cloud Platform in IntelliJ IDEA - Docs and Issues Repository
315
star
89

gcping

The source for the CLI and web app at gcping.com
Go
303
star
90

spring-cloud-gcp

New home for Spring Cloud GCP development starting with version 2.0.
Java
299
star
91

airflow-operator

Kubernetes custom controller and CRDs to managing Airflow
Go
296
star
92

elixir-samples

A collection of samples on using Elixir with Google Cloud Platform.
Elixir
289
star
93

gke-networking-recipes

Shell
286
star
94

datalab-samples

Jupyter Notebook
281
star
95

compute-archlinux-image-builder

A tool to build a Arch Linux Image for GCE
Shell
280
star
96

solutions-terraform-cloudbuild-gitops

HCL
276
star
97

kotlin-samples

Kotlin
276
star
98

gcpdiag

gcpdiag is a command-line diagnostics tool for GCP customers.
Python
268
star
99

PerfKitExplorer

PerfKit Explorer is a dashboarding and performance analysis tool built with Google technologies and easily extensible. PerfKit Explorer is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.
JavaScript
268
star
100

kube-jenkins-imager

Shell
261
star