Hi everyone,
I'm currently working on setting up some security monitoring for my Google App Engine-hosted website, and I'm looking to create a YARA rule in chronicle to detect users who are accessing the website. I'd like to monitor this activity for security and compliance purposes.
I tried various udm fields (target.) to find the users who accessing the website, But could'nt be able to find the correct UDM field.Could someone please provide guidance on how I can create an effective YARA rule to achieve this? Specifically, I'm looking to detect HTTPS/HTTP requests or any other relevant activity indicating user access to the website.
Any advice, examples, or resources would be greatly appreciated.
Thanks in advance!
Nikhil
Hi NikhilBattula,
Here are some sample UDM searches applicable to Google App Engine default logging to help get you started following by a YARA sample:
Relevant UDM Fields
Here are the most vital UDM fields you'd likely use for searching:
Example UDM Searches
Basic Access to Your Domain:
event_type = "HTTP_SERVER_LOG" AND target.domain = "your-app-engine-domain.com"
POST Requests Only:
event_type = "HTTP_SERVER_LOG" AND target.domain = "your-app-engine-domain.com" AND http_event.request.method = "POST"
Successful Requests from a Specific Country:
event_type = "HTTP_SERVER_LOG" AND target.domain = "your-app-engine-domain.com" AND http_event.response.status_code >= 200 AND http_event.response.status_code < 400 AND principal.geoip.country = "US"
Important Notes:
Pro Tip:
Start with simple searches, examine the results, then add more conditions iteratively to fine-tune your queries. Chronicle's search interface will offer autocomplete suggestions based on the available UDM fields in your ingested data.
Focus Points for the YARA Rule
##Example YARA-L rule
rule detect_website_activity {
meta:
author = "Your Name"
description = "Detects accesses to Google App Engine Website"
yara_version = "YL2.0"
rule_version = "1.0"
events:
$http_event.metadata.event_type = "HTTP_SERVER_LOG" // Adjust if your log type is different
condition:
$http_event.target.domain == "your-app-engine-domain.com" and
($http_event.request.method == "GET" or $http_event.request.method == "POST") and
$http_event.response.status_code >= 200 and
$http_event.response.status_code < 400 // Focus on successful requests
}
Explanation
Important Notes:
"your-app-engine-domain.com"
with your actual domain. Add more specific URL rules if you like (e.g., targeting a login page).Hi Ben,
Thank you for guiding me and giving me an example yara rule.
I tried to find the event type for app engine logs (I didn't see any UDM events (metadata.event_type) for App engine) and tried using target.url UDM Field also. but i culdn't be able to find it.I can be able to see only GCP_CLOUDAUDIT logs in chronicle. But i want to create rules (And alerts ) in chronicle based on (request_logs) type.googleapis.com/google.appengine.logging.v1.RequestLog logs (which we can see in logs explorer) of the app engine.
I am new to chronicle and using direct ingestion to send app engine logs into Chronicle, could you please share or guide me on how to send the app engine request logs to chronicle instance?
Thanks,
Nikhil
Hi Nikhil
It looks like theres the following default log type and parser:
GCP_APP_ENGINE
I'd try to get the app engine logs ingested through that parser as a first step. How are you currently ingesting your data?
EDIT for clarity: When you say direct ingestion could you clarify please