icon/x Created with Sketch.

Splunk Cookie Policy

We use our own and third-party cookies to provide you with a great online experience. We also use these cookies to improve our products and services, support our marketing campaigns, and advertise to you on our website and other websites. Some cookies may continue to collect information after you have left our website. Learn more (including how to update your settings) here.
Accept Cookie Policy

Accept License Agreements

This app is provided by a third party and your right to use the app is in accordance with the license provided by that third-party licensor. Splunk is not responsible for any third-party apps and does not provide any warranty or support. If you have any questions, complaints or claims with respect to this app, please contact the licensor directly.

Thank You

Downloading JSON Web Token (JWT) Decoder
SHA256 checksum (json-web-token-jwt-decoder_101.tgz) 1ea0e6190265fcc17e095a60da6f48cac40ab2128adc3149364649ccaa898eda SHA256 checksum (json-web-token-jwt-decoder_10.tgz) ffdf7a7e8d67152224e246b35633102987225635d00bc6a4f7f4fe20084ba377
To install your download
For instructions specific to your download, click the Details tab after closing this window.

Flag As Inappropriate

JSON Web Token (JWT) Decoder

Admins: Please read about Splunk Enterprise 8.0 and the Python 2.7 end-of-life changes and impact on apps and upgradeshere.
Overview
Details
Quickly and easily decode and parse encoded JWT tokens found in Splunk events. Token metadata is decoded and made available as standard JSON in a `jwt` added to each event, and can easily be passed through to spath for additional query needs.

The JSON Web Token (JWT) Decoder is a custom search command that simplifies decoding and parsing tokens found in Splunk events.

Usage

... | jwt field=string [secret=string] [filter=(True|False)] [wrap=(True|False)] [debug=(True|False)]
  • field: Specify the field containing the Base64 encoded JWT token. Will automatically detect standard HTTP Authorization header containing JWT bearer token if present.
  • secret: If specified, will validate the JWT signature against the provided secret (HMAC SHA-256 only).
  • filter: Optionally filter results to only include events which contain the specified field (default: False).
  • wrap: Returned JSON structure will be wrapped with a "jwt" object to automatically export fully-qualified properties (e.g. jwt.header.alg) when passed through spath with no options (default: True).
  • debug: Set to True to enable errors when decoding events (default: False).

The specified field can either contain only the encoded JWT value, or more commonly, it can be included as a bearer token value in a standard HTTP Authentication header:

Host: www.example.com
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6I....
Content-Type: application/json

The authorization header will automatically be detected and parsed to obtain the JWT value, and both muliline and mulivalue field types are supported.

The resulting JSON representation of the token will then be made available in a jwt field for further analysis, though in many cases it will be most desirable to use the spath command to access the properties directly. Without any additional arguments, simply passing the jwt field as the input to spath will result in fields being created for each property in the JWT token:

| jwt field="request_headers" | spath input=jwt

From this output, accessing the JWT values is as simple as referencing jwt.header.alg or jwt.payload.name.

However, more advanced use cases can be easily accomplished with the additional options provided. For example, to show only events which included a JWT token, validate the token's HMAC SHA-256 signature with a provided secret and target the validation result directly, the following query could accomplish this:

| jwt field="request_headers" secret="mySecret" wrap=false filter=true 
| spath input=jwt path=signature 
| search signature="Invalid"

Roadmap

As is, this app is functional and tested with standard JWT tokens as described above. If there is interest, support for additional signature algorithms and enhanced functionality may be considered.

Release Notes

Version 1.0.1
March 4, 2020

Corrected an issue where events not containing the specified field were filtered from results.
Added option to filter events if desired.
Improved detection of HTTP Authorization headers to work with events where header values are in multiline or multivalue fields.

Version 1.0
March 4, 2020

Initial release.

4
Installs
19
Downloads
Share Subscribe LOGIN TO DOWNLOAD

Subscribe Share

AppInspect Tooling

Splunk AppInspect evaluates Splunk apps against a set of Splunk-defined criteria to assess the validity and security of an app package and components.

Are you a developer?

As a Splunkbase app developer, you will have access to all Splunk development resources and receive a 10GB license to build an app that will help solve use cases for customers all over the world. Splunkbase has 1000+ apps and add-ons from Splunk, our partners and our community. Find an app or add-on for most any data source and user need, or simply create your own with help from our developer portal.

Follow Us:
© 2005-2020 Splunk Inc. All rights reserved.
Splunk®, Splunk>®, Listen to Your Data®, The Engine for Machine Data®, Hunk®, Splunk Cloud™, Splunk Light™, SPL™ and Splunk MINT™ are trademarks and registered trademarks of Splunk Inc. in the United States and other countries. All other brand names, product names, or trademarks belong to their respective owners.