fix: Improve the SHARR notification messages to include more relevant info for administrators receiving the events #185 #186
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
*Issue #185 *
Description of changes:
Added additional properties to the Notification that is sent by SHARR on the SNS Topic when a Remediation is initiated and it's state changes.
re: Testing ...This patch was pulled from a custom branch that I have been running in production for months now.
Added Properties:
account_alias
- the alias of theaccount_id
as returned from theorganizations.list_accounts
APIlink
- andhttp
link in the formhttps://console.aws.amazon.com/securityhub/home?region={finding.region}#/findings?search={finding.id}'
that provides a quick link to the full finding details.note
- theNote
field from the Finding. This is found by looking up the Finding by it's ARN in Security Hub (securityhub.get_findings
) and then reading theNote.Text
value from it.resource
- either theAffectedObject
from the the Notification payload, or the Resource Id from the Finding. This is very helpful when a batch of remediations are run to identify quickly which resource the remediation was for.Permissions Changes
securityhub:GetFindings
: required to lookup the Findings in Security Hub to get the Note off of it.note = ''
if there is any error in reading the finding.SolutionDeployStack
specifically for theSHARR_Orchestrator_Notifier
policy.organizations:ListAccounts
: required to look up the Account Alias for the Account Id which is the target of the remediation.account_alias
to theaccount_id
value so it is never empty.SolutionDeployStack
specifically for theSHARR_Orchestrator_Notifier
policy.Example Notifications:
Account Id changed to a dummy value for this comment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.