Skip to content
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

Add bearer token auth to splunk driver #708

Merged

Conversation

Tatsuya-hasegawa
Copy link
Contributor

Hi

I have implemented splunkToken auth in splunk driver.
Of course, I have completed the connection test to my splunk instances.

image

Reference: What is Splunk Auth Token ?
https://docs.splunk.com/Documentation/Splunk/9.1.1/Security/CreateAuthTokens
https://dev.splunk.com/enterprise/docs/devtools/python/sdk-python/howtousesplunkpython/howtoconnectpython/#Log-in-using-a-bearer-token

Token authentication is more secure than username & password authentication because of the RBAC and Expiring features.
Thus I would like you to merge this auth function as soon as possible.

Thank you.
Best regards,

@Tatsuya-hasegawa
Copy link
Contributor Author

FYI: Technical appendix

The splunkToken option is not documented in the splunklib.client class used in the current splunk driver.
https://docs.splunk.com/DocumentationStatic/PythonSDK/1.7.3/client.html

However, it is introduced in splunklib.binding class.
https://docs.splunk.com/DocumentationStatic/PythonSDK/1.7.3/binding.html

The splunklib.client wraps a Pythonic layer around the wire-level binding of the splunklib.binding module.
Thus, splunkToken can be used in splunklib.client too and I was able to implement it without writing new method. :)

@Tatsuya-hasegawa
Copy link
Contributor Author

@ianhelle

Thanks for your approval.
OMG, I have forgotten to add white spaces at two array points thus black/flask8 caused the below errors.

https://github.com/microsoft/msticpy/actions/runs/6090840061/job/16526403910?pr=708

Would you slightly modify them ?

Unfortunately, I'm away from my dev PC and back in several days.

@ianhelle
Copy link
Contributor

ianhelle commented Sep 7, 2023

Would you slightly modify them ?

I can fix this but haven't been able to find the time before leaving for vacation later today. I can easily do it when I get back but I imagine you'll have the chance before this.

@Tatsuya-hasegawa
Copy link
Contributor Author

Ok, I was able to fix them.

@ianhelle

Thanks for your approval. OMG, I have forgotten to add white spaces at two array points thus black/flask8 caused the below errors.

https://github.com/microsoft/msticpy/actions/runs/6090840061/job/16526403910?pr=708

Would you slightly modify them ?

Unfortunately, I'm away from my dev PC and back in several days.

@Tatsuya-hasegawa
Copy link
Contributor Author

Hi, @ianhelle

The CI test finally seemed to be approved.
Could you merge this ?

Thanks in advance. :)

@ianhelle ianhelle merged commit 15fb44b into microsoft:main Sep 29, 2023
9 checks passed
@Tatsuya-hasegawa Tatsuya-hasegawa deleted the add_token_auth_to_splunk_driver branch April 19, 2024 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants