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

AWS SES notify: Copy in role lookup functions from dnsapi/dns_aws.sh #4742

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

kaaelhaa
Copy link

With this fix AWS SES notifier also works with container or instance roles.

Log output from test:

$ acme.sh --set-notify --notify-hook aws_ses --debug
[Wed Aug 16 13:55:00 UTC 2023] Lets find script dir.
[Wed Aug 16 13:55:00 UTC 2023] _SCRIPT_='/opt/acme/acme.sh'
[Wed Aug 16 13:55:00 UTC 2023] _script='/opt/acme/acme.sh'
[Wed Aug 16 13:55:00 UTC 2023] _script_home='/opt/acme'
[Wed Aug 16 13:55:00 UTC 2023] Using config home:/opt/acme/config
https://github.com/acmesh-official/acme.sh
v3.0.7
[Wed Aug 16 13:55:00 UTC 2023] Running cmd: setnotify
[Wed Aug 16 13:55:00 UTC 2023] Using config home:/opt/acme/config
[Wed Aug 16 13:55:00 UTC 2023] default_acme_server
[Wed Aug 16 13:55:00 UTC 2023] ACME_DIRECTORY='https://acme.zerossl.com/v2/DV90'
[Wed Aug 16 13:55:00 UTC 2023] Set notify hook to: aws_ses
[Wed Aug 16 13:55:00 UTC 2023] Sending via: aws_ses
[Wed Aug 16 13:55:00 UTC 2023] Found /opt/acme/notify/aws_ses.sh for aws_ses
[Wed Aug 16 13:55:00 UTC 2023] _statusCode='0'
[Wed Aug 16 13:55:00 UTC 2023] No ECS environment variable detected
[Wed Aug 16 13:55:00 UTC 2023] _url='http://169.254.169.254/latest/meta-data/iam/security-credentials/'
[Wed Aug 16 13:55:00 UTC 2023] GET
[Wed Aug 16 13:55:00 UTC 2023] url='http://169.254.169.254/latest/meta-data/iam/security-credentials/'
[Wed Aug 16 13:55:00 UTC 2023] timeout=1
[Wed Aug 16 13:55:00 UTC 2023] _CURL='curl --silent --dump-header /opt/acme/config/http.header  -L  -g  --connect-timeout 1'
[Wed Aug 16 13:55:00 UTC 2023] ret='0'
[Wed Aug 16 13:55:00 UTC 2023] GET
[Wed Aug 16 13:55:00 UTC 2023] url='http://169.254.169.254/latest/meta-data/iam/security-credentials/'
[Wed Aug 16 13:55:00 UTC 2023] timeout=1
[Wed Aug 16 13:55:00 UTC 2023] _CURL='curl --silent --dump-header /opt/acme/config/http.header  -L  -g  --connect-timeout 1'
[Wed Aug 16 13:55:00 UTC 2023] ret='0'
[Wed Aug 16 13:55:00 UTC 2023] _aws_role='REDACTED'
[Wed Aug 16 13:55:00 UTC 2023] GET
[Wed Aug 16 13:55:00 UTC 2023] url='http://169.254.169.254/latest/meta-data/iam/security-credentials/REDACTED'
[Wed Aug 16 13:55:00 UTC 2023] timeout=1
[Wed Aug 16 13:55:00 UTC 2023] _CURL='curl --silent --dump-header /opt/acme/config/http.header  -L  -g  --connect-timeout 1'
[Wed Aug 16 13:55:00 UTC 2023] ret='0'
[Wed Aug 16 13:55:00 UTC 2023] _aws_creds='[hidden](please add '--output-insecure' to see this value)'
[Wed Aug 16 13:55:00 UTC 2023] mtd='POST'
[Wed Aug 16 13:55:00 UTC 2023] ep
[Wed Aug 16 13:55:00 UTC 2023] qsr
[Wed Aug 16 13:55:00 UTC 2023] data='Action=SendEmail&Source=ACME <REDACTED>&Destination.ToAddresses.member.1=REDACTED&Message.Subject.Data=Hello, this is a notification from acme.sh by REDACTED&Message.Body.Text.Data=If you receive this message, your notification works.'
[Wed Aug 16 13:55:00 UTC 2023] _H2='Authorization: AWS4-HMAC-SHA256 Credential=REDACTED/eu-central-1/ses/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token, Signature=REDACTED'
[Wed Aug 16 13:55:00 UTC 2023] POST
[Wed Aug 16 13:55:00 UTC 2023] _post_url='https://email.eu-central-1.amazonaws.com/'
[Wed Aug 16 13:55:00 UTC 2023] _CURL='curl --silent --dump-header /opt/acme/config/http.header  -L  -g '
[Wed Aug 16 13:55:01 UTC 2023] _ret='0'
[Wed Aug 16 13:55:01 UTC 2023] aws_ses Success

Fixes #4741

Fixes AWS SES notify module does not work with instance roles acmesh-official#4741
@github-actions
Copy link

Welcome
Please make sure you're read our Code-of-conduct and add the usage here: notify.
Then reply on this message, otherwise, your code will not be reviewed or merged.
We look forward to reviewing your Pull request shortly ✨

@kaaelhaa
Copy link
Author

Code of conduct read and accepted.

No documentation changes required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant