Skip to content

JWT Reworking for Kibana API requests#63

Merged
KjellKod merged 7 commits intologrhythm:4.1.10_NMfrom
craig-cogdill:getAndStoreJWTFromUrl
Sep 6, 2016
Merged

JWT Reworking for Kibana API requests#63
KjellKod merged 7 commits intologrhythm:4.1.10_NMfrom
craig-cogdill:getAndStoreJWTFromUrl

Conversation

@craig-cogdill
Copy link
Copy Markdown

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.

console.log("KIBANA: Full Url = **"+ fullUrl +"**");
console.log("KIBANA: Search Url = **"+ searchUrl +"**");
console.log("KIBANA: Href Url = **"+ hrefUrl +"**");
console.log("OFFICIAL JWT: **" + oneTrueJwt[1] + "**");
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

remove the console logs

Copy link
Copy Markdown
Author

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

@alexweltman
Copy link
Copy Markdown

what about search audits?

'Expires': 0
});
var fullUrl = window.location;
var searchUrl = window.location.search;
Copy link
Copy Markdown
Author

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

@alexweltman
Copy link
Copy Markdown

👍


// Look for 'token=', then capture all characters
// after (non-greedy) until either end of substring
// or the next ampersand.
Copy link
Copy Markdown

@KjellKod KjellKod Sep 6, 2016

Choose a reason for hiding this comment

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

great regexp comment!

@KjellKod
Copy link
Copy Markdown

KjellKod commented Sep 6, 2016

👍

@KjellKod KjellKod merged commit 521407f into logrhythm:4.1.10_NM Sep 6, 2016
@craig-cogdill
Copy link
Copy Markdown
Author

@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

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.

3 participants