You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Monitoring/ingest_nas_audit_logs_into_cloudwatch/README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,10 @@ You can run this script as a standalone program or as a Lambda function. These d
12
12
13
13
## Prerequisites
14
14
- An FSx for Data ONTAP file system.
15
-
- Have NAS auditing configured and enabled on the FSx for Data ONTAP file system. Ensure you have selected the XML format for the audit logs. You can read this
15
+
- An S3 bucket to store the "stats" file. The "stats" file is used to keep track of the last time the Lambda function successfully
16
+
ingested audit logs from each file system. Its size will be small (i.e. less than a few megabytes).
17
+
- Have NAS auditing configured and enabled on the FSx for Data ONTAP file system. **Ensure you have selected the XML format for the audit logs.** Also,
18
+
ensure you have set up a rotation schedule. The program will only act on audit log files that have been finalized, and not the "active" one. You can read this
16
19
[knowledge based article](https://kb.netapp.com/on-prem/ontap/da/NAS/NAS-KBs/How_to_set_up_NAS_auditing_in_ONTAP_9) for instructions on how to setup NAS auditing.
17
20
- Have the NAS auditing configured to store the audit logs in a volume with the same name on all FSx for Data ONTAP file
18
21
systems that you want to ingest the audit logs from.
@@ -35,6 +38,7 @@ Therefore, there needs to be an VPC endpoint for all the AWS services that the L
35
38
- EC2.
36
39
- You have created a role with the necessary permissions to allow the Lambda function to do the following:
37
40
41
+
<!--- Using HTML to create a table that has rowspan attributes since the markdown table syntax does not support that. --->
-<secretName> - is the name of the secret that contains the credentials for the fsxadmin accounts.
57
61
58
62
Notes:
59
-
- Since the Lambda function runs within your VPC it needs to be able to create an delete network interfaces.
63
+
- Since the Lambda function runs within your VPC it needs to be able to create and delete network interfaces.
64
+
- The AWS Security Group Policy builder incorrectly generates resource lines for the `CreateNetworkInterface`
65
+
and `DeleteNetworkInterface` actions. The correct resource line is `arn:aws:ec2:<region>:<accountID>:*`.
60
66
- It needs to be able to create a log groups so it can create a log group for the diagnostic output from the Lambda function.
61
-
- Since the ARN of any Secrets Manager secret has random characters at the end of it, you must add the `*` at the end.
67
+
- Since the ARN of any Secrets Manager secret has random characters at the end of it, you must add the `*` at the end, or provide the full ARN of the secret.
62
68
63
69
## Deployment
64
70
1. Create a Lambda deployment package by:
@@ -72,7 +78,9 @@ Notes:
72
78
2. Within the AWS console, or using the AWS API, create a Lambda function with:
73
79
1. Python 3.10, or higher, as the runtime.
74
80
1. Set the permissions to the role created above.
75
-
1. Under `Additional Configurations` select `Enable VPC` and select a VPC and Subnet that will have access to all the FSx for ONtAP file system management endpoints that you want to gather audit logs from.
81
+
1. Under `Additional Configurations` select `Enable VPC` and select a VPC and Subnet that will have access to all the FSx for ONTAP
82
+
file system management endpoints that you want to gather audit logs from. Also, select a Security Group that allows TCP port 443 outbound.
83
+
Inbound rules don't matter since the Lambda function is not accessible from a network.
76
84
1. Click `Create Function` and on the next page, under the `Code` tab, select `Upload From -> .zip file.` Provide the .zip file created by the steps above.
77
85
1. From the `Configuration -> General` tab set the timeout to at least 30 seconds. You will may need to increase that if it has to process a lot of audit entries and/or process a lot of FSx for ONTAP file systems.
0 commit comments