-
Notifications
You must be signed in to change notification settings - Fork 0
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
PAPP-32932 Msscom: Feature - support for different authentication methods #12
Open
mposluszny-splunk
wants to merge
12
commits into
next
Choose a base branch
from
mposluszny/SOARHELP-2713
base: next
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d4baf30
implemented optional authentication type selection
mposluszny-splunk 9ccdeb8
Update README.md
8a98819
updated readme and changelog
mposluszny-splunk 42fb299
Update README.md
f085dd6
removed duplicated deps
mposluszny-splunk 27b6a73
update deps
mposluszny-splunk 2f17d99
applied suggestions
mposluszny-splunk 80567cd
Update README.md
94542ae
implemented using ssl certs for auth
mposluszny-splunk e5ecc07
Update README.md
f018d73
version and linting
mposluszny-splunk 4893a1d
Update README.md
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ def __init__(self): | |
# Configuration variables | ||
self._server_url = None | ||
self._username = None | ||
self._auth_type = MSSCOM_DEFAULT_AUTH_METHOD | ||
self._password = None | ||
self._verify_server_cert = False | ||
|
||
|
@@ -82,28 +83,33 @@ def _get_fips_enabled(self): | |
self.debug_print("FIPS is not enabled") | ||
return fips_enabled | ||
|
||
def _execute_ps_command(self, action_result, ps_command): | ||
""" This function is used to execute power shell command. | ||
|
||
:param action_result: object of ActionResult | ||
:param ps_command: power shell command | ||
:return: output of executed power shell command | ||
""" | ||
|
||
resp_output = None | ||
def _get_protocol(self): | ||
server_cert_validation = 'ignore' | ||
transport = 'ntlm' | ||
|
||
if self._get_fips_enabled(): | ||
if self._auth_type != MSSCOM_DEFAULT_AUTH_METHOD: | ||
transport = self._auth_type | ||
elif self._get_fips_enabled(): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The same as in #11 |
||
transport = 'basic' | ||
|
||
if self._verify_server_cert: | ||
server_cert_validation = 'validate' | ||
|
||
protocol = Protocol(endpoint=MSSCOM_SERVER_URL.format(url=self._server_url), transport=transport, | ||
return Protocol(endpoint=MSSCOM_SERVER_URL.format(url=self._server_url), transport=transport, | ||
username=self._username, password=self._password, | ||
server_cert_validation=server_cert_validation) | ||
|
||
def _execute_ps_command(self, action_result, ps_command): | ||
""" This function is used to execute power shell command. | ||
|
||
:param action_result: object of ActionResult | ||
:param ps_command: power shell command | ||
:return: output of executed power shell command | ||
""" | ||
|
||
protocol = self._get_protocol() | ||
resp_output = None | ||
|
||
try: | ||
shell_id = protocol.open_shell() | ||
except InvalidCredentialsError as credentials_error: | ||
|
@@ -374,6 +380,7 @@ def initialize(self): | |
self._server_url = config[MSSCOM_CONFIG_SERVER_URL].strip("/") | ||
self._username = config[MSSCOM_CONFIG_USERNAME] | ||
self._password = config[MSSCOM_CONFIG_PASSWORD] | ||
self._auth_type = config[MSSCOM_CONFIG_AUTH_METHOD] | ||
|
||
# Optional config parameter | ||
self._verify_server_cert = config.get(MSSCOM_CONFIG_VERIFY_SSL, False) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,5 @@ | ||
**Unreleased** | ||
|
||
* [SOARHELP-2713] Authentication method selection is available in asset configuration. | ||
* User can choose between: default, ssl, basic, credssp, ntlm. | ||
* Default method means that while FIPS is enabled NTLM will be used, otherwise Basic HTTP will be applied |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
pywinrm==0.4.3 | ||
requests_credssp==2.0.0 | ||
requests_ntlm==1.1.0 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-4.16 MB
wheels/py3/cryptography-41.0.5-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file added
BIN
+4.16 MB
wheels/py3/cryptography-41.0.7-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+394 KB
...36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file added
BIN
+3.56 MB
wheels/py36/cryptography-40.0.2-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file removed
BIN
-136 KB
...ls/py39/charset_normalizer-3.3.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file added
BIN
+139 KB
...ls/py39/charset_normalizer-3.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't the other fields from config you've added be here as well?