Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayobe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Very Demiurge Very Mindful
Kayobe
Commits
c4a5c464
Commit
c4a5c464
authored
6 years ago
by
Zuul
Committed by
Gerrit Code Review
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Always remove temporary file containing passwords"
parents
749ef824
7ca0cd0c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
ansible/roles/kolla-ansible/library/kolla_passwords.py
+6
-6
6 additions, 6 deletions
ansible/roles/kolla-ansible/library/kolla_passwords.py
releasenotes/notes/passwords-in-tmp-18e55d5e9b894b4d.yaml
+25
-0
25 additions, 0 deletions
releasenotes/notes/passwords-in-tmp-18e55d5e9b894b4d.yaml
with
31 additions
and
6 deletions
ansible/roles/kolla-ansible/library/kolla_passwords.py
+
6
−
6
View file @
c4a5c464
...
...
@@ -111,13 +111,13 @@ def kolla_passwords(module):
temp_file_path
=
create_named_tempfile
()
try
:
# Start with kolla's sample password file.
shutil
.
copy
2
(
module
.
params
[
'
sample
'
],
temp_file_path
)
shutil
.
copy
file
(
module
.
params
[
'
sample
'
],
temp_file_path
)
# If passwords exist, decrypt and merge these in.
if
module
.
params
[
'
src
'
]
and
os
.
path
.
isfile
(
module
.
params
[
'
src
'
]):
src_path
=
create_named_tempfile
()
try
:
shutil
.
copy
2
(
module
.
params
[
'
src
'
],
src_path
)
shutil
.
copy
file
(
module
.
params
[
'
src
'
],
src_path
)
if
module
.
params
[
'
vault_password
'
]:
vault_decrypt
(
module
,
src_path
)
kolla_mergepwd
(
module
,
src_path
,
temp_file_path
,
temp_file_path
)
...
...
@@ -142,7 +142,7 @@ def kolla_passwords(module):
if
module
.
params
[
'
vault_password
'
]:
dest_path
=
create_named_tempfile
()
try
:
shutil
.
copy
2
(
module
.
params
[
'
dest
'
],
dest_path
)
shutil
.
copy
file
(
module
.
params
[
'
dest
'
],
dest_path
)
vault_decrypt
(
module
,
dest_path
)
checksum_dest
=
module
.
sha1
(
dest_path
)
finally
:
...
...
@@ -162,10 +162,10 @@ def kolla_passwords(module):
if
changed
and
not
module
.
check_mode
:
module
.
atomic_move
(
temp_file_path
,
module
.
params
[
'
dest
'
])
except
Exception
as
e
:
try
:
module
.
fail_json
(
msg
=
"
Failed to generate kolla passwords: %s
"
%
repr
(
e
))
finally
:
if
os
.
path
.
isfile
(
temp_file_path
):
os
.
unlink
(
temp_file_path
)
finally
:
module
.
fail_json
(
msg
=
"
Failed to generate kolla passwords: %s
"
%
repr
(
e
))
if
not
module
.
check_mode
:
# Update the file's attributes.
...
...
This diff is collapsed.
Click to expand it.
releasenotes/notes/passwords-in-tmp-18e55d5e9b894b4d.yaml
0 → 100644
+
25
−
0
View file @
c4a5c464
---
security
:
-
|
Fixes an issue when generating the ``passwords.yml`` file for Kolla Ansible
where if the contents of the file have not changed, a plain text copy of the
file would be left in /tmp on the Ansible control host.
The temporary files are typically named /tmp/tmpXXXXXX, and are owned by the
user that runs kayobe, with permissions 664 (rw-rw-r--).
It is recommended to check any systems on which Kayobe has been run for
copies of the passwords file in /tmp. A simple check for this is `grep -rn
database_password /tmp`.
fixes
:
-
|
Fixes an issue when generating the ``passwords.yml`` file for Kolla Ansible
where if the contents of the file have not changed, a plain text copy of the
file would be left in /tmp on the Ansible control host.
The temporary files are typically named /tmp/tmpXXXXXX, and are owned by the
user that runs kayobe, with permissions 664 (rw-rw-r--).
It is recommended to check any systems on which Kayobe has been run for
copies of the passwords file in /tmp. A simple check for this is `grep -rn
database_password /tmp`.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment