Proactive Notifications
Proactive Notifications

The Dashboard is a great resource to monitor your environment while you are using the console. For all the times you are not in front of the console, it is critically important you are made aware of any system notifications such as problem file scan results. Scan Results which could identify infected or unscannable files is the most critical, but other system messages may be important enough for you to follow as well. The other types of information we notify on is: public / private status of buckets, newly discovered buckets, protection turned on / off for buckets, availability of system updates, trial expiration and low prepaid data counts. With this in mind, a Notifications SNS Topic is provided where Antivirus for Amazon S3 publishes these useful messages. You can simply subscribe to the Topic with the protocol (HTTP, HTTPS, Email, Email-JSON, Amazon SQS, AWS Lambda, Platform Application Endpoint, SMS) of your choice.
All notification messages we generate will have a Notification Type attribute as well as possible secondary attributes. These attributes along with their values can be leveraged for filtering the messages down. Along with the notification type attribute, there are other message attributes such as scanResult, bucket and account. AWS SNS subscription filtering works in an and fashion with additional attributes. Or functionality is supported within attribute values, but as soon as you have more than one attribute those behave as and. This is critical to be aware of as you may add combinations that will never occur and therefore never receive the messages you are expecting.
We have made our wizard so you cannot make these unusable combinations. The filtering that is allowed:
- notificationType - on its own this is the highest level (generic) filter - You can get all scan results but just setting this attribute to - scanResult, but you may truly not want all scan results, just- infected
- Possible values - [scanResult, largeFileScan, bucketsDiscovered, bucketProtection, bucketCrawling, bucketsPublicAccess, bucketAutoProtectionFailed, updatesAvailable, lowPrepaidData, trialExpiring] 
 
- scanResult - allows you to filter by the result itself - You can filter by one or more values - [Clean, Infected, Unscannable, Error, InfectedAllowed] 
 
- bucket - filter by a particular bucket name - Useful if you want different subscriptions/notifications for different buckets to have different outcomes or go to different teams 
 
- account - filter by account number - For multi-account environments this allows you to filter at the account level 
- Similar to bucket, you could have different processes or teams responsible at the account level and so need separate subscriptions to notify those particular teams 
 
Message Types
All possible message information:
notificationType
You can get all scan results but just setting this attribute to scanResult, but you may truly not want all scan results, just Infected
Possible values:
- scanResult 
- largeFileScan 
- bucketsDiscovered 
- bucketProtection 
- bucketCrawling 
- bucketsPublicAccess 
- bucketAutoProtectionFailed 
- updatesAvailable 
- lowPrepaidData 
- trialExpiring 
scanResult
Secondary attribute to allow filtering by the scan result itself Possible values:
- Infected 
- Error 
- Unscannable 
- Clean 
- InfectedAllowed 
bucket
Secondary attribute to provide filtering by bucket name. Useful if you want different subscriptions/notifications for different buckets to have different outcomes or go to different teams. You can provide more than 1 bucket name if desired in a comma separate list.
Possible values: your_bucket_name(s)
accountID
For multi-account environments this allows you to filter at the account level. Similar to bucket, you could have different processes or teams responsible at the account level and so need separate subscriptions to notify those particular teams. Can be used with scanResult, bucketsDiscovered, bucketProtection, bucketCrawling, bucketPublicAccess
Proper Combinations
Proper combinations can be:
- notificationType, 
- notificationType['scanResult'] + scanResult['Infected', 'Clean', 'Unscannable', 'Error', 'InfectedAllowed`], - notificationType + scanResult + bucket[' < bucket-name(s) >'], 
- notificationType + scanResult + account['< account-number(s) >'], 
 
- notificationType['scanResult'] + bucket['< bucket-name(s) >'], 
- notificationType[any but updatesAvailable|lowPrepaidData|trialExpiring] + account['< account-number(s) >'], 
Example
You may want your Support/IR team to be informed of infected files only so you setup a subscription that filters down to scanResult = Infectedand gets sent to their emails or distribution list.
While classsificaton results of Error and Unscannable may get filtered down and sent to your infrastructure team since both of those results typically relate to access issues (either KMS related, password protection, file extension reading software, etc).
You may want yet another subscription that either captures all scanResults messages or just the Clean ones so you capture your own audit log of those files. So the endpoint could be an email not responded to or an application that gathers all this data.
Here is a sample message so you can see the format that gets sent. More samples for the other notification types below.
{
    "Type" : "Notification",
    "MessageId" : "45927ed5-6884-542e-96c6-27777317db99",
    "TopicArn" : "arn:aws:sns:eu-west-1:<account-number>:CloudStorageSecNotificationsTopic-pxlhbmh",
    "Subject" : "AV-for-S3: Infected object found",
    "Message" : "{\"guid\":\"a59f0da2-0fdd-4667-b272-618d79cd520d\",\"dateScanned\":\"2021-08-26T22:44:34.5595461Z\",\"bucketName\":\"css-protect-versioning\",\"key\":\"infected_bill.pdf\",\"versionId\":\"ohjRhn8aiPIjVTU1T6xOKWoJBR8i0v0w\",\"result\":1,\"scanResults\":[{\"result\":\"Infected\",\"virusName\":[\"Win.Ransomware.WannaCry-6313787-0\"],\"message\":[],\"dateScanned\":\"2021-08-26T22:44:34.5595461Z\",\"engine\":\"ClamAV\",\"engineVersion\":\"0.103.3\",\"virusDbVersion\":\"26275\",\"scanType\":\"GoFwd\"},{\"result\":\"Infected\",\"virusName\":[\"Troj/PDFJs-AIA\"],\"message\":[\"infected_bill.pdf\"],\"dateScanned\":\"2021-08-26T22:44:33.3838187Z\",\"engine\":\"Sophos\",\"engineVersion\":\"3.82.1\",\"virusDbVersion\":\"5.86\",\"scanType\":\"GoFwd\"}],\"actionTaken\":\"Move\",\"virusUploadedBy\":\"AWS:AIDA2T7AZ3IMGHBWXMN4W\",\"fileExists\":true,\"movedTo\":\"cloudstoragesecquarantine-pxlhbmh-<account-number>-us-east-1\",\"region\":\"us-east-1\",\"accountId\":\"<account-number>\",\"allowOnceExemptionAdded\":false,\"permanentlyAllowed\":false}",
    "Timestamp" : "2021-08-26T22:44:35.049Z",
    "SignatureVersion" : "1",
    "Signature" : "or+H3m1RpSvHe3GlccGjnckSj13iz+mFYaEMjwKWuE3uFhytHUkc6cIxk4E3lI7GwtOmuxTCQgc9ms7c/yp+487Chh0IM3nLGCD7WWNaW3W/8BnpFg1wkWQoSAPIh4EuhYLEWMzqF1ldENp6SNGZpG60vYyS/vNx9GnA5nrRDwLfQ76HDlRq/PQpbnzBPleaW61TOsRRhKpVpNZ1dKTRECqCtP9Tgno12XURZ8Li4PQP/w3IJ6EPZOKrva7A2vaaOe4hRyx4lWSagHtigqZ9RMIsTBOFXrCwG3iXopUhnylDgtaeODyepXTUEMHzw931hRMmcjGT+h1epJ10mraA8Q==",
    "SigningCertURL" : "https://sns.eu-west-1.amazonaws.com/SimpleNotificationService-010a507c1833636cd94bdb98bd93083a.pem",
    "UnsubscribeURL" : "https://sns.eu-west-1.amazonaws.com/?Action=Unsubscribe&SubscriptionArn=arn:aws:sns:eu-west-1:<account-number>:CloudStorageSecNotificationsTopic-pxlhbmh:32f7008b-bf69-48c0-84fd-872b708f0037",
    "MessageAttributes" : {
        "bucket" : {"Type":"String","Value":"css-protect-versioning"},
        "accountId" : {"Type":"String","Value":"<account-number>"},
        "notificationType" : {"Type":"String","Value":"scanResult"},
        "scanType" : {"Type":"String","Value":"Api"},
        "scanResult" : {"Type":"String","Value":"Infected"},
        "scanResultKind" : {"Type":"String","Value":"NotApplicable"},
        "key" : {"Type":"String","Value":"filename.ext"}
    }
}Follow the steps below to set up your Topic Subscription utilizing an AWS provided protocol like email.
Create Subscription - Email Example
Subscribing to the real-time notifications sent out via our Notifications SNS Topic has been simplified by the wizard provided. You can still manually set this up if desired, read below these instructions. Creating through the form still requires you to confirm the subscription.
- Click the - Add Subscriptionbutton 
- The - Add Proactive Notifications Subscriptionpopup will appear 
- Specify the - Notification Typeof choice - for our example we will choose- ScanResu - Note: After selecting the - Notification Typeyou will be presented other fields to populate. At a minimum, you must specify a- Protocoland- Endpoint. The other fields can be populated as described above.
- Choose - Emailas the protocol and enter your email address - Note: If you left it as seen here, every scan result (clean, infected, unscannable, error and infectedAllowed) would be sent to your email. Generally, you may want to limit down to - infectedand- unscannableto limit the number of emails received. This is up to your requirements, so do as you see fit. As described above, you can filter the results by result, bucket or account and proper combinations of those.
- Specify - Scan Resultsvalues to limit emails sent 
- Click the - Add Subscriptionbutton 
- You will now see a new entry in the table list showing as - Pendingunder status 
- Check your email so you can confirm the subscription  
- Open the email and click the - Confirm subscriptionlink 
- This action will open a browser window showing subscription confirmation  
- Refresh the page list by clicking the little - Refreshbutton and you will see your new subscription confirmed 
You are all set now! Feel free to create more as needed for the different notifications needed.
Warning
AWS does not allow the same email address to be used for multiple subscriptions to the same topic. So you can leverage multiple addresses or you can use the "+" option most modern email providers (Gmail, O365, Exchange) support.
For example, instead of using [email protected] as I did in the example steps I could do the following:
- [email protected] for all scan results 
- [email protected] for system upgrade updates 
- [email protected] for notifications regarding new buckets or public buckets found 
- etc. 
If you'd like to perform these steps manually or see what is going on behind the scenes on the AWS side, expand the section below and read on. If the GUI was enough for you, then skip it.
Managing an existing subscription is easy. Simply click the action button ( ) to either
) to either Edit or Delete the subscription. Editing will allow you to make changes as are permitted to the subscription. Deleting will remove the subscription.

Sample Email Protocol Messages
Once you have confirmed your subscription as objects get scanned you will see in your Inbox as follows.

And here are the details of an infected email message received.

EventBridge Notifications
To send notifications to EventBridge, just go to Configuration > Console Settings > AWS EventBridge Proactive Notifications. Enable the toggle, specify an Event Bus (or leave the default) and click Save.
Send ScanResults notifications to CloudWatch logs:
- Setup Event Bus 

- Go to AWS EventBridge and Create a Rule for the Event Bus  - Create Rule 
- Create Rule: 
Step 1: Define rule detail

Step 2. Build Event Pattern
Leave the first options as they are and scroll down to the Event Pattern:

{
  "source": ["cloud-storage-security"],
  "detail-type": ["ScanResult"],
  "detail": {
    "MessageAttributes": {
      "scanResult": {
        "StringValue": ["Clean"]
      }
    }
  }
}Step 3. Select target(s)

Step 4. Configure tags - optional

Step 5. Review and update
Just review that everything is setup as expected, and Submit the rule.
- If you have already setup a Scan Result notification, you are good to go, otherwise setup a subscription for it as explained at the beggining of this page. 
- Scan a file, and check the Event Bridge log setup in CloudWatch:  - CloudWatch logs 

Slack Integration Setup
It is a simple process (that may sound more complicated than it is) that took under 10 minutes to setup. Simply follow the process laid out in the AWS blogpost talking about how to leverage webhooks seen here: AWS SNS + Slack / Teams / Chime setup
What it looks like in Slack. You can modify the format with Slack Message Layouts.

Sample Messages - JSON
Proactive Notifications

The Dashboard is a great resource to monitor your environment while you are using the console. For all the times you are not in front of the console, it is critically important you are made aware of any system notifications such as matching classification results. Classification Results which could identify classified data is the most critical, but other system messages may be important enough for you to follow as well. The other types of information we notify on is: public / private status of buckets, newly discovered buckets, protection turned on / off for buckets, availability of system updates, trial expiration and low prepaid data counts. With this in mind, a Notifications SNS Topic is provided where Classification for Amazon S3 publishes these useful messages. You can simply subscribe to the Topic with the protocol (HTTP, HTTPS, Email, Email-JSON, Amazon SQS, AWS Lambda, Platform Application Endpoint, SMS) of your choice.
All notification messages we generate will have a Notification Type attribute as well as possible secondary attributes. These attributes along with their values can be leveraged for filtering the messages down. Along with the notification type attribute, there are other message attributes such as classificationResult, bucket and account. AWS SNS subscription filtering works in an and fashion with additional attributes. Or functionality is supported within attribute values, but as soon as you have more than one attribute those behave as and. This is critical to be aware of as you may add combinations that will never occur and therefore never receive the messages you are expecting.
We have made our wizard so you cannot make these unusable combinations. The filtering that is allowed:
- NotificationType - on its own this is the highest level (generic) filter - You can get all classsification results by just setting this attribute to - ClassificationResult, but you may truly not want all classification results, just- matching
- Possible values - [ClassificationResult, BucketsDiscovered, BucketsPublicAccess, LowPrepaidData, TrialExpiring, UpdatesAvailable] 
 
- ClassificationResult - allows you to filter by the result itself - You can filter by one or more values - [Matching, NonMatching, Unclassifiable, Error] 
 
- Buckets - filter by a particular bucket name - Useful if you want different subscriptions/notifications for different buckets to have different outcomes or go to different teams 
 
- Accounts - filter by account number - For multi-account environments this allows you to filter at the account level 
- Similar to bucket, you could have different processes or teams responsible at the account level and so need separate subscriptions to notify those particular teams 
 
Message Types
All possible message information:
NotificationType
You can get all classification results but just setting this attribute to ClassificationResult, but you may truly not want all classification results, just matching
Possible values:
- BucketsDiscovered 
- BucketProtection 
- BucketsPublicAccess 
- BucketAutoProtectionFailed 
- LowPrepaidData 
- TrialExpiring 
- UpdatesAvailable 
ClassificationResult
Secondary attribute to allow filtering by the scan result itself Possible values:
- Matching 
- NonMatching 
- Unclassifiable 
- Error 
Buckets
Secondary attribute to provide filtering by bucket name. Useful if you want different subscriptions/notifications for different buckets to have different outcomes or go to different teams. You can provide more than 1 bucket name if desired in a comma separate list.
Possible values: your_bucket_name(s)
Accounts
For multi-account environments this allows you to filter at the account level. Similar to bucket, you could have different processes or teams responsible at the account level and so need separate subscriptions to notify those particular teams. Can be used with ClassificationResults, BucketsDiscovered, BucketProtection, BucketCrawling, BucketPublicAccess
Proper Combinations
Proper combinations can be:
- notificationType, 
- notificationType['classficationResult'] + classificationResult['Matching', 'NonMatching', 'Unclassifiable', 'Error'], - notificationType + classificationResult + bucket[' < bucket-name(s) >'], 
- notificationType + classificationResult + account['< account-number(s) >'], 
 
- notificationType['classificationResult'] + bucket['< bucket-name(s) >'], 
- notificationType[any but updatesAvailable|lowPrepaidData|trialExpiring] + account['< account-number(s) >'], 
Example
You may want your Support/IR team to be informed of infected files only so you setup a subscription that filters down to classsificatonResult = Matching and gets sent to their emails or distribution list.
While scan results of Error and Unclassifiable may get filtered down and sent to your infrastructure team since both of those results typically relate to access issues (either KMS related, password protection, file extension reading software, and non-text files)
You may want yet another subscription that either captures all classificationResult messages or just the NonMatching ones so you capture your own audit log of those files. So the endpoint could be an email not responded to or an application that gathers all this data.
Here is a sample message so you can see the format that gets sent. More samples for the other notification types below.
2022-05-20 16:08:50.7409|INFO|MatchingClassificationResults|{
    "date": "2022-05-20",
    "guid": "60ea309d-b0f5-4b14-a0a2-76ff49bd210f",
    "dateTime": "2022-05-20T16:08:50.716198Z",
    "accountId": "351727022968",
    "region": "us-east-1",
    "container": "class-trigger-bucket-3",
    "objectPath": "Employee List.xlsx",
    "innerFilePath": null,
    "textMatchingSet": [
        {
            "cclName": "SocialsecuritynumbersUSA",
            "score": 1,
            "triggered": true,
            "matchesCount": 1
        }
    ],
    "error": null,
    "resultType": 1
}Follow the steps below to set up your Topic Subscription utilizing an AWS provided protocol like email.
Create Subscription - Email Example
- Click the - Add Subscriptionbutton 
- The - Add Proactive Notifications Subscriptionpopup will appear 
- Specify the - Notification Typeof choice - for our example we will choose- ClassificationResult - Note: After selecting the - Notification Typeyou will be presented other fields to populate. At a minimum, you must specify a- Protocoland- Endpoint. The other fields can be populated as described above.
- Choose - Emailas the protocol and enter your email address - Note: If you left it as seen here, every scan result (clean, infected, unscannable, error and infectedAllowed) would be sent to your email. Generally, you may want to limit down to - infectedand- unscannableto limit the number of emails received. This is up to your requirements, so do as you see fit. As described above, you can filter the results by result, bucket or account and proper combinations of those.
- Specify - Classification Resultsvalues to limit emails sent 
- Click the - Add Subscriptionbutton 
- You will now see a new entry in the table list showing as - Pendingunder status 
- Check your email so you can confirm the subscription  
- Open the email and click the - Confirm subscriptionlink This action will open a browser window showing subscription confirmation  
- Refresh the page list by clicking the little - Refreshbutton and you will see your new subscription confirmed 
You are all set now! Feel free to create more as needed for the different notifications needed.
Warning
AWS does not allow the same email address to be used for multiple subscriptions to the same topic. So you can leverage multiple addresses or you can use the "+" option most modern email providers (Gmail, O365, Exchange) support.
For example, instead of using [email protected] as I did in the example steps I could do the following:
- [email protected] for all scan results 
- [email protected] for system upgrade updates 
- [email protected] for notifications regarding new buckets or public buckets found 
- etc. 
If you'd like to perform these steps manually or see what is going on behind the scenes on the AWS side, expand the section below and read on. If the GUI was enough for you, then skip it.
Manage Subscription
Managing an existing subscription is easy. Simply click the action button ( ) to either
) to either Edit or Delete the subscription. Editing will allow you to make changes as are permitted to the subscription. Deleting will remove the subscription.


Sample Email Protocol Messages
Once you have confirmed your subscription as objects get scanned you will see in your Inbox as follows:

And here are the details of an email message notification about discovering content in an object that is Matching one searched for by the chosen Classification rules. 
Slack Integration Setup
It is a simple process (that may sound more complicated than it is) that took under 10 minutes to setup. Simply follow the process laid out in the AWS blogpost talking about how to leverage webhooks seen here: AWS SNS + Slack / Teams / Chime setup
What it looks like in Slack. You can modify the format with Slack Message Layouts.

Email Reports
For customers who want a daily summary of Anti-Virus scanning sent to their inboxes, we offer the ability to send daily email reports detailing recently found threats. We show a brief report including types of problem files found, malware detected, and threats found in the last week.
Enable this feature in the Email Reports tab in the Configuration > Proactive Notifications page. Enter in a comma separated list of email recipients and click 'Save'. Daily Email Reports will now be sent to those addresses.

Here's an example of a daily Email Report.

Last updated




















