Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1578572 - [RFE] Ceph-Ansible main.yml places restart scripts in /tmp - causing failures running restart scripts
[RFE] Ceph-Ansible main.yml places restart scripts in /tmp - causing failur...
Status: CLOSED ERRATA
Product: Red Hat Ceph Storage
Classification: Red Hat
Component: Ceph-Ansible (Show other bugs)
3.0
Unspecified Unspecified
high Severity medium
: z4
: 3.0
Assigned To: leseb
Vasishta
Erin Donnelly
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2018-05-15 17:21 EDT by Scoots Hamilton
Modified: 2018-07-11 14:12 EDT (History)
15 users (show)

See Also:
Fixed In Version: RHEL: ceph-ansible-3.0.34-1.el7cp Ubuntu: ceph-ansible_3.0.34-2redhat1
Doc Type: Bug Fix
Doc Text:
Previously, when running the "rolling_updates.yml" playbook, customers encountered permission errors resulting in failure of the playbook tasks. This was due to an underlying issue in the script. In Ceph environments where "/tmp" is mounted with "noexec", calling the execution of the restart script from the "/tmp" does not work. The script is now called using a binary outside of "/tmp" so the "noexec" does not apply, and the "rolling_updates.yml" playbook no longer fails.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-07-11 14:11:10 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Github ceph/ceph-ansible/pull/2591 None None None 2018-05-16 04:31 EDT
Red Hat Product Errata RHSA-2018:2177 None None None 2018-07-11 14:12 EDT

  None (edit)
Description Scoots Hamilton 2018-05-15 17:21:29 EDT
Description of problem:

When running the rolling_updates.yml playbook customers encounter permission errors, resulting in failure of the playbook tasks, for environments where the noexec flag has been set for the /tmp dir. 

The default tmp perms all for exec from that dir:

[quicklab@mgmt-0 /]$ ls -ld /tmp
drwxrwxrwt. 8 root root 169 May 15 16:30 /tmp

However:
Our security guide (https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html-single/security_guide/) mentions that it can be a security vulnerability to have the /tmp directory allow for exec permissions. So any customer who is following these recommendations will be subject to this error/issue. 


We are requesting that scripts which are critical to the execution of a playbook task be populated in an alternative directory, when possible.
Comment 3 leseb 2018-05-16 04:04:56 EDT
Which directory should be used instead of /tmp? What's the recommendation?
We can potentially make this directory configurable.
Comment 5 Scoots Hamilton 2018-05-16 09:50:29 EDT
(In reply to leseb from comment #3)
> Which directory should be used instead of /tmp? What's the recommendation?
> We can potentially make this directory configurable.

Leseb, to be completely honest, I am not sure what the best alternative for directory placement would be.

I was able to find this article:  https://access.redhat.com/blogs/766093/posts/3169121

And found the approach quite interesting, however I am *feel that integrating such a feature might not be feasible, or the most productive, for such situations. But it does seem to address the main issues that we are facing in environments where customers must adhere to stricter security measures, and harden their environments. 

I will continue searching for, and considering potential solutions to this problem. 


Cheers!
-Scoots
Comment 6 leseb 2018-05-16 09:55:20 EDT
Thanks for your response, I just backported a patch that will fix the issue. You will find it in tag v.3.0.34.

I suspect this will be part of the next z stream release for 3.0.

There is no need to dig further into this if you're interested in the solution is here: https://github.com/ceph/ceph-ansible/pull/2591/commits/628d4cc161f862001460300426481ba60953ddc3

Calling bash directly doesn't trigger the shebang which allows us to execute the script even though /tmp is mounted with noexec.
Comment 7 Scoots Hamilton 2018-05-16 10:23:35 EDT
(In reply to leseb from comment #6)
> Thanks for your response, I just backported a patch that will fix the issue.
> You will find it in tag v.3.0.34.
> 
> I suspect this will be part of the next z stream release for 3.0.
> 
> There is no need to dig further into this if you're interested in the
> solution is here:
> https://github.com/ceph/ceph-ansible/pull/2591/commits/
> 628d4cc161f862001460300426481ba60953ddc3
> 
> Calling bash directly doesn't trigger the shebang which allows us to execute
> the script even though /tmp is mounted with noexec.

Awesome! That is way more fluid than what I was able to stumble upon, lol. Snazzy fix, congrats on the great work ^_^ 

-Scoots
Comment 13 leseb 2018-06-12 02:36:13 EDT
Done.
Comment 14 Vasishta 2018-06-28 09:11:28 EDT
QE tried the solution provided under PR 2591, working fine

"# /usr/bin/env bash /tmp/restart_mon_daemon.sh" restarted mon service when noexec flag was set on '/tmp'

Moving to VERIFIED state, Please let us know if there are any concerns.

Regards,
Vasishta Shastry
AQE, Ceph
Comment 16 errata-xmlrpc 2018-07-11 14:11:10 EDT
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, 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-2018:2177

Note You need to log in before you can comment on or make changes to this bug.