Skip to main content

client-enrichment-plugin

This plugin allows to resolve the client identification extracted by Spider.
Currently, spider extracts identification from:

  • JWT Bearer token - sub field
  • Basic auth
  • X509 certificates - CN field

The enrichment is applied to:

  • Grid, and export
  • Filters
  • Details
  • Stats
  • And map!

Signature

function myOwnPlugin({
inputs: {identification, mode},
parameters: {},
callbacks: {setDecodedClient, onShowInfo, onShowError, onShowWarning, onOpenResource},
libs: {React}
}){}

The plugin is called:

  • For each row, and each displayed Identification in the Grid or Excel export
  • For each group for stats grouped by Identification and Excel export
  • To display Identification in the HTTP details panel
  • For each Identification and all values for the Filter component in the grid header
  • To display the Identification value in the filter badge when it is selected

Depending on the call, the output is requested in REACT components mode (grids and details) or in TEXT mode (Excel, filters)

Input

NameDescription
identificationValue of the identification to resolve
modeOutput type: REACT or TEXT

Callbacks

onShowInfo(message)

Displays an Information toast with the message.

onShowWarning(message)

Displays a Warning toast with the message.

onShowError(message)

Displays an Error toast with the message.

onOpenResource({id, title, contentType, payload})

Callback to open a downloaded payload in details panel. XML and JSON are supported.

When provided, the resolved Identification will be clickable (where it may), and the payload will be displayed in Spider details panel.

ParameterDescription
idId of the resource, to manage breadcrumb
titleDisplayed at the top of details panel
contentTypeapplication/json or application/xml are supported
payloadThe resource content (string)

setDecodedClient(value)

Sets the decoded value of the identification.

  • May be a React component when in REACT mode.
  • Must be a string in TEXT mode.

Output

Output must be sent both:

  • Using setDecodedClient callback
  • With a return value (of the promise)

Plugin example

Spider client resolver

This sample plugin decodes Spiders own identifiers of JWT tokens to display name of Whisperers and Users.

Parameters

spider-client-resolver-params.png

Output

In grid & filters:

In map:

Code

It is freely available here: https://gitlab.com/spider-analyzer/plugins/client-resolver