bad security practices in getting started
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openstack-api-site |
Triaged
|
Medium
|
Unassigned |
Bug Description
This bug tracker is for errors with the documentation, use the following as a template and remove or add fields as you see fit. Convert [ ] into [x] to check boxes:
- [ ] This doc is inaccurate in this way: ______
- [ ] This is a doc addition request.
- [x] I have a fix to the document that I can paste below including example: input and output.
If you have a troubleshooting or support issue, use the following resources:
- Ask OpenStack: http://
- The mailing list: http://
- IRC: 'openstack' channel on Freenode
-------
Release: 0.1 on 2017-09-14 19:40
SHA: 8fa4937999220a9
Source: https:/
URL: https:/
In the spirit of contributing something while my other bug around the getting started project is considered its been a bugbear of mine to see a new tutorial advocating hardcoding the credentials into code (which may then be checked into a public repo on github/bitbucket etc).
Instead of...
# step-1
from libcloud.
from libcloud.
auth_username = 'your_auth_
auth_password = 'your_auth_
auth_url = 'http://
project_name = 'your_project_
region_name = 'your_region_name'
provider = get_driver(
conn = provider(
How about suggesting
# step-1
import os
from libcloud.
from libcloud.
def get_env_var(name):
if name in os.environ:
return os.environ[name]
else:
prompt_text = "{0} was not set, maybe you haven't set your Openstack credentials?\nEnter a value for {0}: ".format(name)
temp = raw_input(
return temp
auth_username = get_env_
auth_password = get_env_
auth_url = get_env_
auth_url = auth_url.
project_name = get_env_
region_name = get_env_
provider = get_driver(
conn = provider(
I'm not great at python so maybe a more pythonesque solution is possible but this certainly worked well enough for me and would encourage more secure default behaviour.
Changed in openstack-api-site: | |
status: | New → Triaged |
importance: | Undecided → Medium |