Skip to content

Commit 677fa62

Browse files
authored
Merge pull request #20883 from jheysel-r7/fix/impersonate_config_check
Add validate_options check for IMPERSONATE and IMPERSONATE_TYPE in get_ticket
2 parents 0b210b6 + b187466 commit 677fa62

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

modules/auxiliary/admin/kerberos/get_ticket.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,10 @@ def validate_options
134134
if datastore['SPN'].present? && !datastore['SPN'].match(%r{.+/.+})
135135
fail_with(Failure::BadConfig, 'SPN format must be service_name/FQDN (ex: cifs/dc01.mydomain.local)')
136136
end
137+
138+
if datastore['IMPERSONATE'].present? && datastore['IMPERSONATE_TYPE'] == 'none'
139+
fail_with(Failure::BadConfig, 'IMPERSONATE_TYPE must be set to "generic", "dmsa" or "auto" when IMPERSONATE is provided')
140+
end
137141
end
138142

139143
def run

0 commit comments

Comments
 (0)