를 사용하여 Amazon Keyspaces API 호출을 로깅합니다 AWS CloudTrail - Amazon Keyspaces(Apache Cassandra용)

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

를 사용하여 Amazon Keyspaces API 호출을 로깅합니다 AWS CloudTrail

Amazon Keyspaces는 Amazon Keyspaces에서 사용자, 역할 또는 서비스가 수행한 작업의 기록을 제공하는 AWS 서비스와 통합되어 있습니다. AWS CloudTrail CloudTrail Amazon Keyspaces에 대한 데이터 정의 언어 (DDL) API 호출 및 데이터 조작 언어 (DML) API 호출을 이벤트로 캡처합니다. 캡처되는 호출에는 Amazon Keyspaces 콘솔에서 수행한 직접 호출과 Amazon Keyspaces API 작업에 대한 프로그램 방식의 직접 호출이 포함됩니다.

트레일을 생성하면 Amazon Keyspace에 대한 CloudTrail 이벤트를 포함하여 Amazon Simple Storage Service (Amazon S3) 버킷으로 이벤트를 지속적으로 전송할 수 있습니다.

트레일을 구성하지 않아도 CloudTrail 콘솔의 이벤트 기록에서 가장 최근에 지원되는 이벤트를 계속 볼 수 있습니다. 에서 수집한 CloudTrail 정보를 사용하여 Amazon Keyspaces에 이루어진 요청, 요청이 이루어진 IP 주소, 요청한 사람, 요청 시기 및 추가 세부 정보를 확인할 수 있습니다.

자세한 CloudTrail 내용은 AWS CloudTrail 사용 설명서를 참조하십시오.

에서 Amazon Keyspaces 로그 파일 항목 구성 CloudTrail

로그인된 각 Amazon Keyspaces API 작업에는 CQL 쿼리 언어로 표현되는 요청 파라미터가 CloudTrail 포함되어 있습니다. 자세한 내용은 Amazon Keyspaces(Apache Cassandra용)에 대한 CQL 언어 참조을 참조하세요.

AWS 계정에서 최신 이벤트를 확인, 검색 및 다운로드할 수 있습니다. 자세한 내용은 이벤트 기록으로 CloudTrail 이벤트 보기를 참조하십시오.

Amazon Keyspace의 이벤트를 AWS 계정포함하여 귀하의 이벤트에 대한 지속적인 기록을 보려면 트레일을 생성하십시오. 트레일을 사용하면 CloudTrail Amazon S3 버킷에 로그 파일을 전송할 수 있습니다. 기본적으로 콘솔에서 트레일을 생성하면 트레일이 모든 AWS 지역에 적용됩니다. 트레일은 AWS 파티션에 있는 모든 지역의 이벤트를 기록하고 지정한 Amazon S3 버킷으로 로그 파일을 전송합니다. 또한 CloudTrail 로그에서 수집된 이벤트 데이터를 추가로 분석하고 이에 따라 조치를 취하도록 다른 AWS 서비스를 구성할 수 있습니다.

자세한 내용은AWS CloudTrail 사용 설명서에서 다음 주제를 참조하세요.

모든 이벤트 및 로그 항목에는 요청을 생성한 사용자에 대한 정보가 들어 있습니다. 신원 정보를 이용하면 다음을 쉽게 알아볼 수 있습니다.

  • 요청이 루트 또는 AWS Identity and Access Management (IAM) 사용자 자격 증명으로 이루어졌는지 여부

  • 역할 또는 연동 사용자를 위한 임시 보안 인증으로 요청을 생성하였는지.

  • 다른 AWS 서비스에서 요청했는지 여부.

자세한 내용은 CloudTrail UserIdentity 요소를 참조하십시오.

Amazon Keyspace의 DDL (데이터 정의 언어) 정보 CloudTrail

CloudTrail 계정을 만들 AWS 계정 때 활성화됩니다. Amazon Keyspace에서 DDL 활동이 발생하면 해당 활동은 이벤트 기록에 AWS 다른 서비스 이벤트와 함께 이벤트로 자동 기록됩니다. CloudTrail 다음 표는 Amazon Keyspaces에 대해 기록된 DDL 문을 보여 줍니다.

CloudTrail eventName CQL 작업 AWS SDK 작업

CreateKeyspace

DDL

CREATE KEYSPACE

CreateKeyspace

DropKeyspace

DDL

DROP KEYSPACE

DeleteKeyspace

CreateTable

DDL

CREATE TABLE

CreateTable

DropTable

DDL

DROP TABLE

DeleteTable

AlterTable

DDL

ALTER TABLE

UpdateTable, TagResource, UntagResource

Amazon Keyspace의 데이터 조작 언어 (DML) 정보 CloudTrail

에서 Amazon Keyspaces DML 문의 로깅을 활성화하려면 먼저 데이터 플레인 API 활동 로깅을 활성화해야 합니다. CloudTrail CloudTrail CloudTrail 콘솔을 사용하여 데이터 이벤트 유형 Cassandra 테이블에 대한 활동을 기록하도록 선택하거나 CLI 또는 API 작업을 사용하여 값을 설정함으로써 신규 또는 기존 트레일에서 Amazon Keyspaces DML 이벤트 resources.type 로깅을 시작할 수 있습니다. AWS::Cassandra::Table AWS CloudTrail 자세한 내용은 데이터 이벤트 로깅 섹션을 참조하세요.

다음 표에는 에 의해 기록된 데이터 이벤트가 나와 있습니다. CloudTrail Cassandra table

CloudTrail eventName CQL 작업 AWS SDK 작업

Select

DML

SELECT

GetKeyspace, GetTable, ListKeyspaces, ListTables ListTagsForResource

Insert

DML

INSERT

AWS SDK 액션을 사용할 수 없음

업데이트

DML

UPDATE

AWS SDK 액션을 사용할 수 없음

삭제

DML

DELETE

AWS SDK 액션을 사용할 수 없음

Amazon Keyspaces 로그 파일 항목 이해

CloudTrail 로그 파일에는 하나 이상의 로그 항목이 포함되어 있습니다. 이벤트는 모든 소스의 단일 요청을 나타내며 요청된 작업, 작업 날짜 및 시간, 요청 매개 변수 등에 대한 정보를 포함합니다. CloudTrail 로그 파일은 공개 API 호출의 정렬된 스택 트레이스가 아니므로 특정 순서로 표시되지 않습니다.

다음 예제는CreateKeyspace, DropKeyspaceCreateTable, 및 DropTable 작업을 보여주는 CloudTrail 로그 항목을 보여줍니다.

{ "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" } ] }

다음 로그 파일은 SELECT 문의 예를 보여줍니다.

{ "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" } }

다음 로그 파일은 INSERT 문의 예를 보여줍니다.

{ "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" } }

다음 로그 파일은 UPDATE 문의 예를 보여줍니다.

{ "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" } }

다음 로그 파일은 DELETE 문의 예를 보여줍니다.

{ "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" } }