This feature allows messages to be sent to discord through it's built in Webhook functionality. Rather than utilizing a library, messages are sent to the webhook through node fetch requests. Thus, node-fetch has been added to the package.json file.
Files added:
A SendDiscord folder has been added in order to house this feature
A templates folder has been added for storing additional templates
The aws-event.yml file has been placed inside the templates folder, to easily display information about the AWS event.
The config-default.yml file has been added for users to input their personal Webhook URL's
The documentation.md file has been added for reference
The index.js file houses all of the logic for sending messages to the webhook.
To test this feature:
Reinstall the dependancies (to make sure node-fetch is available)
Follow the instructions in the documentation.md for the discord webhook setup
You can test this feature locally by running one of the three functions in the index.js file in the main directory
node index.js
Note: The remediation part of the tests will fail if you are running the tests locally. In order to fully test this feature, make sure to re-deploy your configuration and then do something in your AWS account that will trigger/break one of the rules (action.js). For example:
```
aws iam create-user --user-name noncompliantuser
```
The feature is working correctly if the notifications arriving in your discord channel match up with the SendDiscord commands in the actions.yml file located in the main directory.
Added discord functionality
Create Discord Ticket
This feature allows messages to be sent to discord through it's built in Webhook functionality. Rather than utilizing a library, messages are sent to the webhook through node fetch requests. Thus, node-fetch has been added to the package.json file.
Files added:
To test this feature:
Reinstall the dependancies (to make sure node-fetch is available)
Follow the instructions in the documentation.md for the discord webhook setup
You can test this feature locally by running one of the three functions in the index.js file in the main directory
Note: The remediation part of the tests will fail if you are running the tests locally. In order to fully test this feature, make sure to re-deploy your configuration and then do something in your AWS account that will trigger/break one of the rules (action.js). For example: