I am deploying a Python Flask application with Elastic Beanstalk. I have a config file /.ebextensions/01.config
where among other things I set some environment
You should be able to specify sensitive values as environment variables from eb web console: Your EB app -> Your EB environment -> Configuration -> Software Configuration -> Environment Properties
Alternatively, you can make use of this: http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-setenv.html