x-pack/solutions/security/plugins/security_solution_serverless/README.md
The security_solution_serverless plugin is an internal plugin for Kibana's Security Solution, designed to encapsulate serverless-specific logic.
This plugin is only enabled when the application is built for serverless project, keeping the main security_solution plugin clean and agnostic of the offering model.
This plugin contains configuration and code used to create a Serverless Security project.
It leverages universal configuration and other APIs in the serverless plugin to configure Kibana.
The primary goal of the security_solution_serverless plugin is to:
security_solution plugin.The security_solution_serverless plugin depends on the main security_solution plugin, it can import code from it thought the use of agnostic packages is preferred,
and they interact through the plugin lifecycle contract.
This architecture allows the security_solution_serverless plugin to:
security_solution plugin remains offering-agnostic by using APIs for serverless-specific behavior only when necessary.security_solution): Exposes an API in its plugin lifecycle contract for components and configurations that depend on the offering.security_solution_serverless): Utilizes the exposed API to inject or modify the application according to serverless-specific content and logic.The following example demonstrates how the security_solution_serverless plugin interacts with the main security_solution plugin via a contract API.
It exposes a setter to the contract API for usersUrl, which is an offering-specific value. The security_solution_serverless plugin uses these APIs to inject the serverless-specific URL into the main plugin.
The PluginContract class in the main Security Solution plugin simplifies the usage of contract APIs, storing the values and providing a getter to the application using the Kibana services context.
security_solution/public/plugin_contract.ts
export class PluginContract {
usersUrl: string;
public getStartContract() {
return {
setUsersUrl: (url: string) => {
this.usersUrl = url;
}
};
}
public getStartServices() {
return {
getUsersUrl: () => this.usersUrl; // available via useKibana().services.getUsersUrl()
};
}
}
security_solution_serverless/public/plugin.ts
export class Plugin {
public start(core: CoreStart, deps: SecuritySolutionServerlessStartDeps) {
deps.securitySolution.setUsersUrl(deps.cloud.usersAndRolesUrl);
}
}
If you're looking to contribute to this plugin, please follow the standard contribution guidelines of the Security Solution plugin. Ensure that all changes are tested in a serverless environment.
This plugin is licensed under the Elastic License. See the LICENSE file for more details.