Langsung ke konten
Skillpedia
Keamanan35k · #8202

performing-cloud-log-forensics-with-athena

Fungsinya

Tool ini membantu menyelidiki aktivitas mencurigakan di akun Amazon Web Services (AWS) Anda dengan menganalisis log aktivitas. Tool ini memungkinkan Anda mencari kejadian tertentu yang mungkin menandakan masalah keamanan.

Kapan dipakai

  • ✓Saat Anda curiga seseorang mengakses akun AWS Anda tanpa izin.
  • ✓Saat Anda ingin tahu apakah data penting telah disalin atau dipindahkan keluar dari akun Anda.
  • ✓Saat Anda perlu melacak siapa melakukan apa dan kapan di dalam infrastruktur AWS Anda.

Link skill

https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-cloud-log-forensics-with-athena/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/performing-cloud-log-forensics-with-athena/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit →

Contoh permintaan ke AI

“Cari semua akses ke akun AWS saya dari IP yang tidak dikenal dalam 24 jam terakhir.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Tool ini membuat tabel khusus untuk mengatur log AWS. Kemudian, Anda bisa mengajukan pertanyaan (kueri SQL) ke log tersebut untuk menemukan informasi tentang kejadian keamanan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Performing Cloud Log Forensics with AWS Athena

When to Use

  • When investigating AWS security incidents that require querying massive volumes of cloud logs
  • When performing forensic analysis across CloudTrail, VPC Flow Logs, S3 access logs, and ALB logs
  • When building reusable Athena tables with partition projection for ongoing incident response
  • When hunting for indicators of compromise across multiple AWS log sources simultaneously
  • When creating evidence-grade SQL queries for compliance audits or legal proceedings

Prerequisites

  • AWS account with Athena, S3, and Glue permissions
  • CloudTrail configured to deliver logs to an S3 bucket
  • VPC Flow Logs enabled and publishing to S3
  • S3 server access logging enabled on target buckets
  • ALB access logging enabled and publishing to S3
  • Python 3.8+ with boto3 installed
  • Appropriate IAM permissions for Athena queries and S3 access

Instructions

Phase 1: Create Athena Database and CloudTrail Table

Create a dedicated forensics database and CloudTrail table using partition projection to automatically discover partitions without manual ALTER TABLE statements.

CREATE DATABASE IF NOT EXISTS cloud_forensics;

CREATE EXTERNAL TABLE cloud_forensics.cloudtrail_logs (
    eventVersion STRING,
    userIdentity STRUCT<
        type: STRING,
        principalId: STRING,
        arn: STRING,
        accountId: STRING,
        invokedBy: STRING,
        accessKeyId: STRING,
        userName: STRING,
        sessionContext: STRUCT<
            attributes: STRUCT<
                mfaAuthenticated: STRING,
                creationDate: STRING>,
            sessionIssuer: STRUCT<
                type: STRING,
                principalId: STRING,
                arn: STRING,
                accountId: STRING,
                userName: STRING>,
            ec2RoleDelivery: STRING,
            webIdFederationData: STRUCT<
                federatedProvider: STRING,
                attributes: MAP<STRING, STRING>>>>,
    eventTime STRING,
    eventSource STRING,
    eventName STRING,
    awsRegion STRING,
    sourceIPAddress STRING,
    userAgent STRING,
    errorCode STRING,
    errorMessage STRING,
    requestParameters STRING,
    responseElements STRING,
    additionalEventData STRING,
    requestId STRING,
    eventId STRING,
    readOnly STRING,
    resources ARRAY<STRUCT<
        arn: STRING,
        accountId: STRING,
        type: STRING>>,
    eventType STRING,
    apiVersion STRING,
    recipientAccountId STRING,
    serviceEventDetails STRING,
    sharedEventID STRING,
    vpcEndpointId STRING,
    tlsDetails STRUCT<
        tlsVersion: STRING,
        cipherSuite: STRING,
        clientProvidedHostHeader: STRING>
)
COMMENT 'CloudTrail logs with partition projection for forensic analysis'
PARTITIONED BY (
    `account` STRING,
    `region` STRING,
    `timestamp` STRING
)
ROW FORMAT SERDE 'org.apache.hive.hcatalog.data.JsonSerDe'
STORED AS INPUTFORMAT 'com.amazon.emr.cloudtrail.CloudTrailInputFormat'
OUTPUTFORMAT 'org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat'
LOCATION 's3://YOUR-CLOUDTRAIL-BUCKET/AWSLogs/'
TBLPROPERTIES (
    'projection.enabled' = 'true',
    'projection.account.type' = 'enum',
    'projection.account.values' = 'YOUR_ACCOUNT_ID',
    'projection.region.type' = 'enum',
    'projection.region.values' = 'us-east-1,us-west-2,eu-west-1',
    'projection.timestamp.type' = 'date',
    'projection.timestamp.format' = 'yyyy/MM/dd',
    'projection.timestamp.range' = '2023/01/01,NOW',
    'projection.timestamp.interval' = '1',
    'projection.timestamp.interval.unit' = 'DAYS',
    'storage.location.template' = 's3://YOUR-CLOUDTRAIL-BUCKET/AWSLogs/${account}/CloudTrail/${region}/${timestamp}'
);

Phase 2: Create VPC Flow Logs Table

CREATE EXTERNAL TABLE cloud_forensics.vpc_flow_logs (
    version INT,
    account_id STRING,
    interface_id STRING,
    srcaddr STRING,
    dstaddr STRING,
    srcport INT,
    dstport INT,
    protocol BIGINT,
    packets BIGINT,
    bytes BIGINT,
    start BIGINT,
    `end` BIGINT,
    action STRING,
    log_status STRING,
    vpc_id STRING,
    subnet_id STRING,
    az_id STRING,
    sublocation_type STRING,
    sublocation_id STRING,
    pkt_srcaddr STRING,
    pkt_dstaddr STRING,
    region STRING,
    pkt_src_aws_service STRING,
    pkt_dst_aws_service STRING,
    flow_direction STRING,
    traffic_path INT
)
PARTITIONED BY (
    `date` STRING
)
ROW FORMAT DELIMITED

…
Pertanyaan umum

Apa itu log AWS?

Log ini adalah catatan rinci dari semua tindakan di akun AWS Anda, seperti siapa mengakses apa, kapan, dan dari mana.

Apa itu AWS Athena?

Ini adalah layanan AWS yang memungkinkan Anda membaca dan mengkueri file log yang tersimpan langsung di S3, tanpa perlu memindahkan atau menyiapkan data terlebih dahulu.

Apakah saya perlu bisa coding untuk menggunakan ini?

Anda perlu memahami dasar cara mengajukan pertanyaan menggunakan SQL (Structured Query Language), tetapi Anda tidak perlu menjadi programmer berpengalaman.

Detail

Deskripsi asli dari pembuat

Uses AWS Athena to query CloudTrail, VPC Flow Logs, S3 access logs, and ALB logs for forensic investigation. Covers CREATE TABLE DDL with partition projection, forensic SQL queries for detecting unauthorized access, data exfiltration, lateral movement, and privilege escalation. Use when investigating AWS security incidents or building cloud-native forensic workflows at scale. '

repo: mukul975/Anthropic-Cybersecurity-Skills

Popularitas

Bintang GitHub
35k
Peringkat
#8202
Lisensi
Apache-2.0
Diperbarui
31/8/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa