Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Support S3 event notifications #4

Open
eugene100 opened this issue Nov 15, 2020 · 1 comment
Open

[FEATURE] Support S3 event notifications #4

eugene100 opened this issue Nov 15, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@eugene100
Copy link

Problem:
I'm going to implement the next scenario. When a new file uploaded to S3 bucket it should be checked by AV. S3 event notifications can send messages to a SQS notification queue, but format of a message is different than mousetrap expected.

Suggested solution::
Add extra validation for message what expected S3 message pattern: "eventSource": "aws:s3"

Example of S3 message:

{
    "Records": [
        {
            "eventVersion": "2.1",
            "eventSource": "aws:s3",
            "awsRegion": "us-east-1",
            "eventTime": "2020-11-15T17:03:43.718Z",
            "eventName": "ObjectCreated:Put",
            "userIdentity": {
                "principalId": "AWS:xxx"
            },
            "requestParameters": {
                "sourceIPAddress": "4.79.40.174"
            },
            "responseElements": {
                "x-amz-request-id": "7F3CBD63501C6716",
                "x-amz-id-2": "IETQzK13GB6UwPKyHVA20DqxsSHOVy9O5jtPronMbykSLJzErxPghyzGbKmeQnZ7vfBHXoe1Y2JFcSfjlI5hmq1z6S3JBO2M"
            },
            "s3": {
                "s3SchemaVersion": "1.0",
                "configurationId": "eugene-av",
                "bucket": {
                    "name": "eugene-av",
                    "ownerIdentity": {
                        "principalId": "A277FPSBMIAL09"
                    },
                    "arn": "arn:aws:s3:::eugene-av"
                },
                "object": {
                    "key": "photo_2020-10-29_19-20-49.jpg",
                    "size": 30573,
                    "eTag": "f9ee8886f30bd40963d327ef2d81a1f3",
                    "sequencer": "005FB15F7536F961A3"
                }
            }
        }
    ]
}
@amitlt
Copy link
Contributor

amitlt commented Nov 23, 2020

Sounds like an excellent addition 👍

@amitlt amitlt added the enhancement New feature or request label Nov 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants