-
Notifications
You must be signed in to change notification settings - Fork 112
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
[BUG] Mail is not triggered when configured with AWS SES #184
Comments
Hi @Errahulaws, Thanks for writing in. Lets see if we can get to the bottom of this. Just for initial clarification, you are trying to trigger an AWS key Canarytoken that you have created on your own Canarytokens server. This private Canarytokens server is configured with AWS SES SMTP settings for email notifications? Is all this information correct? We can start to check where the break is by determining whether the AWS key Canarytoken is reporting to your server and your server is failing to send through the notification? Or, is the AWS key Canarytoken trigger not making it to your server? For this we can do a couple quick checks;
Please let me know how those tests go |
@jayjb Apology for the late reply. |
@jayjb I did tried with the Web Bug and it does not work. I tried direct access but no alert has been triggered. |
Hi @Errahulaws. Thanks for doing that test. The final thing we need to confirm is whether:
For 1, For 2, we have already confirmed 1. So now we can try check the logging of the Canarytokens server running in the foreground once the server receives the request. It should give you some indication of why it does not send the alert - perhaps an exception or missing settings warning. |
@jayjb testing all these over private IP and accessing url using private IP. here is the logs when I try to access the Web Bug URL frontend | INFO: :46602 - "POST /d3aece8093b71007b5ccfedad91ebb11/generate HTTP/1.0" 200 OK I do have username and password defined in |
Thanks for the logs @Errahulaws. I just want to check the verified AWS user for your SES is |
@jayjb No, I am completely unsure from where its coming. We have not defined such username in switchboard or frontend env file. Usually SES username is AccessKey which we get while configuring it. |
@Errahulaws: in your initial post about your Switchboard.env you have
Just as an fyi. I'm going to have to setup SES to test what could be going wrong. There is an opportunity to create a very useful PR where we handle AWS SES on its own (without trying to use it through general SMTP). |
@jayjb yes, but I guess that is just the Display name of From address. not username. |
Hi @jayjb Any luck on this. |
Hi @Errahulaws ! Are you able to create an AWS token through self-hosted version? Because each time I try to create AWS canary token I get a |
@OlesYudin Yes, You need to deploy the AWS infra like internet Gateways and Lambda to get it work separately. This does not get deployed when you run the docker |
I think that the AWS token works on Thinkst infrastructure, doesn't it? So to get it to work, I need to manually deploy some resource using Terraform and than canarytoken will automatically create IAM creds in my infrastructure, am I correct? |
@Errahulaws Recently we have very similar issue with AWS SES. So, I would recommend you try to create an SES user with the help of AWS and try to avoid a "managed user". |
@OlesYudin yes that'c correct. |
@jayjb I have been trying hard on this. There are two key points I would like to highlight
The error Got fixed after I put actual email of main. Can we have this issues fixed. |
@jayjb I have raised PR for Display Name issue. |
Hi @Errahulaws, Thanks so much for figuring out the issue. Looking at the PR, there is a slight issue. The error you are hitting is AWS SES specific. So the PR change would mean that everyone using the canarytokens build would have their emails (from display) changed under their feet. I'll comment in the PR and lets see if we can find something that works for everyone. |
Describe the bug
Configured the SMTP settings in switchboard.env with all required details, still when we use the AWS token where mail is set for alert is not triggered.
I have deployed the setup in my own EC2 instance.
Expected behavior
When I access the Token generated from UI, it should have trigger the mail.
Desktop (please complete the following information):
Additional context
Here is my switchboard.env
`# Required Settings
CANARY_PUBLIC_DOMAIN=<SERVER_IP> #str
CANARY_WG_PRIVATE_KEY_SEED=<PRIVATE_KEY_SEED_ENCODED> #str
LOG_FILE=switchboard.log #str
Optional Settings (these have sane defaults)
#CANARY_CHANNEL_DNS_IP= #str
#CANARY_CHANNEL_DNS_PORT= #int
#CANARY_CHANNEL_HTTP_PORT= #int
#CANARY_CHANNEL_SMTP_PORT= #int
#CANARY_CHANNEL_MYSQL_PORT= #int
#CANARY_CHANNEL_MTLS_KUBECONFIG_PORT= #int
#CANARY_CHANNEL_WIREGUARD_PORT= #int
#CANARY_SWITCHBOARD_SCHEME= #["https", "http"]
#CANARY_FORCE_HTTPS= #bool
#CANARY_REAL_IP_HEADER= #str
#CANARY_WG_PRIVATE_KEY_N= #str
Email Alert Settings
CANARY_ALERT_EMAIL_FROM_ADDRESS=<MY_EMAIL> #str
CANARY_ALERT_EMAIL_FROM_DISPLAY="CanartAlert" #str
CANARY_ALERT_EMAIL_SUBJECT="CanaryAlert-Token-Used" #str
Alert Settings
#CANARY_MAX_ALERTS_PER_MINUTE= #int
#CANARY_MAX_ALERT_FAILURES= #int
3rd Party Settings
#CANARY_IPINFO_API_KEY= #str
Mailgun Required Settings
#CANARY_MAILGUN_API_KEY= #str
#CANARY_MAILGUN_BASE_URL= #str
#CANARY_MAILGUN_DOMAIN_NAME= #str
Sendgrid Required Settings
#CANARY_SENDGRID_API_KEY= #str
#CANARY_SENDGRID_SANDBOX_MODE= #str
SMTP Required Settings
CANARY_SMTP_USERNAME="<SMTP_USERNAME>" #str
CANARY_SMTP_PASSWORD="<SMTP_PASSWORD>" #str
CANARY_SMTP_SERVER=email-smtp.ap-south-1.amazonaws.com #str
CANARY_SMTP_PORT=587 #str
Sentry Settings
#CANARY_SENTRY_DSN= #str
#CANARY_SENTRY_ENVIRONMENT= #["prod", "staging", "dev", "ci", "local"]
#CANARY_SENTRY_ENABLE= #bool
Logging Settings
#CANARY_SWITCHBOARD_LOG_SIZE= #int
#CANARY_SWITCHBOARD_LOG_COUNT= #int
#ERROR_LOG_WEBHOOK= #str
#CANARY_TOKEN_RETURN= #["gif", "fortune"]`
The text was updated successfully, but these errors were encountered: