zalando-stups / senza

Deploy immutable application stacks and create and execute AWS CloudFormation templates in a sane way
https://pypi.python.org/pypi/stups-senza
Other
96 stars 71 forks source link

Wrong base64 encoding for userdata #540

Closed lmineiro closed 5 years ago

lmineiro commented 5 years ago

The Senza::Elastigroup component encodes the EC2 userdata script using base64.urlsafe_b64encode(). When the input contains the character >, the creation of the Elastigroup fails.

This happens because the URL implementation of Base64 encoding replaces the 62nd character with the character - instead of the expected +.

Botocore uses a different approach. This is the true base64 encoding.

Note: The patch command also uses the base64.urlsafe_b64encode() function. A brief test didn't show any error when using AWS Auto Scaling Group but it also caused the Elastigroup call to fail.