Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1447086 - [Ansible Embedded] - Privilege escalation for playbook does not work
[Ansible Embedded] - Privilege escalation for playbook does not work
Status: CLOSED ERRATA
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Automate (Show other bugs)
5.8.0
Unspecified Unspecified
high Severity high
: GA
: 5.8.0
Assigned To: Harpreet Kataria
Dmitry Misharov
ansible_embed
:
Depends On: 1445377
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-01 13:00 EDT by Satoe Imaishi
Modified: 2017-05-31 11:07 EDT (History)
10 users (show)

See Also:
Fixed In Version: 5.8.0.13
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1445377
Environment:
Last Closed: 2017-05-31 11:07:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: Ansible


Attachments (Terms of Use)
awx (43.97 KB, image/png)
2017-05-05 19:14 EDT, Saif Ali
no flags Details
error (48.08 KB, image/png)
2017-05-05 19:14 EDT, Saif Ali
no flags Details
ip (41.02 KB, image/png)
2017-05-07 19:45 EDT, Saif Ali
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2017:1367 normal SHIPPED_LIVE Moderate: CFME 5.8.0 security, bug, and enhancement update 2017-05-31 14:16:03 EDT

  None (edit)
Comment 2 CFME Bot 2017-05-01 13:03:15 EDT
New commit detected on ManageIQ/manageiq-ui-classic/fine:
https://github.com/ManageIQ/manageiq-ui-classic/commit/3e989229cdf308b93118362d41971f77fdf363b2

commit 3e989229cdf308b93118362d41971f77fdf363b2
Author:     Dan Clarizio <dclarizi@redhat.com>
AuthorDate: Mon May 1 09:19:39 2017 -0700
Commit:     Satoe Imaishi <simaishi@redhat.com>
CommitDate: Mon May 1 13:02:46 2017 -0400

    Merge pull request #1207 from h-kataria/escalate_privilege_option
    
    Added "Escalate Privilege" checkbox
    (cherry picked from commit 4f45c537341088d8f1dfba252f4ae77822998bd8)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1447086

 .../controllers/catalog/catalog_item_form_controller.js   | 15 ++++++++++++++-
 app/controllers/catalog_controller.rb                     |  2 ++
 app/views/catalog/_sandt_tree_show.html.haml              | 10 ++++++++++
 .../angular/_ansible_form_options_angular.html.haml       | 13 ++++++++++++-
 spec/controllers/catalog_controller_spec.rb               | 12 ++++++++----
 .../catalog/catalog_item_form_controller_spec.js          |  1 +
 6 files changed, 47 insertions(+), 6 deletions(-)
Comment 3 CFME Bot 2017-05-01 13:06:04 EDT
New commit detected on ManageIQ/manageiq/fine:
https://github.com/ManageIQ/manageiq/commit/d5db6cd5b2c907327db5343d9c7a3d96e7771a8e

commit d5db6cd5b2c907327db5343d9c7a3d96e7771a8e
Author:     Greg McCullough <gmccullo@redhat.com>
AuthorDate: Fri Apr 28 10:52:58 2017 -0400
Commit:     Satoe Imaishi <simaishi@redhat.com>
CommitDate: Mon May 1 13:00:38 2017 -0400

    Merge pull request #14929 from bzwei/escalate_privilage
    
    Escalate privilege
    (cherry picked from commit 291254e928dd64a3e52caa9a07cb788ab62663c7)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1447086

 app/models/service_template_ansible_playbook.rb       | 5 +++--
 spec/models/service_template_ansible_playbook_spec.rb | 4 ++++
 2 files changed, 7 insertions(+), 2 deletions(-)
Comment 4 Dmitry Misharov 2017-05-04 03:26:30 EDT
Verified in 5.8.0.13-rc2.20170502165848_0f98658. Privilege escalation works as expected.
Comment 5 Saif Ali 2017-05-05 19:14 EDT
Created attachment 1276707 [details]
awx
Comment 6 Saif Ali 2017-05-05 19:14 EDT
Created attachment 1276708 [details]
error
Comment 7 Saif Ali 2017-05-05 19:16:11 EDT
I'm still getting the error in fact the machine credential has no effect, and all the job seem to be running as awx user.

5.8.0.13-rc2-20170502165848_0f98658
Comment 8 Bill Wei 2017-05-07 19:06:40 EDT
Saif,
I guess the first screenshot was the case without privilege escalation, and the second screenshot was with the flag on.

This BZ is to enhance our integration with Ansible that at job execution we instruct it to use su command run the job. The screenshot illustrated it is working as designed. The system received the flag and attempted to run su command.

The actual execution failure may be caused by the setup. Please make sure the credential you choose for the playbook meets the requirement, for example you have chosen the correct su/sudo, and user/password.
Comment 9 Saif Ali 2017-05-07 19:44:40 EDT
Bill,
The user has sudo access without password. I notice the playbook fail only when the host is set to localhost. If i use the IP it work fine using the same user.
Comment 10 Saif Ali 2017-05-07 19:45 EDT
Created attachment 1276911 [details]
ip
Comment 11 Bill Wei 2017-05-07 21:51:22 EDT
Is the IP of the CFME appliance?
Comment 12 Saif Ali 2017-05-08 09:59:55 EDT
Yes thats appliance IP.
Comment 13 Bill Wei 2017-05-08 14:13:34 EDT
We did some the same test and understand what's going on. When a playbook executes in localhost Tower always logs in as awx and does not allow privilege escalation. This makes sense for security reason. When you use IP tower does not know it is actually localhost therefore it treats the host as a regular machine.

In conclusion privilege escalation works only in non-localhost.
Comment 14 Saif Ali 2017-05-08 14:15:39 EDT
Bill, Thats make sense.
Comment 16 errata-xmlrpc 2017-05-31 11:07:09 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-2017:1367

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