Skip to content

decrypt encyrpted security user password before encrypting for security #1012

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def __create_security_folder(self):
self.logger.entering(class_name=self.__class_name, method_name=_method_name)
security_folder = dictionary_utils.get_dictionary_element(self._topology, SECURITY)
if security_folder is not None:
helper = DefaultAuthenticatorHelper(self.model_context, ExceptionType.CREATE)
helper = DefaultAuthenticatorHelper(self.model_context, self.aliases, ExceptionType.CREATE)
helper.create_default_init_file(security_folder)
self.logger.exiting(class_name=self.__class_name, method_name=_method_name)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ class DefaultAuthenticatorHelper(object):
"""
_class_name = 'DefaultAuthenticatorHelper'

def __init__(self, model_context, exception_type):
def __init__(self, model_context, aliases, exception_type):
self._model_context = model_context
self._aliases = aliases
self._exception_type = exception_type
self._logger = PlatformLogger('wlsdeploy.tool.util')
self._weblogic_helper = WebLogicHelper(self._logger)
Expand Down Expand Up @@ -135,6 +136,7 @@ def _build_user_mapping_hash(self, user_mapping_section, name):
hash_entry[HASH_DESCRIPTION] = description
groups = dictionary_utils.get_element(group_attributes, GROUP_MEMBER_OF)
password = self._get_required_attribute(user_mapping_section, PASSWORD, USER, name)
password = self._aliases.decrypt_password(password)
password_encoded = self._encode_password(name, password)
hash_entry[HASH_USER_PASSWORD] = password_encoded
group_list = []
Expand Down Expand Up @@ -177,6 +179,7 @@ def _get_required_attribute(self, dictionary, name, mapping_type, mapping_name):
_method_name = '_get_required_attribute'

result = dictionary_utils.get_element(dictionary, name)

if result is None:
pwe = exception_helper.create_exception(self._exception_type, '-01791', name, mapping_type,
mapping_name)
Expand Down