awslabs.cloudtrail-mcp-server 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14,5 +14,5 @@
14
14
 
15
15
  """awslabs.cloudtrail-mcp-server"""
16
16
 
17
- __version__ = '0.0.2'
17
+ __version__ = '0.0.3'
18
18
  MCP_SERVER_VERSION = __version__
@@ -254,14 +254,104 @@ class CloudTrailTools:
254
254
  IMPORTANT LIMITATIONS:
255
255
  - CloudTrail Lake only supports SELECT statements using Trino-compatible SQL syntax
256
256
  - INSERT, UPDATE, DELETE, CREATE, DROP, and other DDL/DML operations are not supported
257
+ - Do not use Common Table Expression (CTE)
257
258
  - Your SQL query MUST include a valid Event Data Store (EDS) ID in the FROM clause
258
259
  - Use the list_event_data_stores tool first to get available EDS IDs, then reference the EDS ID
259
260
  directly in your FROM clause
260
-
261
- Valid SQL query examples:
262
- - SELECT eventname, count(*) FROM 0233062b-51c6-4d18-8dec-a8c90da840d9 WHERE eventtime > '2023-01-01' GROUP BY eventname
263
- - SELECT useridentity.username, eventname, eventtime FROM your-eds-id WHERE errorcode IS NOT NULL
264
- - SELECT DISTINCT awsregion FROM your-eds-id WHERE eventname = 'CreateUser'
261
+ - Always use a start and end time using eventtime or have a limit on total output by default
262
+
263
+ CLOUDTRAIL EVENT SCHEMA:
264
+ All CloudTrail events contain these key fields that you can query:
265
+
266
+ Core Fields (Always Present):
267
+ - eventTime: UTC timestamp when request completed
268
+ - eventVersion: Log format version (current: 1.11)
269
+ - eventSource: AWS service name (e.g., "s3.amazonaws.com")
270
+ - eventName: API action name
271
+ - awsRegion: AWS region where request was made
272
+ - sourceIPAddress: IP address of requester
273
+ - eventID: Unique GUID for this event
274
+ - eventType: AwsApiCall, AwsServiceEvent, AwsConsoleAction, AwsConsoleSignIn, AwsVpceEvent
275
+ - eventCategory: Management, Data, NetworkActivity, Insight
276
+
277
+ UserIdentity Object (Always Present):
278
+ - userIdentity.type: Root, IAMUser, AssumedRole, Role, FederatedUser, Directory, AWSAccount, AWSService, IdentityCenterUser, SAMLUser, WebIdentityUser, Unknown
279
+ - userIdentity.principalId: Unique identifier for the entity
280
+ - userIdentity.arn: ARN of the principal
281
+ - userIdentity.accountId: Account that owns the entity
282
+ - userIdentity.accessKeyId: Access key used (may be empty for security)
283
+ - userIdentity.userName: Friendly name (when available)
284
+ - userIdentity.invokedBy: AWS service that made the request
285
+ - userIdentity.identityProvider: External identity provider (SAML/Web)
286
+ - userIdentity.credentialId: Bearer token credential ID
287
+ - userIdentity.sessionContext: For temporary credentials (AssumedRole, FederatedUser)
288
+ - sessionIssuer.type: Source type (Root, IAMUser, Role)
289
+ - sessionIssuer.principalId: Internal ID of issuer
290
+ - sessionIssuer.arn: ARN of issuer
291
+ - sessionIssuer.accountId: Account of issuer
292
+ - sessionIssuer.userName: Name of credential issuer
293
+ - attributes.mfaAuthenticated: "true"/"false" if MFA was used
294
+ - attributes.creationDate: When credentials were issued (ISO 8601)
295
+ - webIdFederationData.federatedProvider: Identity provider name
296
+ - webIdFederationData.attributes: Provider-specific attributes
297
+ - sourceIdentity: Original user identity for role chaining
298
+ - ec2RoleDelivery: "1.0" or "2.0" for IMDS version
299
+ - assumedRoot: True for AssumeRoot sessions
300
+ - userIdentity.onBehalfOf: IAM Identity Center user info
301
+ - userId: Identity Center user ID
302
+ - identityStoreArn: Identity store ARN
303
+ - userIdentity.inScopeOf: Service scope information
304
+ - sourceArn: Invoking resource ARN
305
+ - sourceAccount: Source account ID
306
+ - issuerType: Credential issuer type
307
+ - credentialsIssuedTo: Credential target resource
308
+
309
+ Optional Fields (Conditionally Present):
310
+ - userAgent: Client that made the request (max 1KB)
311
+ - errorCode: AWS service error code if request failed (max 1KB)
312
+ - errorMessage: Error description if request failed (max 1KB)
313
+ - requestParameters: Request parameters (object, max 100KB)
314
+ - responseElements: Response elements for write operations (object, max 100KB)
315
+ - additionalEventData: Additional event data (object, max 28KB)
316
+ - requestID: Service-generated request identifier (max 1KB)
317
+ - apiVersion: API version for AwsApiCall events
318
+ - managementEvent: True if management event
319
+ - readOnly: true/false if read-only operation
320
+ - resources: Array of resources accessed
321
+ - resources[].type: Resource type (e.g., "AWS::S3::Object", "AWS::DynamoDB::Table")
322
+ - resources[].ARN: Resource ARN
323
+ - resources[].accountId: Resource owner account
324
+ - recipientAccountId: Account that received the event
325
+ - serviceEventDetails: Service event details (object, max 100KB)
326
+ - sharedEventID: Shared GUID for cross-account events
327
+ - vpcEndpointId: VPC endpoint identifier (for network events)
328
+ - vpcEndpointAccountId: VPC endpoint owner account
329
+ - addendum: Information about delayed/updated events
330
+ - reason: Why event was delayed (DELIVERY_DELAY, UPDATED_DATA, SERVICE_OUTAGE)
331
+ - updatedFields: Event record fields updated by addendum
332
+ - originalRequestID: Original unique ID of request
333
+ - originalEventID: Original event ID
334
+ - sessionCredentialFromConsole: "true" if from console session
335
+ - eventContext: Enriched event context (tags, IAM conditions)
336
+ - requestContext: IAM condition keys evaluated during authorization
337
+ - tagContext: Tags associated with resources and IAM principals
338
+ - resourceTags: Array of resource tag information
339
+ - resourceTags[].arn: ARN of the tagged resource
340
+ - resourceTags[].tags: Object containing tag key-value pairs
341
+ - principalTags: Tags associated with the IAM principal making the request
342
+ - edgeDeviceDetails: Edge device information (object, max 28KB)
343
+ - tlsDetails: TLS connection information
344
+ - tlsVersion: TLS version used
345
+ - cipherSuite: Cipher suite used
346
+ - clientProvidedHostHeader: Client-provided hostname
347
+
348
+ Example SQL queries:
349
+ - SELECT eventname, count(*) FROM eds-id WHERE eventtime > '2025-01-01 00:00:00' GROUP BY eventname
350
+ - SELECT errorcode, errormessage, eventname FROM eds-id WHERE errorcode IS NOT NULL OR errormessage IS NOT NULL LIMIT 10
351
+ - SELECT eventname, resources FROM eds-id WHERE any_match(resources, x -> x.type = 'AWS::S3::Object') LIMIT 10
352
+ - SELECT useridentity.sessioncontext.sessionissuer.username FROM eds-id WHERE useridentity.type = 'AssumedRole' LIMIT 10
353
+ - SELECT sourceipaddress, count(*) FROM eds-id WHERE eventname = 'ConsoleLogin' GROUP BY sourceipaddress LIMIT 10
354
+ - SELECT eventname, filter(resources, x -> x.type = 'AWS::Lambda::Function') as lambda_resources FROM eds-id WHERE cardinality(filter(resources, x -> x.type = 'AWS::Lambda::Function')) > 0 LIMIT 5
265
355
 
