Bug 2124732

Summary: CVE-2022-3146 tripleo-ansible: /etc/openstack/clouds.yaml got 644 permission [openstack-16.1]
Product: Red Hat OpenStack Reporter: Takashi Kajinami <tkajinam>
Component: tripleo-ansibleAssignee: Takashi Kajinami <tkajinam>
Status: CLOSED ERRATA QA Contact: Joe H. Rahme <jhakimra>
Severity: high Docs Contact:
Priority: high    
Version: 16.1 (Train)CC: astupnik, bshephar, drosenfe, jhakimra, jschluet, mburns, mrelewicz, ntait, ramishra, sgolovat, tkajinam, tmurray
Target Milestone: asyncKeywords: Security, SecurityTracking, Triaged
Target Release: 16.1 (Train on RHEL 8.2)   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: tripleo-ansible-0.5.1-1.20220114163454.el8ost Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2123767 Environment:
Last Closed: 2022-10-17 10:20:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2123767    
Bug Blocks: 2124721    

Description Takashi Kajinami 2022-09-07 00:43:42 UTC
+++ This bug was initially created as a clone of Bug #2123767 +++

Description of problem:

there is a file:
(undercloud) [stack@undercloud ~]$ ls -lah /etc/openstack/clouds.yaml
-rw-r--r--. 1 root root 582 Aug 22 11:41 /etc/openstack/clouds.yaml
which consists plaintext passwords to undercloud and overcloud clouds and it can be read by anyone.

it comes from
sudo grep -r tripleo_keystone_resources_clouds_file_path /usr/
/usr/share/ansible/roles/tripleo-keystone-resources/defaults/main.yml:tripleo_keystone_resources_clouds_file_path: /etc/openstack/clouds.yaml
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:- name: "Check if {{ tripleo_keystone_resources_clouds_file_path }} exists"
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:    path: "{{ tripleo_keystone_resources_clouds_file_path }}"
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:- name: "Create empty {{ tripleo_keystone_resources_clouds_file_path }} if it does not exist"
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:    dest: "{{ tripleo_keystone_resources_clouds_file_path }}"
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:- name: "Configure {{ tripleo_keystone_resources_clouds_file_path }}"
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:    tripleo_config_dest: "{{ tripleo_keystone_resources_clouds_file_path }}"
/usr/share/ansible/roles/tripleo-keystone-resources/tasks/clouds.yml:    tripleo_config_src: "{{ tripleo_keystone_resources_clouds_file_path }}"

Version-Release number of selected component (if applicable):


How reproducible:
always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 David Rosenfeld 2022-10-06 17:06:56 UTC
The file has the expected permissions:

[stack@undercloud-0 ~]$ ls -lah /etc/openstack/clouds.yaml
-rw-------. 1 root root 595 Oct  6 16:27 /etc/openstack/clouds.yaml

Comment 5 errata-xmlrpc 2022-10-17 10:20:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Red Hat OpenStack Platform (tripleo-ansible) security update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2022:6969