<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Advait Patel</title>
    <description>The latest articles on Forem by Advait Patel (@advait_patel_5476c0750b4e).</description>
    <link>https://forem.com/advait_patel_5476c0750b4e</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3609306%2F19747c92-4012-49b4-9e4c-ed3b8205393e.png</url>
      <title>Forem: Advait Patel</title>
      <link>https://forem.com/advait_patel_5476c0750b4e</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/advait_patel_5476c0750b4e"/>
    <language>en</language>
    <item>
      <title>Your Docker Images Have 847 Vulnerabilities (And You'll Ignore Them All)</title>
      <dc:creator>Advait Patel</dc:creator>
      <pubDate>Wed, 18 Mar 2026 16:01:44 +0000</pubDate>
      <link>https://forem.com/advait_patel_5476c0750b4e/your-docker-images-have-847-vulnerabilities-and-youll-ignore-them-all-21h5</link>
      <guid>https://forem.com/advait_patel_5476c0750b4e/your-docker-images-have-847-vulnerabilities-and-youll-ignore-them-all-21h5</guid>
      <description>&lt;p&gt;I ran Trivy on a production Node.js application last week. The output was 847 vulnerabilities. Not a typo. Eight hundred and forty-seven.&lt;/p&gt;

&lt;p&gt;I stared at my terminal for a solid minute. Where do you even start with that? Which ones matter? Which ones are in libraries I'm not even using? Which ones have known exploits versus theoretical risks?&lt;/p&gt;

&lt;p&gt;So I did what every developer does. I ignored all of them and shipped the image anyway.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n143pxwfx9llyvcrr5w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0n143pxwfx9llyvcrr5w.png" alt="vulnerabilities warnings" width="721" height="643"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The CVE Fatigue Is Real
&lt;/h2&gt;

&lt;p&gt;Security scanners are doing their job. They're finding vulnerabilities. The problem is they find ALL the vulnerabilities and dump them in your lap with zero context.&lt;/p&gt;

&lt;p&gt;Here's what a typical scan looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;trivy image myapp:latest

Total: 847 &lt;span class="o"&gt;(&lt;/span&gt;UNKNOWN: 23, LOW: 421, MEDIUM: 267, HIGH: 118, CRITICAL: 18&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Okay, 18 critical vulnerabilities. That sounds important. Let me check them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CVE-2023-12345 in libssl1.1 (7.5 severity)&lt;/li&gt;
&lt;li&gt;CVE-2023-23456 in apt (9.8 severity)&lt;/li&gt;
&lt;li&gt;CVE-2022-34567 in systemd (8.1 severity)&lt;/li&gt;
&lt;li&gt;...15 more critical issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Cool. Now what? Do I need to fix all 18? Are they exploitable in my container? Is systemd even running in my container? I have no idea.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Scanner Doesn't Know Your Context
&lt;/h2&gt;

&lt;p&gt;Traditional scanners are like having a hypochondriac friend Google your symptoms. "You have a headache? Could be a brain tumor, meningitis, or 47 other deadly conditions."&lt;/p&gt;

&lt;p&gt;Thanks, very helpful.&lt;/p&gt;

&lt;p&gt;The scanner doesn't know:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you're actually using the vulnerable code path&lt;/li&gt;
&lt;li&gt;If the vulnerability is exploitable in a container environment&lt;/li&gt;
&lt;li&gt;Which fixes won't break your application&lt;/li&gt;
&lt;li&gt;What the actual risk is for YOUR specific use case&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So you end up with three choices:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fix everything (impossible, takes weeks)&lt;/li&gt;
&lt;li&gt;Fix nothing (risky, but honest)&lt;/li&gt;
&lt;li&gt;Fix the ones that "feel" important (guessing)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Most of us pick option 2 or 3.&lt;/p&gt;

&lt;h2&gt;
  
  
  What If The Scanner Could Actually Think?
&lt;/h2&gt;

&lt;p&gt;I got tired of this problem. I wanted a scanner that could:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Look at my Dockerfile and understand my setup&lt;/li&gt;
&lt;li&gt;Tell me which vulnerabilities actually matter&lt;/li&gt;
&lt;li&gt;Explain the issues in plain English, not CVE-speak&lt;/li&gt;
&lt;li&gt;Give me specific fixes for my exact configuration&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So I built it. It's called &lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt; - &lt;a href="https://owasp.org/www-project-docksec/" rel="noopener noreferrer"&gt;https://owasp.org/www-project-docksec/&lt;/a&gt;, and it combines traditional security scanners with AI to give you context-aware analysis.&lt;/p&gt;

&lt;p&gt;Here's what the same scan looks like with &lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;docksec Dockerfile &lt;span class="nt"&gt;-i&lt;/span&gt; myapp:latest

🔍 Analyzing security posture...
⚠️  Security Score: 42/100

Critical Issues &lt;span class="o"&gt;(&lt;/span&gt;3 need immediate attention&lt;span class="o"&gt;)&lt;/span&gt;:
  • Running as root user &lt;span class="o"&gt;(&lt;/span&gt;Dockerfile line 8&lt;span class="o"&gt;)&lt;/span&gt;
    Why it matters: Root access &lt;span class="k"&gt;in &lt;/span&gt;containers &lt;span class="o"&gt;=&lt;/span&gt; full system compromise
    Fix: Add &lt;span class="s1"&gt;'RUN useradd -m appuser &amp;amp;&amp;amp; USER appuser'&lt;/span&gt; before CMD

  • Hardcoded AWS credentials &lt;span class="o"&gt;(&lt;/span&gt;Dockerfile line 15&lt;span class="o"&gt;)&lt;/span&gt;
    Why it matters: Credentials exposed &lt;span class="k"&gt;in &lt;/span&gt;image layers, accessible to anyone
    Fix: Use Docker secrets or environment variables at runtime

  • Base image ubuntu:18.04 has 12 HIGH/CRITICAL CVEs with known exploits
    Why it matters: Your base layer has unpatched vulnerabilities
    Fix: Update to &lt;span class="s1"&gt;'FROM ubuntu:22.04'&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;tested compatible with your deps&lt;span class="o"&gt;)&lt;/span&gt;

📊 Full report saved to: myapp_report.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we're getting somewhere.&lt;/p&gt;

&lt;h2&gt;
  
  
  How It Actually Works
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt; doesn't replace Trivy or Hadolint. It wraps them and adds an AI layer that:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Runs all the traditional scanners (Trivy, Hadolint, Docker Scout)&lt;/li&gt;
&lt;li&gt;Analyzes your Dockerfile to understand your setup&lt;/li&gt;
&lt;li&gt;Correlates vulnerabilities with your actual usage&lt;/li&gt;
&lt;li&gt;Prioritizes what matters for YOUR application&lt;/li&gt;
&lt;li&gt;Generates specific, actionable fixes&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpk4xg1kttz7196j1o65.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frpk4xg1kttz7196j1o65.png" alt="flowchart showing AI analysis" width="468" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The key difference: it reads your Dockerfile. It knows you're running Node.js. It sees you're using Ubuntu 18.04. It notices you're running as root. It understands the context.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Real Example
&lt;/h2&gt;

&lt;p&gt;Let's say you have this Dockerfile:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight docker"&gt;&lt;code&gt;&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="s"&gt; ubuntu:18.04&lt;/span&gt;

&lt;span class="c"&gt;# Install Node.js&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;apt-get update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; apt-get &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; nodejs npm

&lt;span class="c"&gt;# Copy application&lt;/span&gt;
&lt;span class="k"&gt;WORKDIR&lt;/span&gt;&lt;span class="s"&gt; /app&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; package*.json ./&lt;/span&gt;
&lt;span class="k"&gt;RUN &lt;/span&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;span class="k"&gt;COPY&lt;/span&gt;&lt;span class="s"&gt; . .&lt;/span&gt;

&lt;span class="c"&gt;# Run application&lt;/span&gt;
&lt;span class="k"&gt;EXPOSE&lt;/span&gt;&lt;span class="s"&gt; 3000&lt;/span&gt;
&lt;span class="k"&gt;CMD&lt;/span&gt;&lt;span class="s"&gt; ["node", "server.js"]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Traditional scanner output:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;156 vulnerabilities in Ubuntu 18.04&lt;/li&gt;
&lt;li&gt;89 vulnerabilities in various npm packages&lt;/li&gt;
&lt;li&gt;Hadolint warnings about apt-get cache&lt;/li&gt;
&lt;li&gt;Docker Scout findings about base image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You're left to figure out which of these 245+ findings matter.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt; output:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update base image to ubuntu:22.04 (fixes 127 CVEs at once)&lt;/li&gt;
&lt;li&gt;Add non-root user (prevents privilege escalation)&lt;/li&gt;
&lt;li&gt;Pin npm packages (ensures reproducible builds)&lt;/li&gt;
&lt;li&gt;Clean apt cache (reduces image size by 89MB)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Four actionable items. That's it. That's what actually matters.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Privacy Angle
&lt;/h2&gt;

&lt;p&gt;Before you ask: "Are you sending my code to OpenAI?"&lt;/p&gt;

&lt;p&gt;No. &lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt; sends the scan results and Dockerfile to the AI for analysis. Not your application code. Not your secrets. Just the configuration and findings.&lt;/p&gt;

&lt;p&gt;And if you're paranoid (which is fair), you can use Ollama to run everything locally. No cloud AI needed.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Run DockSec with local Ollama&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LLM_PROVIDER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;ollama
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LLM_MODEL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;llama3.1
docksec Dockerfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything stays on your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;Installation takes 30 seconds:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;docksec
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your-key"&lt;/span&gt;  &lt;span class="c"&gt;# or use Ollama locally&lt;/span&gt;
docksec Dockerfile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Scan one Dockerfile. See what it finds. I bet you'll be surprised.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqmoq7ektko1ykz0pb2n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqqmoq7ektko1ykz0pb2n.png" alt="before vs after comparison" width="624" height="534"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The tool is open source (MIT license), has 14,000 downloads, and was recently adopted by &lt;a href="https://owasp.org/www-project-docksec/" rel="noopener noreferrer"&gt;OWASP&lt;/a&gt; as an incubator project. It's not perfect, but it's better than ignoring 847 vulnerabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;This is article #1 in a series about Docker security and &lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt;. Coming up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How DockSec actually works under the hood&lt;/li&gt;
&lt;li&gt;Running AI security scans completely offline&lt;/li&gt;
&lt;li&gt;Real examples of fixing vulnerable images&lt;/li&gt;
&lt;li&gt;Integrating security into CI/CD without slowing down deployments&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you try &lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;DockSec&lt;/a&gt;, let me know what you find. Star the repo if it helps you: &lt;a href="https://github.com/advaitpatel/DockSec" rel="noopener noreferrer"&gt;https://github.com/advaitpatel/DockSec&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now go scan something. You might be surprised what's lurking in your images.&lt;/p&gt;

</description>
      <category>docker</category>
      <category>containers</category>
      <category>security</category>
      <category>ai</category>
    </item>
    <item>
      <title>From Cloud Audit Logs to Real-Time Threat Detection with BigQuery and Chronicle SIEM</title>
      <dc:creator>Advait Patel</dc:creator>
      <pubDate>Sun, 23 Nov 2025 05:44:43 +0000</pubDate>
      <link>https://forem.com/advait_patel_5476c0750b4e/from-cloud-audit-logs-to-real-time-threat-detection-with-bigquery-and-chronicle-siem-4kn5</link>
      <guid>https://forem.com/advait_patel_5476c0750b4e/from-cloud-audit-logs-to-real-time-threat-detection-with-bigquery-and-chronicle-siem-4kn5</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Cloud Audit Logs help you track every cloud action. They show who did what, when, and where it happened. These logs are your foundation for strong visibility and control.&lt;/p&gt;

&lt;p&gt;However, storing logs alone isn’t enough for compliance. Security teams need to analyze patterns, detect threats, and respond fast. That’s where smarter, automated tools become essential.&lt;/p&gt;

&lt;p&gt;In this article, you’ll learn to build a complete pipeline. It combines &lt;a href="https://docs.cloud.google.com/logging/docs/audit" rel="noopener noreferrer"&gt;Cloud Audit Logs&lt;/a&gt;, &lt;a href="https://cloud.google.com/bigquery?hl=en" rel="noopener noreferrer"&gt;BigQuery&lt;/a&gt;, and &lt;a href="https://cloud.google.com/security/products/security-operations?hl=en" rel="noopener noreferrer"&gt;Chronicle SIEM&lt;/a&gt;. This setup helps you ingest, normalize, and query logs at scale.&lt;/p&gt;

&lt;p&gt;You’ll also learn how to detect risky activity using patterns. Then, you’ll visualize anomalies and enrich results with identity data. The goal is simple—turn raw logs into real-time security insight.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Go Beyond Logging?
&lt;/h2&gt;

&lt;p&gt;This table shows why basic logging is not enough. It highlights common cloud audit challenges and their ideal solutions.&lt;/p&gt;

&lt;p&gt;Each challenge reflects a gap in visibility or action. The tools listed help you filter, correlate, and automate responses. This helps security teams move from raw data to real insights.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Challenge&lt;/th&gt;
      &lt;th&gt;Solution&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Too many logs, not enough signal&lt;/td&gt;
      &lt;td&gt;UDM normalization + SQL filters in BigQuery&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Manual investigation workflows&lt;/td&gt;
      &lt;td&gt;Chronicle timeline + ML insights&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Compliance without visibility&lt;/td&gt;
      &lt;td&gt;Structured queries, dashboards, audit pipelines&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Siloed audit logs&lt;/td&gt;
      &lt;td&gt;Centralized correlation across services&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Reference Architecture
&lt;/h2&gt;

&lt;p&gt;This reference architecture shows the data flow clearly. It starts with GCP Audit Logs capturing cloud events. Logs move through Cloud Logging and Pub/Sub for routing. Then, BigQuery handles large-scale analytics and queries.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vta1gtsld8ff2chdum8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5vta1gtsld8ff2chdum8.png" alt="Reference Architecture" width="800" height="299"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Chronicle SIEM performs real-time threat detection and context. This setup blends batch analytics with instant event correlation. It helps you cover compliance and threat response effectively.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step: Building the Pipeline
&lt;/h2&gt;

&lt;p&gt;This section guides you through creating a complete logging and detection pipeline. You’ll learn each step to collect, analyze, and respond to security events efficiently.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Enable Cloud Audit Logs for All Resources
&lt;/h3&gt;

&lt;p&gt;Start by enabling Cloud Audit Logs across all resources. Make sure both Admin Activity and Data Access logs are turned on. Admin logs show who changed settings or roles. Data Access logs track who viewed or read data. Enabling both gives full visibility into your cloud actions.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud logging sinks create audit-log-sink \
bigquery.googleapis.com/projects/myproject/datasets/audit_dataset --logfilter='logName:"cloudaudit.googleapis.com"'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This includes IAM, GKE, BigQuery, Storage, Compute Engine, Cloud Run, etc.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Normalize Logs in BigQuery for Querying
&lt;/h3&gt;

&lt;p&gt;Once logs are enabled, you’ll need to make them useful. BigQuery lets you clean and structure logs for faster searches. You can pull out key fields like user, action, and resource. This helps you run clear queries and build reports easily.&lt;/p&gt;

&lt;p&gt;Example: Flatten IAM permission changes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT
protopayload_auditlog.authenticationInfo.principalEmail AS actor,
protopayload_auditlog.resourceName AS resource,
protopayload_auditlog.methodName AS action,
TIMESTAMP_SECONDS(receiveTimestamp.seconds) AS ts
FROM
`audit_dataset.cloudaudit_googleapis_com_activity`
WHERE
  protopayload_auditlog.methodName CONTAINS "SetIamPolicy"
  AND resource CONTAINS "bigquery"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Use scheduled queries or views for dashboard generation in Looker Studio.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Ingest Logs into Chronicle for Real-Time Enrichment
&lt;/h3&gt;

&lt;p&gt;Next, send your logs to Chronicle for deeper analysis. Use Pub/Sub or the Chronicle API to forward logs in real time. Chronicle adds context, links events, and highlights risky patterns. This step turns raw logs into useful, security-ready data.&lt;/p&gt;

&lt;p&gt;For Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gcloud pubsub topics create chronicle-audit
gcloud logging sinks create chronicle-sink \
pubsub.googleapis.com/projects/my-project/topics/chronicle-audit
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Format logs using Unified Data Model (UDM) before sending to Chronicle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
"metadata": {
 "productname": "GCP",
 "event_type": "IAM_POLICY_CHANGE"
},
"principal": {
  "user": { "userid": "admin@example.com" }
},
"target": {
 "resource": "bigquery/project-id/dataset"
 }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Send logs to Chronicle UDM API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -X POST \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @log.json \
  https://backstory.googleapis.com/v1/udmevents
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Write Chronicle Rules to Detect Abuse
&lt;/h3&gt;

&lt;p&gt;Write custom rules in Chronicle using YARA-L syntax. This helps detect abuse, risky changes, or rare behaviour&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rule ExcessivePolicyChanges
{
  meta:
    author = "advait@gcpsec"
    description = "Detects multiple IAM policy changes in short time"

  events:
    $e.metadata.event_type == "IAM_POLICY_CHANGE"
    and $e.metadata.product_name == "GCP"
    and count($e) &amp;gt; 5 over 10m
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Chronicle alerts the SOC if abuse patterns are detected.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Build Contextual Timeline Investigations
&lt;/h3&gt;

&lt;p&gt;Use Chronicle’s timeline to trace user activity over time. It helps connect events and understand how incidents unfold.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Lateral movement&lt;/li&gt;
&lt;li&gt;Privilege escalation&lt;/li&gt;
&lt;li&gt;Suspicious API access (For example, getIamPolicy, testIamPermissions)&lt;/li&gt;
&lt;li&gt;Admin activity outside business hours&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FETCH events
  WHERE principal.user.userid = "admin@example.com"
  AND metadata.event_timestamp BETWEEN "2025-06-18T00:00:00Z" AND "2025-06-18T06:00:00Z"
RETURN action, resource, src_ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Use Case: Detecting Insider Threat in BigQuery
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;An admin uses SetIamPolicy to grant full BigQuery access.&lt;/li&gt;
&lt;li&gt;Shortly after, they access sensitive datasets during off-hours.&lt;/li&gt;
&lt;li&gt;These actions happen outside normal user behavior patterns.&lt;/li&gt;
&lt;li&gt;Chronicle links the role change and unusual data access together.&lt;/li&gt;
&lt;li&gt;Identity data adds context like user role and device location.&lt;/li&gt;
&lt;li&gt;An alert is raised based on pattern, time, and privilege use.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This type of correlation isn’t visible in raw logs alone.&lt;/p&gt;

&lt;h2&gt;
  
  
  Advanced Audit Log Analytics Checklist
&lt;/h2&gt;

&lt;p&gt;This checklist shows how to turn logs into insight. Each task pairs with a tool built for speed and scale. You’ll cover everything from enabling logs to threat detection and reporting. It helps teams stay compliant, alert, and audit-ready.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Task&lt;/th&gt;
      &lt;th&gt;Tool&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;Enable audit logs for all resources&lt;/td&gt;
      &lt;td&gt;Cloud Logging&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Ingest and normalize logs&lt;/td&gt;
      &lt;td&gt;BigQuery + UDM&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Real-time alerting and detection&lt;/td&gt;
      &lt;td&gt;Chronicle SIEM + YARA-L&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Timeline-based investigations&lt;/td&gt;
      &lt;td&gt;Chronicle Timeline + Entity Context&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Long-term compliance reporting&lt;/td&gt;
      &lt;td&gt;BigQuery + Looker Studio&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;Threat hunting + enrichment&lt;/td&gt;
      &lt;td&gt;Chronicle UDM Search&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1tet9kwa893tu5jow41.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fv1tet9kwa893tu5jow41.png" alt="GCP Audit Log Analytics Architecture with BigQuery + Chronicle" width="512" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecbc0vfrii5oc77mp5g5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecbc0vfrii5oc77mp5g5.png" alt="Architecture Flow" width="800" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Collecting audit logs alone won’t secure your cloud. To stay ahead, you need to turn data into decisions.&lt;/p&gt;

&lt;p&gt;BigQuery helps you store, structure, and query logs fast. Chronicle adds identity context, event correlation, and live detection.&lt;/p&gt;

&lt;p&gt;Together, they create a smart, cloud-native analytics system. You know what happened, why it matters, and how to respond.&lt;/p&gt;

&lt;p&gt;Starting in 2026, top SOCs won’t react after alerts appear. They’ll predict, prevent, and investigate with speed and clarity.&lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>cloudsecurity</category>
      <category>cybersecurity</category>
      <category>security</category>
    </item>
  </channel>
</rss>
