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-MANUAL.md
+32-15Lines changed: 32 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,12 @@ or by following the manual instructions found in the this file.
14
14
15
15
## Prerequisites
16
16
- An FSx for Data ONTAP file system.
17
-
- An S3 bucket to store the "stats" file and a Lambda layer zip file.
18
-
- You will need to download the [Lambda layer zip file](https://raw.githubusercontent.com/NetApp/FSx-ONTAP-samples-scripts/main/Monitoring/ingest_nas_audit_logs_into_cloudwatch/lambda_layer.zip) from this repo and upload it to the S3 bucket. Be sure to perserve the name `lambda_layer.zip`.
19
-
- The "stats" file is maintained by the program. It is used to keep track of the last time the Lambda function successfully ingested audit logs from each SVM. Its size will be small (i.e. less than a few megabytes).
17
+
- An S3 bucket to store the "stats" file and optionally a copy of all the raw NAS audit log files. It will also
18
+
hold a Lambda layer file needed to be able to an add Lambda Layer from a CloudFormation script.
19
+
- You will need to download the [Lambda layer zip file](https://raw.githubusercontent.com/NetApp/FSx-ONTAP-utils/main/Monitoring/Ingest-NAS-Audit-Logs-into-CloudWatch/lambda_layer.zip)
20
+
from this repo and upload it to the S3 bucket. Be sure to preserve the name `lambda_layer.zip`.
21
+
- The "stats" file is maintained by the program. It is used to keep track of the last time the Lambda function
22
+
successfully ingested audit logs from each SVM. Its size will be small (i.e. less than a few megabytes).
20
23
- A CloudWatch log group to ingest the audit logs into. Each audit log file with get its own log stream within the log group.
21
24
- Have NAS auditing configured and enabled on the SVM within a FSx for Data ONTAP file system. **Ensure you have selected the XML format for the audit logs.** Also,
22
25
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
@@ -79,7 +82,7 @@ and `DeleteNetworkInterface` actions. The correct resource line is `arn:aws:ec2:
79
82
`zip -r ingest_nas_audit_logs.zip .`<br>
80
83
81
84
2. Within the AWS console, or using the AWS API, create a Lambda function with:
82
-
1. Python 3.10, or higher, as the runtime.
85
+
1. Python 3.11, or higher, as the runtime.
83
86
1. Set the permissions to the role created above.
84
87
1. Under `Additional Configurations` select `Enable VPC` and select a VPC and Subnet that will have access to all the FSx for ONTAP
85
88
file system management endpoints that you want to gather audit logs from. Also, select a Security Group that allows TCP port 443 outbound.
@@ -90,15 +93,29 @@ process a lot of audit entries and/or process a lot of SVMs.
90
93
91
94
3. Configure the Lambda function by setting the following environment variables. For a Lambda function you do this by clicking on the `Configuration` tab and then the `Environment variables` sub tab.
92
95
93
-
| Variable | Description |
94
-
| --- | --- |
95
-
| fsxRegion | The region where the FSx for ONTAP file systems are located. |
96
-
| secretArn | The ARN of the secret that contains the credentials for all the FSx for ONTAP file systems you want to gather audit logs from. |
97
-
| s3BucketRegion | The region of the S3 bucket where the stats file is stored. |
98
-
| s3BucketName | The name of the S3 bucket where the stats file is stored. |
99
-
| statsName | The name you want to use as the stats file. |
100
-
| logGroupName | The name of the CloudWatch log group to ingest the audit logs into. |
101
-
| volumeName | The name of the volume, on all the FSx for ONTAP file systems, where the audit logs are stored. |
96
+
| Variable | Required| Description |
97
+
| --- | --- | --- |
98
+
| fsxRegion | Yes |The region where the FSx for ONTAP file systems are located. |
99
+
| s3BucketRegion |Yes | The region of the S3 bucket where the stats file is stored. |
100
+
| s3BucketName | Yes |The name of the S3 bucket where the stats file is stored. |
101
+
| copyToS3 | No| Set to `true` if you want to copy the raw audit log files to the S3 bucket.|
102
+
|fsxnSecretARNsFile|No|The name of a file within the S3 bucket that contains the Secret ARNs for each for the FSxN file systems. The format of the file should be just `<fsID>=<secretARN>`. For example: `fs-0e8d9172fa5411111=arn:aws:secretsmanager:us-east-1:123456789012:secret:fsxadmin-abc123`|
103
+
|fileSystem1ID|No|The ID of the first FSxN file system to ingest the audit logs from.|
104
+
|fileSystem1SecretARN|No|The ARN of the secret that contains the credentials for the first FSx for Data ONTAP file system.|
105
+
|fileSystem2ID|No|The ID of the second FSx for Data ONTAP file system to ingest the audit logs from.|
106
+
|fileSystem2SecretARN|No|The ARN of the secret that contains the credentials for the second FSx for Data ONTAP file system.|
107
+
|fileSystem3ID|No|The ID of the third FSx for Data ONTAP file system to ingest the audit logs from.|
108
+
|fileSystem3SecretARN|No|The ARN of the secret that contains the credentials for the third FSx for Data ONTAP file system.|
109
+
|fileSystem4ID|No|The ID of the forth FSx for Data ONTAP file system to ingest the audit logs from.|
110
+
|fileSystem4SecretARN|No|The ARN of the secret that contains the credentials for the forth FSx for Data ONTAP file system.|
111
+
|fileSystem5ID|No|The ID of the fifth FSx for Data ONTAP file system to ingest the audit logs from.|
112
+
|fileSystem5SecretARN|No|The ARN of the secret that contains the credentials for the fifth FSx for Data ONTAP file system.|
113
+
| statsName | Yes| The name you want to use as the stats file. |
114
+
| logGroupName | Yes| The name of the CloudWatch log group to ingest the audit logs into. |
115
+
| volumeName | Yes| The name of the volume, on all the FSx for ONTAP file systems, where the audit logs are stored. |
116
+
117
+
**NOTE:** You only need to set the `fsxnSecretARNsFile` or the `fileSystemXID` and `fileSystemXSecretARN` variables.
118
+
If both are provide, then the `fsxnSecretARNsFile` will be used and the `fileSystemXID` and `fileSystemXSecretARN` variables will be ignored.
102
119
103
120
4. Test the Lambda function by clicking on the `Test` tab and then clicking on the `Test` button. You should see "Executing function: succeeded".
104
121
If not, click on the "Details" button to see what errors there are.
@@ -110,7 +127,7 @@ set up your FSx for ONTAP file systems to rotate audit logs, and how up-to-date
110
127
111
128
## Author Information
112
129
113
-
This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-samples-scripts/graphs/contributors).
130
+
This repository is maintained by the contributors listed on [GitHub](https://github.com/NetApp/FSx-ONTAP-utils/graphs/contributors).
114
131
115
132
## License
116
133
@@ -122,4 +139,4 @@ Unless required by applicable law or agreed to in writing, software distributed
122
139
123
140
See the License for the specific language governing permissions and limitations under the License.
0 commit comments