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 jwt auth token expire check and modify some messages when connecting Splunk #770

Merged

Conversation

Tatsuya-hasegawa
Copy link
Contributor

Hello,

I have some additional things to SplunkDriver.

The biggest one is that JWT bear_token's expiration check was implemented by using pyjwt which is already in requirement.txt.
In addition, I put some distinguish messages for each auth method when connecting Splunk.
And then modify an error in Splunk QueryProvider doc.

Local code check has been succeeded as following.

 % git commit -m "add jwt auth token expire check and modify some messages when connecting Splunk"
Check Yaml...........................................(no files to check)Skipped
Check JSON...........................................(no files to check)Skipped
Trim Trailing Whitespace.................................................Passed
black....................................................................Passed
pylint...................................................................Passed
flake8...................................................................Passed
isort (python)...........................................................Passed
pydocstyle...............................................................Passed
check_reqs_all...........................................................Passed
[add_token_expire_check_to_splunk_driver a4627c6f] add jwt auth token expire check and modify some messages when connecting Splunk
 3 files changed, 110 insertions(+), 39 deletions(-)

The JWT expiration time is shown by this commit.

image

This is an expire message, in this case, I modified the current time to over the expiration date forcely in order to appear this message.
image

Thank you.
Best regards,

@Tatsuya-hasegawa
Copy link
Contributor Author

Tatsuya-hasegawa commented Apr 12, 2024

Oops, I noticed pulled my folk repository's main instead of microsoft:main before this commit.
So This PR's Files Changes diff includes the previous PR #731 .
The correct diff to microsoft:main is only the area of "This branch has conflicts that must be resolved" below.

I'm sorry.
Kind regards,

@Tatsuya-hasegawa
Copy link
Contributor Author

Got it, I have completely fixed.
This PR's Files Changes diff is correct now.
Best regards,

Thank you in advance for your eye, @ianhelle

Copy link
Contributor

@ianhelle ianhelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good but a couple of minor issues.

msticpy/data/drivers/splunk_driver.py Outdated Show resolved Hide resolved
msticpy/data/uploaders/splunk_uploader.py Outdated Show resolved Hide resolved
@Tatsuya-hasegawa
Copy link
Contributor Author

@ianhelle

Thanks for your check and the advices.
I fixed them by this commit.

% git commit -m "small changes for exceptional messages"
Check Yaml...........................................(no files to check)Skipped
Check JSON...........................................(no files to check)Skipped
Trim Trailing Whitespace.................................................Passed
black....................................................................Passed
pylint...................................................................Passed
flake8...................................................................Passed
isort (python)...........................................................Passed
pydocstyle...............................................................Passed
check_reqs_all...........................................................Passed
[add_token_expire_check_to_splunk_driver eeb9df46] small changes for exceptional messages
 2 files changed, 8 insertions(+), 7 deletions(-)

Would you kindly check them again?
Best regards,

@ianhelle ianhelle merged commit b98197f into microsoft:main Apr 19, 2024
10 checks passed
@Tatsuya-hasegawa Tatsuya-hasegawa deleted the add_token_expire_check_to_splunk_driver branch April 19, 2024 00:58
@Tatsuya-hasegawa
Copy link
Contributor Author

Thanks for your approval and merge.

@ianhelle
Copy link
Contributor

@Tatsuya-hasegawa - thank you, once again for the contribution. It's awesome to have someone actively working on the Splunk support!

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