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

JWT Reworking for Kibana API requests #63

Merged
merged 7 commits into from
Sep 6, 2016

Conversation

craig-cogdill
Copy link

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] + "**");

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
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

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;
Copy link
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

👍


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

@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

KjellKod commented Sep 6, 2016

👍

@KjellKod KjellKod merged commit 521407f into logrhythm:4.1.10_NM Sep 6, 2016
@craig-cogdill
Copy link
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