-
Notifications
You must be signed in to change notification settings - Fork 17
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
JWT Reworking for Kibana API requests #63
JWT Reworking for Kibana API requests #63
Conversation
Working for Audit but not for pcap download...
console.log("KIBANA: Full Url = **"+ fullUrl +"**"); | ||
console.log("KIBANA: Search Url = **"+ searchUrl +"**"); | ||
console.log("KIBANA: Href Url = **"+ hrefUrl +"**"); | ||
console.log("OFFICIAL JWT: **" + oneTrueJwt[1] + "**"); |
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.
remove the console logs
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.
I've grown fond of them now
what about search audits? |
@@ -49,16 +49,34 @@ define(function (require) { | |||
'Pragma': 'no-cache', | |||
'Expires': 0 | |||
}); | |||
var fullUrl = window.location; | |||
var searchUrl = window.location.search; |
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.
remove this and above line
👍 |
|
||
// Look for 'token=', then capture all characters | ||
// after (non-greedy) until either end of substring | ||
// or the next ampersand. |
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.
great regexp comment!
👍 |
@alexweltman To reference your question, Audit log was fixed with the Restangular request interceptor after also passing the jwt through the iframe url. Pcap download and file recon required the extra effort that we discussed on GTM |
The ONLY reasonably safe way for us to communicate our JWT from netmon www world to kibana is to pass it as a URL parameter when we display the iframe.
Now, when kibana gets the URL that we want to display, we will regex match the token as a string and save it in Kibana's domain cache (separate from www's domain cache).
In order to do pcap download, we use ANOTHER iframe to talk to www as a GET request. When we do this, again, we must pass the JWT in the iframe URL.
To read this off appropriately, I needed to add a function in our API class to 1) get the token from the HTTP headers if it is there and 2) look for it in the URL paramters if it is not.