View a markdown version of this page

Logging AWS Network Security Manager API calls with AWS CloudTrail - AWS Network Security Manager

Logging AWS Network Security Manager API calls with AWS CloudTrail

AWS Network Security Manager is integrated with AWS CloudTrail, a service that provides a record of actions taken by a user, role, or an AWS service. CloudTrail captures all API calls for AWS Network Security Manager as management events. The calls captured include calls from the AWS Network Security Manager console and programmatic calls to the AWS Network Security Manager API operations.

If you create a trail, you can enable continuous delivery of CloudTrail events to an Amazon S3 bucket, including events for AWS Network Security Manager. If you do not configure a trail, you can still view the most recent events in the CloudTrail console in Event history. For more information, see the AWS CloudTrail User Guide.

AWS Network Security Manager information in CloudTrail

CloudTrail is enabled on your AWS account when you create the account. When activity occurs in AWS Network Security Manager, that activity is recorded in a CloudTrail event along with other AWS service events in Event history. You can view, search, and download recent events in your AWS account. For more information, see Viewing events with CloudTrail Event history.

For an ongoing record of events in your AWS account, including events for AWS Network Security Manager, create a trail. A trail enables CloudTrail to deliver log files to an Amazon S3 bucket. By default, when you create a trail in the console, the trail applies to all AWS Regions. The trail logs events from all Regions in the AWS partition. It delivers the log files to the Amazon S3 bucket that you specify. You can configure other AWS services to further analyze and act upon the event data collected in CloudTrail logs. For more information, see the following:

All AWS Network Security Manager operations are logged by CloudTrail. The public operations include the following:

  • Create, read, update, and delete (CRUD) operations for rules, templates, policies, scopes, and deployments

  • Snapshot operations

  • Tagging operations

  • Administrator account operations

  • Synchronization status operations

  • Resource association operations

  • Rule generation operations

Every event entry includes the following information:

  • The event source: network-security-manager.amazonaws.com

  • The event name, which is the API operation name (for example, CreatePolicy or ListDeployments)

  • The resources affected, identified by ARN and resource type

Read-only operations (such as GetPolicy, ListRules, and ListResourceSynchronizationStatuses) are logged with readOnly: true and do not include response elements. Mutating operations include request parameters and response elements.

Note

CloudTrail redacts sensitive fields from event records. For example, CloudTrail redacts the prompt parameter in the GenerateRuleConfiguration operation.

Example: CreatePolicy event

The following example shows a CloudTrail log entry for the CreatePolicy operation.

{ "eventVersion": "1.09", "userIdentity": { "type": "AssumedRole", "principalId": "AROAEXAMPLEID:my-session", "arn": "arn:aws:sts::123456789012:assumed-role/AdminRole/my-session", "accountId": "123456789012", "accessKeyId": "AKIAIOSFODNN7EXAMPLE", "sessionContext": { "sessionIssuer": { "type": "Role", "principalId": "AROAEXAMPLEID", "arn": "arn:aws:iam::123456789012:role/AdminRole", "accountId": "123456789012", "userName": "AdminRole" }, "attributes": { "creationDate": "2026-08-10T18:22:41Z", "mfaAuthenticated": "false" } } }, "eventTime": "2026-08-10T18:24:03Z", "eventSource": "network-security-manager.amazonaws.com", "eventName": "CreatePolicy", "awsRegion": "us-east-1", "sourceIPAddress": "192.0.2.44", "userAgent": "aws-cli/2.17.0 Python/3.12.4 Darwin/24.6.0", "requestParameters": { "clientToken": "550e8400-e29b-41d4-a716-446655440001", "policyName": "production-web-acl-policy", "firewallType": "WAF", "priority": 1, "associatedTemplateAndRuleList": [ { "templateIdentifier": "arn:aws:network-security-manager:us-east-1:123456789012:template:t1a2b3c4d5" } ], "policyConfiguration": { "remediationEnabled": true, "resourcesCleanUp": false, "wafConfig": { "existingCustomerWebACLResolution": "RETROFIT", "conflictResolution": "MERGE_WHERE_APPLICABLE" } }, "isPublished": true }, "responseElements": { "policyId": "p9z8y7x6w5v4u3t2", "policyArn": "arn:aws:network-security-manager:us-east-1:123456789012:policy:p9z8y7x6w5v4u3t2", "policyName": "production-web-acl-policy", "status": "ACTIVE", "version": "1" }, "requestID": "b1c2d3e4-5f67-4890-a1b2-c3d4e5f6a7b8", "eventID": "f0e1d2c3-b4a5-4968-8776-5a4b3c2d1e0f", "readOnly": false, "resources": [ { "accountId": "123456789012", "type": "AWS::NetworkSecurityManager::Policy", "ARN": "arn:aws:network-security-manager:us-east-1:123456789012:policy:p9z8y7x6w5v4u3t2" } ], "eventType": "AwsApiCall", "managementEvent": true, "recipientAccountId": "123456789012", "eventCategory": "Management" }