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

[8.10] [Security Solution] Prebuilt rules installation / upgrade flyout improvements (#164179) #164897

Merged
merged 2 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export const KqlQueryLanguage = t.keyof({ kuery: null, lucene: null });
export type EqlQueryLanguage = t.TypeOf<typeof EqlQueryLanguage>;
export const EqlQueryLanguage = t.literal('eql');

export const eqlSchema = buildRuleSchemas({
const eqlSchema = buildRuleSchemas({
required: {
type: t.literal('eql'),
language: EqlQueryLanguage,
Expand Down Expand Up @@ -256,7 +256,7 @@ export const EqlPatchParams = eqlSchema.patch;
// -------------------------------------------------------------------------------------------------
// Indicator Match rule schema

export const threatMatchSchema = buildRuleSchemas({
const threatMatchSchema = buildRuleSchemas({
required: {
type: t.literal('threat_match'),
query: RuleQuery,
Expand Down Expand Up @@ -307,7 +307,7 @@ export const ThreatMatchPatchParams = threatMatchSchema.patch;
// -------------------------------------------------------------------------------------------------
// Custom Query rule schema

export const querySchema = buildRuleSchemas({
const querySchema = buildRuleSchemas({
required: {
type: t.literal('query'),
},
Expand Down Expand Up @@ -343,7 +343,7 @@ export const QueryPatchParams = querySchema.patch;
// -------------------------------------------------------------------------------------------------
// Saved Query rule schema

export const savedQuerySchema = buildRuleSchemas({
const savedQuerySchema = buildRuleSchemas({
required: {
type: t.literal('saved_query'),
saved_id,
Expand Down Expand Up @@ -387,7 +387,7 @@ export const SavedQueryPatchParams = savedQuerySchema.patch;
// -------------------------------------------------------------------------------------------------
// Threshold rule schema

export const thresholdSchema = buildRuleSchemas({
const thresholdSchema = buildRuleSchemas({
required: {
type: t.literal('threshold'),
query: RuleQuery,
Expand Down Expand Up @@ -422,7 +422,7 @@ export const ThresholdPatchParams = thresholdSchema.patch;
// -------------------------------------------------------------------------------------------------
// Machine Learning rule schema

export const machineLearningSchema = buildRuleSchemas({
const machineLearningSchema = buildRuleSchemas({
required: {
type: t.literal('machine_learning'),
anomaly_threshold,
Expand Down Expand Up @@ -462,7 +462,7 @@ export const MachineLearningPatchParams = machineLearningSchema.patch;
// -------------------------------------------------------------------------------------------------
// New Terms rule schema

export const newTermsSchema = buildRuleSchemas({
const newTermsSchema = buildRuleSchemas({
required: {
type: t.literal('new_terms'),
query: RuleQuery,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
* 2.0.
*/

import type { RuleSignatureId, RuleTagArray, RuleVersion } from '../../model';
import type { DiffableRule } from '../model';
import type { RuleTagArray } from '../../model';
import type { RuleResponse } from '../../model/rule_schema/rule_schemas';

export interface ReviewRuleInstallationResponseBody {
/** Aggregated info about all rules available for installation */
stats: RuleInstallationStatsForReview;

/** Info about individual rules: one object per each rule available for installation */
rules: RuleInstallationInfoForReview[];
rules: RuleResponse[];
}

export interface RuleInstallationStatsForReview {
Expand All @@ -23,8 +23,3 @@ export interface RuleInstallationStatsForReview {
/** A union of all tags of all rules available for installation */
tags: RuleTagArray;
}

export type RuleInstallationInfoForReview = DiffableRule & {
rule_id: RuleSignatureId;
version: RuleVersion;
};
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
*/

import type { RuleObjectId, RuleSignatureId, RuleTagArray } from '../../model';
import type { DiffableRule, PartialRuleDiff } from '../model';
import type { PartialRuleDiff } from '../model';
import type { RuleResponse } from '../../model/rule_schema/rule_schemas';

export interface ReviewRuleUpgradeResponseBody {
/** Aggregated info about all rules available for upgrade */
Expand All @@ -27,8 +28,8 @@ export interface RuleUpgradeStatsForReview {
export interface RuleUpgradeInfoForReview {
id: RuleObjectId;
rule_id: RuleSignatureId;
rule: DiffableRule;
target_rule: DiffableRule;
current_rule: RuleResponse;
target_rule: RuleResponse;
diff: PartialRuleDiff;
revision: number;
}
Loading