It currently supports searching log files, optionally compressed with gzip (.gz) or zip (.zip), in AWS S3, Azure Storage or Google Cloud Storage.
Diagram
Why?
Directly searching cloud storage, without indexing logs into a SIEM or Log Analysi...
cloudgrep
cloudgrep searches cloud storage.
ci License
It currently supports searching log files, optionally compressed with gzip (.gz) or zip (.zip), in AWS S3, Azure Storage or Google Cloud Storage.
Diagram
Why?
Directly searching cloud storage, without indexing logs into a SIEM or Log Analysis tool, can be faster and cheaper.
There is no need to wait for logs to be ingested, indexed, and made available for searching.
It searches files in parallel for speed.
This may be of use when debugging applications, or investigating a security incident.
Example
Simple example:
# BHUSA @BlackHatEvents
So you’ve got an incident in the cloud…
Cloud
(Control Plane)
Forensics
Host Forensics
Log Forensics Network Forensics
# BHUSA @BlackHatEvents
DFIR in the Cloud == Log Analysis?
# BHUSA @BlackHatEvents
Time
●Do you need to ship the logs first?
●Do you need to wait for the logs to be indexed?
●Do you know where the logs are stored?
Cost
●Can you pay to index and store all the data?
●Hot search vs cold data
●Egress fees
Log Analysis in The Cloud -
Challenges
# BHUSA @BlackHatEvents
If the data is already in your SIEM and
you're in a position to do this - that's
fantastic. You can stop now :)
But they can also be expensive, and
you need to get the data there.
Modern SIEM’s often use a cheaper
“indexless” approach to search larger
amounts of data at less cost.
Or they even keep logs “in place” to
reduce the cost of moving them.
SIEM Systems
# BHUSA @BlackHatEvents
Athena for parsing and searching logs in
S3
CREATE EXTERNAL TABLE IF NOT EXISTS elb_logs_raw_native (
request_timestamp string,
request_ip string,
request_port int,
backend_ip string,
backend_port int, …)
ROW FORMAT SERDE 'org.apache.hadoop.hive.serde2.RegexSerDe'
WITH SERDEPROPERTIES (
'serialization.format' = '1','input.regex' = '([^ ]*) ... ([A-Za-z0-9.-]*)$' )
LOCATION 's3://athena-examples/elb/raw/' ;
SELECT * FROM elb_logs_raw_native WHERE elb_response_code = '200' LIMIT 100;
See also: Automated First-Response in AWS using Sigma and
Athena Invictus Incident Response Invictus Incident Response
# BHUSA @BlackHatEvents
●CloudWatch
●CloudSearch
●AWS OpenSearch
●… more
A million ways to search logs in AWS
# BHUSA @BlackHatEvents
I just want to grep my cloud files…
grep is a command-line utility for searching plaintext datasets for lines that match a regular
expression. Its name comes from the ed command g/re/p
Mountpoint
https://aws.amazon.com/s3/features/mountpoint/
aws s3 cp s3://bucket/log-folder/ .
--recursive
zgrep "evil" *
mount-s3 DOC-EXAMPLE-BUCKET /path/to/mount
AWS CLI
# BHUSA @BlackHatEvents
Introducing clougrep
# BHUSA @BlackHatEvents
Overview of cloudgrep
# BHUSA @BlackHatEvents
●Simple installation and operation
●No indexing required
●Operates across aws, azure and gcp
●Files are downloaded and searched in parallel for speed
●Low cost operation (see later)
●Able to run detection rules via regex or Yara for file
content
●Can search compressed files
●Can search binary files
Why cloudgrep
MZ@!L!This program cannot be run in DOS mode.