I hereby claim:
- I am cowholio4 on github.
- I am cowholio4 (https://keybase.io/cowholio4) on keybase.
- I have a public key ASCijpENE-FChp_g-h8STQiOl-diTVZHgIbpmeVROcYdiAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| class Webhooks::SeclyticsController < ApplicationController | |
| skip_before_filter :require_login, :strict_transport_security | |
| def create | |
| # check if verification | |
| hook_secret = request.headers['X-Hook-Secret'] | |
| if hook_secret == Settings.seclytics_webhook_shared_secret | |
| response.headers['X-Hook-Secret'] = hook_secret | |
| return render plain: "OK", status: 201 | |
| end |
| def is_spam(event, context): | |
| ses_notification = event['Records'][0]['ses'] | |
| message_id = ses_notification['mail']['messageId'] | |
| receipt = ses_notification['receipt'] | |
| print('Processing message:', message_id) | |
| is_spam = (receipt['spamVerdict']['status'] == 'FAIL' or | |
| receipt['virusVerdict']['status'] == 'FAIL') | |
| if is_spam: | |
| print('SPAM message:', message_id) |
| dependencies: | |
| pre: | |
| - sudo apt-get update | |
| - sudo apt-get install build-essential python-dev libffi-dev libssl-dev | |
| - sudo pip install urllib3[secure] | |
| - sudo pip install awsebcli | |
| machine: | |
| environment: | |
| APP_ENV: "circle" | |
| ruby: |