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
+18-12Lines changed: 18 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,7 @@ the appropriate NAS auditing configuration enabled.
9
9
It will maintain a "stats" file in an S3 bucket that will keep track of the last time it successfully ingested audit logs from each
10
10
SVM to try to ensure it doesn't process an audit file more than once.
11
11
You can run this script as a standalone program or as a Lambda function. These directions assume you are going to run it as a Lambda function.
12
+
12
13
**NOTE**: There are two ways to install this program. Either with the [CloudFormaiton script](cloudformation-template.yaml) found this this repo,
13
14
or by following the manual instructions found in the [README-MANUEL.md](README-MANUAL.md) file.
14
15
@@ -23,23 +24,27 @@ ensure you have set up a rotation schedule. The program will only act on audit l
23
24
[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.
24
25
- Have the NAS auditing configured to store the audit logs in a volume with the same name in all SVMs on all the FSx for Data ONTAP file
25
26
systems that you want to ingest the audit logs from.
26
-
- An AWS Secrets Manager secret that contains the credentials you want to use to obtain the NAS Audit logs with for all the FSxN file systems.
27
+
- An AWS Secrets Manager secret that contains the credentials for all the FSxNs you want to use to obtain the NAS Audit logs from.
27
28
- The secret should be in the form of key/value pairs where the key is the file system ID and value is a dictionary with the keys `username` and `password`. For example:
- You have applied the necessary SACLs to the files you want to audit. The knowledge base article linked above provides guidance on how to do this.
35
36
36
-
You can either create the following items before running the CloudFormaiton script, or allow it to create the items for you.
37
-
- AWS Endpoints. Since the Lambda function runs within your VPC it will not have access to the Internet, even if you can access the Internet from the Subnet it runs from.
38
-
Therefore, there needs to be an VPC endpoint for all the AWS services that the Lambda function uses. Specifically, the Lambda function needs to be able to access the following AWS services:
37
+
**You can either create the following items before running the CloudFormaiton script, or allow it to create the items for you.**
38
+
39
+
- AWS Endpoints. Since the Lambda function runs within your VPC it will not have access to the Internet, even if you can access the Internet
40
+
from the Subnet it runs from. Although, if you are using an AWS Transit Gateway, you can configure it to allow the Lambda function to access the Internet.
41
+
If you don't have a Transit Gateway then there needs to be an VPC endpoint for all the AWS services that the Lambda function uses.
42
+
Specifically, the Lambda function needs to be able to access the following AWS services:
39
43
- FSx.
40
44
- Secrets Manager.
41
45
- CloudWatch Logs.
42
-
- S3 - Note that typically there is a Gateway type VPC endpoint for S3, so you should not need to create a VPC endpoint for S3.
46
+
- S3 - Note that typically there is a Gateway type VPC endpoint for S3, therefore you typically you don't need to create a VPC endpoint for S3.
47
+
43
48
- Role for the Lambda function. Create a role with the necessary permissions to allow the Lambda function to do the following:
44
49
45
50
<!--- Using HTML to create a table that has rowspan attributes since the markdown table syntax does not support that. --->
@@ -75,7 +80,8 @@ and `DeleteNetworkInterface` actions. The correct resource line is `arn:aws:ec2:
75
80
1. Go to the CloudFormation page within the AWS console and click on the `Create stack -> With new resources` button.
76
81
1. Select the `Upload a template file` radio button and click on the `Choose file` button. Select the `cloudformation-template.yaml` that you downloaded in step 1.
77
82
1. Click on the `Next` button.
78
-
1. The next page will provide all the configuration parameters you can provide. Some are required, and some aren't
83
+
1. The next page will provide all the configuration parameters you can provide:
84
+
79
85
|Parameter|Required|Description|
80
86
|---|---|--|
81
87
|Stack Name|Yes|The name of the CloudFormation stack. This can be anything, but since it is used as a suffix for some of the resources it creates, keep it under 40 characters.|
@@ -99,20 +105,20 @@ and `DeleteNetworkInterface` actions. The correct resource line is `arn:aws:ec2:
99
105
|vpcId|No|This is the VPC that the endpoint(s) will be created in. Only needed if you are creating an endpoint.|
100
106
|endpointSecurityGroupIds|No|The security group that the endpoint(s) will be associated with. Only needed if you are creating an endpoint.|
101
107
1. Click on the `Next` button.
102
-
1. The next page will provide for some additional configuration options. You can leave these as the default values. At the bottom of the page, there is a checkbox that you must check to allow the CloudFormation script to create the necessary IAM roles and policies.
108
+
1. The next page will provide for some additional configuration options. You can leave these as the default values. At the bottom of the page, there is a checkbox that you must check to allow the CloudFormation script to create the necessary IAM roles and policies. Note that if you have provided the ARN to the two required roles, then the CloudFormation script will not create any roles.
103
109
1. Click on the `Next` button.
104
110
1. The next page will provide a summary of the configuration you have provided. Review it to ensure it is correct.
105
111
1. Click on the `Create stack` button.
106
112
107
113
## After deployment tasks
108
114
### Confirm that the Lambda function is ingesting audit logs.
109
-
After the CloudFormation script has completed, go to the "resource" tab of the CloudFormation stack and click on the Lambda function hyperlink.
115
+
After the CloudFormation deployment has completed, go to the "resource" tab of the CloudFormation stack and click on the Lambda function hyperlink.
110
116
This will take you to the Lambda function's page.
111
-
Click on the Monitoring sub tab and then click on "View CloudWatch logs". This will take you to the CloudWatch log group that the Lambda function
112
-
is writing its diagnostic output to. You should see a log stream. If you don't, wait a few minutes, and then refresh the page. If you still don't
117
+
Click on the Monitoring sub tab and then click on "View CloudWatch logs". This will take you to the CloudWatch log group where the Lambda function
118
+
writes its diagnostic output to. You should see a log stream. If you don't, wait a few minutes, and then refresh the page. If you still don't
113
119
see a log stream, check the Lambda function's configuration to ensure it is correct. Once a log stream appears, click on it to see the diagnostic
114
120
output from the Lambda function. You should see log messages indicating that it is ingesting audit logs. If you see any "Errors" then you will
115
-
need to investigate and correct the issue. If you can't figure it out, please open an issue in this repository.
121
+
need to investigate and correct the issue. If you can't figure it out, please open an [issue](https://github.com/NetApp/FSx-ONTAP-samples-scripts/issues) in this repository.
0 commit comments