Linking from a Kibana plugin into the Security app using the Locator service

The following document provides excellent tips for deep linking into the Discover app from within a Kibana plugin using a locator service.
https://www.elastic.co/guide/en/kibana/master/kibana-navigation.html

The two main considerations are:

  1. Getting a proper base path
  2. Specifying state

I want to avoid hard-coding brittle URL's within our plugin's source code when linking out to:
Security > Hosts > Events

GitHub's README, in the link above, points to the source code for the Discover app's locator contract:
kibana > src > plugins > discover > public > locator.ts

However I can't find a plugin named "security" in the repository, perhaps that's because it's simply a core service? Is there any guidance for generating robust state to be used within the URL's name/value pairs, rather than embedding an HREF like this in our source code?

https://localhost:5601/s/my-space/app/security/hosts/events?sourcerer=(default:!('logs-*'))&query=(language:kuery,query:%27id:%20%223455a6ae-1260-4560-a0cf-b22a154e7111%22%27)&timerange=(global:(linkTo:!(timeline),timerange:(from:%272022-05-28T07:00:00.000Z%27,fromStr:now%2Fd,kind:relative,to:%272022-05-29T06:59:59.999Z%27,toStr:now%2Fd)),timeline:(linkTo:!(global),timerange:(from:%272022-05-28T07:00:00.000Z%27,fromStr:now%2Fd,kind:relative,to:%272022-05-29T06:59:59.999Z%27,toStr:now%2Fd)))

@BitBite welcome back to the Discuss forum!
The security plugin is an x-pack plugin and you need to have security enabled to use any of those features.
I could only find one match to /app/security/hosts/events in the main branch and that's for a cypress test setup. Essentially, your plugin will have to depend on the security_solution xpack plugin, I'm not familiar with integrating to that one though. Maybe the README is a good starting point for that specific plugin?

As for using deep links in your app, maybe the type documentation on deep linking could give you some pointers.