266
356
  Returns:
267
357
  --------
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: awslabs.cloudtrail-mcp-server
3
- Version: 0.0.2
3
+ Version: 0.0.3
4
4
  Summary: An AWS Labs Model Context Protocol (MCP) server for cloudtrail
5
5
  Project-URL: homepage, https://awslabs.github.io/mcp/
6
6
  Project-URL: docs, https://awslabs.github.io/mcp/servers/cloudtrail-mcp-server/
@@ -0,0 +1,12 @@
1
+ awslabs/__init__.py,sha256=WuqxdDgUZylWNmVoPKiK7qGsTB_G4UmuXIrJ-VBwDew,731
2
+ awslabs/cloudtrail_mcp_server/__init__.py,sha256=BFF3-r1DqlRJXUw7Ibt_7YM15b4ILBc59_ESA3LMFKc,708
3
+ awslabs/cloudtrail_mcp_server/common.py,sha256=X8viTngRsPrEn-VGqEg3CRn3HzQtoFJAmdVtgVQxcsU,4679
4
+ awslabs/cloudtrail_mcp_server/models.py,sha256=TJT0TUFfN5Ig9M8xYNXI9MCf2pD_yooxxbxw7vNqfYg,3154
5
+ awslabs/cloudtrail_mcp_server/server.py,sha256=7AixDu0sMC_0RMWySaybfPjVpIrpBSr-VY-DfCrAhw0,1798
6
+ awslabs/cloudtrail_mcp_server/tools.py,sha256=NAPWH7zmJ65RJGHD3E_Q7zGKc6n8d9vznOSBqdE4ye4,29702
7
+ awslabs_cloudtrail_mcp_server-0.0.3.dist-info/METADATA,sha256=RHkNkWZrl4sdfTYSrn2pK8tuBQs-sP6qCb1RQ2aviaU,8826
8
+ awslabs_cloudtrail_mcp_server-0.0.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ awslabs_cloudtrail_mcp_server-0.0.3.dist-info/entry_points.txt,sha256=ivDpa1YKhlUbKTzXWXtwTEHvTMNVGy73KNzTX6SBJ1A,92
10
+ awslabs_cloudtrail_mcp_server-0.0.3.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
11
+ awslabs_cloudtrail_mcp_server-0.0.3.dist-info/licenses/NOTICE,sha256=sjH_X33G3MouXhZuOV8c7dN3IAvn6dSPrGLWA7tHjfQ,97
12
+ awslabs_cloudtrail_mcp_server-0.0.3.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- awslabs/__init__.py,sha256=WuqxdDgUZylWNmVoPKiK7qGsTB_G4UmuXIrJ-VBwDew,731
2
- awslabs/cloudtrail_mcp_server/__init__.py,sha256=zy216mvjlc8RsnSv4NxvhBp32gM1Jp_nFGwRBxCcZGI,708
3
- awslabs/cloudtrail_mcp_server/common.py,sha256=X8viTngRsPrEn-VGqEg3CRn3HzQtoFJAmdVtgVQxcsU,4679
4
- awslabs/cloudtrail_mcp_server/models.py,sha256=TJT0TUFfN5Ig9M8xYNXI9MCf2pD_yooxxbxw7vNqfYg,3154
5
- awslabs/cloudtrail_mcp_server/server.py,sha256=7AixDu0sMC_0RMWySaybfPjVpIrpBSr-VY-DfCrAhw0,1798
6
- awslabs/cloudtrail_mcp_server/tools.py,sha256=O2DzikW8LmRzxAxfeI0ectw3dzKxRktLE4Y3ywb2MGM,23894
7
- awslabs_cloudtrail_mcp_server-0.0.2.dist-info/METADATA,sha256=AZzciupjZzdvDb9AxRiKPJLwbI2XqBdJR3pfRQzi-I4,8826
8
- awslabs_cloudtrail_mcp_server-0.0.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- awslabs_cloudtrail_mcp_server-0.0.2.dist-info/entry_points.txt,sha256=ivDpa1YKhlUbKTzXWXtwTEHvTMNVGy73KNzTX6SBJ1A,92
10
- awslabs_cloudtrail_mcp_server-0.0.2.dist-info/licenses/LICENSE,sha256=CeipvOyAZxBGUsFoaFqwkx54aPnIKEtm9a5u2uXxEws,10142
11
- awslabs_cloudtrail_mcp_server-0.0.2.dist-info/licenses/NOTICE,sha256=sjH_X33G3MouXhZuOV8c7dN3IAvn6dSPrGLWA7tHjfQ,97
12
- awslabs_cloudtrail_mcp_server-0.0.2.dist-info/RECORD,,