zalando-stups / senza

Deploy immutable application stacks and create and execute AWS CloudFormation templates in a sane way

Home Page:https://pypi.python.org/pypi/stups-senza

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong base64 encoding for userdata

lmineiro opened this issue · comments

commented

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.