Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Mencatat panggilan API Amazon Keyspaces dengan AWS CloudTrail
Amazon Keyspaces terintegrasi dengan AWS CloudTrail, layanan yang menyediakan catatan tindakan yang diambil oleh pengguna, peran, atau AWS layanan di Amazon Keyspaces. CloudTrail menangkap panggilan API Data Definition Language (DDL) dan panggilan API Data Manipulation Language (DML/Data Manipulation Language) untuk Amazon Keyspaces sebagai event. Panggilan yang diambil termasuk panggilan dari konsol Amazon Keyspaces dan panggilan terprogram ke operasi Amazon Keyspaces API.
Jika Anda membuat jejak, Anda dapat mengaktifkan pengiriman CloudTrail acara secara terus menerus ke bucket Amazon Simple Storage Service (Amazon S3), termasuk peristiwa untuk Amazon Keyspaces.
Jika Anda tidak mengonfigurasi jejak, Anda masih dapat melihat acara terbaru yang didukung di CloudTrail konsol dalam Riwayat acara. Dengan menggunakan informasi yang dikumpulkan oleh CloudTrail, Anda dapat menentukan permintaan yang dibuat ke Amazon Keyspaces, alamat IP dari mana permintaan dibuat, siapa yang membuat permintaan, kapan dibuat, dan detail tambahan.
Untuk mempelajari selengkapnya CloudTrail, lihat Panduan AWS CloudTrail Pengguna.
Topik
Mengonfigurasi entri file log Amazon Keyspaces di CloudTrail
Setiap tindakan Amazon Keyspaces API yang masuk CloudTrail menyertakan parameter permintaan yang dinyatakan dalam bahasa kueri CQL. Untuk informasi selengkapnya, lihat CQLreferensi bahasa untuk Amazon Keyspaces (untuk Apache Cassandra).
Anda dapat melihat, mencari, dan mengunduh peristiwa terbaru di Akun AWS Anda. Untuk informasi selengkapnya, lihat Melihat peristiwa dengan riwayat CloudTrail acara.
Untuk catatan peristiwa yang sedang berlangsung di Anda Akun AWS, termasuk acara untuk Amazon Keyspaces, buat jejak. Jejak memungkinkan CloudTrail untuk mengirimkan file log ke bucket Amazon S3. Secara default, saat Anda membuat jejak di konsol, jejak tersebut berlaku untuk semua AWS Wilayah. Jejak mencatat peristiwa dari semua Wilayah di AWS partisi dan mengirimkan file log ke bucket Amazon S3 yang Anda tentukan. Selain itu, Anda dapat mengonfigurasi AWS layanan lain untuk menganalisis lebih lanjut dan menindaklanjuti data peristiwa yang dikumpulkan dalam CloudTrail log.
Untuk informasi selengkapnya, lihat topik berikut di Panduan Pengguna AWS CloudTrail :
Setiap entri peristiwa atau log berisi informasi tentang siapa yang membuat permintaan tersebut. Informasi identitas membantu Anda menentukan berikut ini:
-
Apakah permintaan itu dibuat dengan kredenal pengguna root atau AWS Identity and Access Management (IAM).
-
Apakah permintaan tersebut dibuat dengan kredensial keamanan sementara untuk satu peran atau pengguna terfederasi.
-
Apakah permintaan itu dibuat oleh AWS layanan lain.
Untuk informasi selengkapnya, lihat elemen CloudTrail UserIdentity.
Informasi Amazon Keyspaces Data Definition Language (DDL) di CloudTrail
CloudTrail diaktifkan pada Akun AWS saat Anda membuat akun. Ketika aktivitas DDL terjadi di Amazon Keyspaces, aktivitas tersebut secara otomatis direkam CloudTrail sebagai peristiwa bersama dengan peristiwa layanan AWS lainnya dalam riwayat Acara. Tabel berikut menunjukkan pernyataan DDL yang dicatat untuk Amazon Keyspaces.
CloudTrail eventName |
Pernyataan | Tindakan CQL | AWS Tindakan SDK |
---|---|---|---|
CreateKeyspace |
DDL |
|
|
DropKeyspace |
DDL |
|
|
CreateTable |
DDL |
|
|
DropTable |
DDL |
|
|
AlterTable |
DDL |
|
|
Informasi Amazon Keyspaces Data Manipulation Language (DHTML) di CloudTrail
Untuk mengaktifkan pencatatan pernyataan DHTML Amazon Keyspaces dengan CloudTrail, Anda harus terlebih dahulu mengaktifkan pencatatan aktivitas API bidang data di. CloudTrail Anda dapat mulai mencatat peristiwa DHTML Amazon Keyspaces di jalur baru atau yang sudah ada dengan memilih untuk mencatat aktivitas untuk tabel Cassandra tipe peristiwa data menggunakan CloudTrail konsol, atau dengan menyetel nilai resources.type
menggunakan AWS::Cassandra::Table
CLI AWS , atau operasi API. CloudTrail Untuk informasi selengkapnya, lihat Mencatat peristiwa data.
Tabel berikut menunjukkan peristiwa data yang dicatat oleh CloudTrail untukCassandra table
.
CloudTrail eventName |
Pernyataan | Tindakan CQL | AWS Tindakan SDK |
---|---|---|---|
Select |
DML |
|
|
Sisipkan |
DML |
|
tidak ada tindakan AWS SDK yang tersedia |
Perbarui |
DML |
|
tidak ada tindakan AWS SDK yang tersedia |
Hapus |
DML |
|
tidak ada tindakan AWS SDK yang tersedia |
Memahami entri file log Amazon Keyspaces
CloudTrail file log berisi satu atau lebih entri log. Peristiwa mewakili permintaan tunggal dari sumber manapun dan mencakup informasi tentang tindakan yang diminta, tanggal dan waktu tindakan, parameter permintaan, dan sebagainya. CloudTrail file log bukanlah jejak tumpukan yang diurutkan dari panggilan API publik, jadi file tersebut tidak muncul dalam urutan tertentu.
Contoh berikut menunjukkan entri CloudTrail log yang menunjukkanCreateKeyspace
,, DropKeyspace
CreateTable
, dan DropTable
tindakan:
{ "Records": [ { "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AKIAIOSFODNN7EXAMPLE:alice", "arn": "arn:aws:sts::111122223333:assumed-role/users/alice", "accountId": "111122223333", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/Admin", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-01-15T18:47:56Z" } } }, "eventTime": "2020-01-15T18:53:04Z", "eventSource": "cassandra.amazonaws.com", "eventName": "CreateKeyspace", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "rawQuery": "\n\tCREATE KEYSPACE \"mykeyspace\"\n\tWITH\n\t\tREPLICATION = {'class': 'SingleRegionStrategy'}\n\t\t", "keyspaceName": "mykeyspace" }, "responseElements": null, "requestID": "bfa3e75d-bf4d-4fc0-be5e-89d15850eb41", "eventID": "d25beae8-f611-4229-877a-921557a07bb9", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Keyspace", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/mykeyspace/" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "recipientAccountId": "111122223333", "managementEvent": true, "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" }, { "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AKIAIOSFODNN7EXAMPLE:alice", "arn": "arn:aws:sts::111122223333:assumed-role/users/alice", "accountId": "111122223333", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/Admin", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-01-15T18:47:56Z" } } }, "eventTime": "2020-01-15T19:28:39Z", "eventSource": "cassandra.amazonaws.com", "eventName": "DropKeyspace", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "rawQuery": "DROP KEYSPACE \"mykeyspace\"", "keyspaceName": "mykeyspace" }, "responseElements": null, "requestID": "66f3d86a-56ae-4c29-b46f-abcd489ed86b", "eventID": "e5aebeac-e1dd-41e3-a515-84fe6aaabd7b", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Keyspace", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/mykeyspace/" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "recipientAccountId": "111122223333", "managementEvent": true, "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" }, { "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AKIAIOSFODNN7EXAMPLE:alice", "arn": "arn:aws:sts::111122223333:assumed-role/users/alice", "accountId": "111122223333", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/Admin", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-01-15T18:47:56Z" } } }, "eventTime": "2020-01-15T18:55:24Z", "eventSource": "cassandra.amazonaws.com", "eventName": "CreateTable", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "rawQuery": "\n\tCREATE TABLE \"mykeyspace\".\"mytable\"(\n\t\t\"ID\" int,\n\t\t\"username\" text,\n\t\t\"email\" text,\n\t\t\"post_type\" text,\n\t\tPRIMARY KEY((\"ID\", \"username\", \"email\")))", "keyspaceName": "mykeyspace", "tableName": "mytable" }, "responseElements": null, "requestID": "5f845963-70ea-4988-8a7a-2e66d061aacb", "eventID": "fe0dbd2b-7b34-4675-a30c-740f9d8d73f9", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Table", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/mykeyspace/table/mytable" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "recipientAccountId": "111122223333", "managementEvent": true, "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" }, { "eventVersion": "1.05", "userIdentity": { "type": "AssumedRole", "principalId": "AKIAIOSFODNN7EXAMPLE:alice", "arn": "arn:aws:sts::111122223333:assumed-role/users/alice", "accountId": "111122223333", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:role/Admin", "accountId": "111122223333", "userName": "Admin" }, "webIdFederationData": {}, "attributes": { "mfaAuthenticated": "false", "creationDate": "2020-01-15T18:47:56Z" } } }, "eventTime": "2020-01-15T19:27:59Z", "eventSource": "cassandra.amazonaws.com", "eventName": "DropTable", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "rawQuery": "DROP TABLE \"mykeyspace\".\"mytable\"", "keyspaceName": "mykeyspace", "tableName": "mytable" }, "responseElements": null, "requestID": "025501b0-3582-437e-9d18-8939e9ef262f", "eventID": "1a5cbedc-4e38-4889-8475-3eab98de0ffd", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Table", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/mykeyspace/table/mytable" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "recipientAccountId": "111122223333", "managementEvent": true, "eventCategory": "Management", "tlsDetails": { "tlsVersion": "TLSv1.2", "cipherSuite": "ECDHE-RSA-AES128-GCM-SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" } ] }
File log berikut menunjukkan contoh SELECT
pernyataan.
{ "eventVersion": "1.09", "userIdentity": { "type": "IAMUser", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/alice", "accountId": "111122223333", "userName": "alice" }, "eventTime": "2023-11-17T10:38:04Z", "eventSource": "cassandra.amazonaws.com", "eventName": "Select", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "keyspaceName": "my_keyspace", "tableName": "my_table", "conditions": [ "pk = **(Redacted)", "ck < 3**(Redacted)0", "region = 't**(Redacted)t'" ], "select": [ "pk", "ck", "region" ], "allowFiltering": true }, "responseElements": null, "requestID": "6d83bbf0-a3d0-4d49-b1d9-e31779a28628", "eventID": "e00552d3-34e9-4092-931a-912c4e08ba17", "readOnly": true, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Table", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/table/my_table" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "managementEvent": false, "recipientAccountId": "111122223333", "eventCategory": "Data", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" } }
File log berikut menunjukkan contoh INSERT
pernyataan.
{ "eventVersion": "1.09", "userIdentity": { "type": "IAMUser", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/alice", "accountId": "111122223333", "userName": "alice" }, "eventTime": "2023-12-01T22:11:43Z", "eventSource": "cassandra.amazonaws.com", "eventName": "Insert", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "keyspaceName": "my_keyspace", "tableName": "my_table", "primaryKeys": { "pk": "**(Redacted)", "ck": "1**(Redacted)8" }, "columnNames": [ "pk", "ck", "region" ], "updateParameters": { "TTL": "2**(Redacted)0" } } }, "responseElements": null, "requestID": "edf8af47-2f87-4432-864d-a960ac35e471", "eventID": "81b56a1c-9bdd-4c92-bb8e-92776b5a3bf1", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Table", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/table/my_table" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "managementEvent": false, "recipientAccountId": "111122223333", "eventCategory": "Data", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" } }
File log berikut menunjukkan contoh UPDATE
pernyataan.
{ "eventVersion": "1.09", "userIdentity": { "type": "IAMUser", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/alice", "accountId": "111122223333", "userName": "alice" }, "eventTime": "2023-12-01T22:11:43Z", "eventSource": "cassandra.amazonaws.com", "eventName": "Update", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "keyspaceName": "my_keyspace", "tableName": "my_table", "primaryKeys": { "pk": "'t**(Redacted)t'", "ck": "'s**(Redacted)g'" }, "assignmentColumnNames": [ "nonkey" ], "conditions": [ "nonkey < 1**(Redacted)7" ] }, "responseElements": null, "requestID": "edf8af47-2f87-4432-864d-a960ac35e471", "eventID": "81b56a1c-9bdd-4c92-bb8e-92776b5a3bf1", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Table", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/table/my_table" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "managementEvent": false, "recipientAccountId": "111122223333", "eventCategory": "Data", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" } }
File log berikut menunjukkan contoh DELETE
pernyataan.
{ "eventVersion": "1.09", "userIdentity": { "type": "IAMUser", "principalId": "AKIAIOSFODNN7EXAMPLE", "arn": "arn:aws:iam::111122223333:user/alice", "accountId": "111122223333", "userName": "alice", }, "eventTime": "2023-10-23T13:59:05Z", "eventSource": "cassandra.amazonaws.com", "eventName": "Delete", "awsRegion": "us-east-1", "sourceIPAddress": "10.24.34.01", "userAgent": "Cassandra Client/ProtocolV4", "requestParameters": { "keyspaceName": "my_keyspace", "tableName": "my_table", "primaryKeys": { "pk": "**(Redacted)", "ck": "**(Redacted)" }, "conditions": [], "deleteColumnNames": [ "m", "s" ], "updateParameters": {} }, "responseElements": null, "requestID": "3d45e63b-c0c8-48e2-bc64-31afc5b4f49d", "eventID": "499da055-c642-4762-8775-d91757f06512", "readOnly": false, "resources": [ { "accountId": "111122223333", "type": "AWS::Cassandra::Table", "ARN": "arn:aws:cassandra:us-east-1:111122223333:/keyspace/my_keyspace/table/my_table" } ], "eventType": "AwsApiCall", "apiVersion": "3.4.4", "managementEvent": false, "recipientAccountId": "111122223333", "eventCategory": "Data", "tlsDetails": { "tlsVersion": "TLSv1.3", "cipherSuite": "TLS_AES_128_GCM_SHA256", "clientProvidedHostHeader": "cassandra.us-east-1.amazonaws.com" } }