From 888ec25c3cc529fb484ae108261991e3869c192a Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Thu, 15 Dec 2016 16:22:06 -0500 Subject: [PATCH] Adding new privilege escalation methods from core --- awx/main/migrations/0034_v310_release.py | 5 +++++ awx/main/models/credential.py | 2 ++ awx/main/tasks.py | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/awx/main/migrations/0034_v310_release.py b/awx/main/migrations/0034_v310_release.py index fa46beec20..c3849468f8 100644 --- a/awx/main/migrations/0034_v310_release.py +++ b/awx/main/migrations/0034_v310_release.py @@ -47,6 +47,11 @@ class Migration(migrations.Migration): name='uuid', field=models.CharField(max_length=40), ), + migrations.AlterField( + model_name='credential', + name='become_method', + field=models.CharField(default=b'', help_text='Privilege escalation method.', max_length=32, blank=True, choices=[(b'', 'None'), (b'sudo', 'Sudo'), (b'su', 'Su'), (b'pbrun', 'Pbrun'), (b'pfexec', 'Pfexec'), (b'dzdo', 'DZDO'), (b'pmrun', 'Pmrun')]), + ), # Add Workflows migrations.AlterField( model_name='unifiedjob', diff --git a/awx/main/models/credential.py b/awx/main/models/credential.py index aa0bf3243c..a7f77e87c2 100644 --- a/awx/main/models/credential.py +++ b/awx/main/models/credential.py @@ -50,6 +50,8 @@ class Credential(PasswordFieldsModel, CommonModelNameNotUnique, ResourceMixin): ('su', _('Su')), ('pbrun', _('Pbrun')), ('pfexec', _('Pfexec')), + ('dzdo', _('DZDO')), + ('pmrun', _('Pmrun')), #('runas', _('Runas')), ] diff --git a/awx/main/tasks.py b/awx/main/tasks.py index 63128635ab..de69a3ecd5 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -1743,6 +1743,10 @@ class RunAdHocCommand(BaseTask): d[re.compile(r'^pfexec password.*:\s*?$', re.M)] = 'become_password' d[re.compile(r'^RUNAS password.*:\s*?$', re.M)] = 'become_password' d[re.compile(r'^runas password.*:\s*?$', re.M)] = 'become_password' + d[re.compile(r'^DZDO password.*:\s*?$', re.M)] = 'become_password' + d[re.compile(r'^dzdo password.*:\s*?$', re.M)] = 'become_password' + d[re.compile(r'^PMRUN password.*:\s*?$', re.M)] = 'become_password' + d[re.compile(r'^pmrun password.*:\s*?$', re.M)] = 'become_password' d[re.compile(r'^SSH password:\s*?$', re.M)] = 'ssh_password' d[re.compile(r'^Password:\s*?$', re.M)] = 'ssh_password' return d