-
Notifications
You must be signed in to change notification settings - Fork 1
Enhance GCP plugin with Cloud Logging API source and new request log table #75
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
base: refactor-gcp-log-api-audit-source
Are you sure you want to change the base?
Enhance GCP plugin with Cloud Logging API source and new request log table #75
Conversation
…afe type checking just in case
added remaining possible log fields
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.
Pull Request Overview
This pull request enhances the GCP Tailpipe plugin by adding comprehensive Cloud Armor and application load balancer log support through two major additions:
- New
cloud_logging_apisource that enables direct collection of logs from the Google Cloud Logging API - New
requests_logtable designed specifically for Cloud Armor-augmented Application Load Balancer request logs with detailed security policy analysis
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
tables/requests_log/requests_log_table.go |
Implements the main table structure with source metadata configuration and row enrichment logic |
tables/requests_log/requests_log_mapper.go |
Provides mapping logic to transform both API and bucket-based log data into the RequestsLog structure |
tables/requests_log/requests_log.go |
Defines the core data structures and schema for Cloud Armor request logs |
sources/cloud_logging_api/cloud_logging_api_source_config.go |
Configuration validation for the new Cloud Logging API source |
sources/cloud_logging_api/cloud_logging_api_source.go |
Main source implementation for collecting logs directly from GCP Cloud Logging API |
gcp/plugin.go |
Plugin registration updates to include the new table and source |
docs/tables/gcp_requests_log/index.md |
Documentation for the new requests log table with usage examples |
docs/sources/gcp_cloud_logging_api.md |
Documentation for the new Cloud Logging API source |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
Hello @recharge-jmog, Apologies for the delay in reviewing the PR — thank you for your patience! The changes you've made look great overall. That said, I have a few thoughts on the approach. Introducing a separate source specifically for one log type might not be ideal, especially since the API call logic, input parameters, and code are essentially the same. Additionally, GCP supports multiple types of request logs, such as:
Creating a separate source for each log type could lead to redundancy and make maintenance harder. I do agree, however, that the existing source name In the meantime, I’ve made a few updates:
All these changes are pushed to the branch: It would be great if you could test this out from the PR branch and share any feedback. I really appreciate your contribution and look forward to your thoughts! Config: Result: Thanks! |
|
@ParthaI I'll give this a test and let you know. Sounds good in principle! |
|
@ParthaI Ok, yeah aside from the known lack of rate limiting (future PR for me I guess, haha) on the API collection, it's working fine here. It wouldn't be that hard for someone to implement a new table based on the log formats available at https://cloud.google.com/logging/docs/api/platform-logs Do you want to handle the merging with the main branch or should I incorporate your changes into my fork and open a new PR? |
|
Hi @recharge-jmog, thank you for your feedback and for testing things out in the PR branch. We are currently working on a design that will allow us to retrieve any type of logs. As part of this, we may also need to adjust source naming, config arguments, and related aspects. However, the design is not yet finalized, and we plan to prioritize this work this week.
The changes I pushed in the branch Thanks again for your patience and understanding, and apologies for the inconvenience. 🙏 |
Not a problem @ParthaI , just wanted to make sure I was aligned with what you're doing over there. Look forward to the final results, and let me know if you need some real-world testing of the final implementation. Thanks! |
|
Hello @recharge-jmog, Just a quick update — I’ve opened a PR that renames the I’ve reverted the request_log table changes in this commit Here’s a sample configuration for reference: connection "gcp" "cred" {
project = "parker-aaa"
credentials = "/path/to/your/credential.json"
min_retry_delay = 100
max_retry_delay = 10000
backoff_multiplier = 1.2
}
partition "gcp_audit_log" "my_logs_api" {
source "gcp_logging_log_entry" {
connection = connection.gcp.cred
log_types = ["data_access", "activity", "system_event", "policy"]
}
}With these changes, I was able to successfully retrieve logs spanning the past 6 months, pulling over 300k entries without encountering any rate-limiting errors. It would be great if you could try this out locally by rebasing your PR with mine and sharing any feedback or observations. The PR is currently under review, and we might refine some of the logic if necessary. Thanks! |
|
This PR is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days. |
Add Cloud Logging API Source and Request Log Table for Cloud Armor Logs
Overview
This pull request introduces two major enhancements to the GCP Tailpipe plugin:
Cloud Logging API Source
cloud_logging_api) that enables direct collection of logs from the Google Cloud Logging API.Request Log Table for Cloud Armor Logs
requests_log) designed to store and query Cloud Armor-augmented Application Load Balancer request logs.Key Features
New Source:
cloud_logging_apiNew Table:
requests_logMotivation
These additions enable users to:
Documentation
CC: @turbot/tailpipe-team