Skip to content

Commit

Permalink
[Backport 2.x] 2.7 manual backports. (#532)
Browse files Browse the repository at this point in the history
* Minor bug fixes (#505)

* [BUG] Edit details Save button should be blue #499

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [BUG] Detector details has some bad text handling #496

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [BUG] Detector details has some bad text handling #496

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [BUG] Detector details has some bad text handling #496

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

---------

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* [BUG] Fixes few minor UX bugs (#525)

* [BUG] No space between the detector details and the rule panel #522
[BUG] A rule flyout without references have an empty link #521
[FEATURE] Update header size to use euiTitle--small #520

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [BUG] No space between the detector details and the rule panel #522
[BUG] A rule flyout without references have an empty link #521
[FEATURE] Update header size to use euiTitle--small #520

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

---------

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Feature] deleting detectors should delete all related dashboards (including index patterns and visualisations) (#515)

* Update detector details component #504

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* [FEATURE] Deleting detectors should delete all related dashboards (including index-patterns and visualisations) #509

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

---------

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>

* Resolved merge conflicts, generated updated snapshot files, resolved discrepancies between main and 2.x branch.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Resolved merge conflicts, generated updated snapshot files, resolved discrepancies between main and 2.x branch.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

---------

Signed-off-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
Co-authored-by: Jovan Cvetkovic <jovanca.cvetkovic@gmail.com>
(cherry picked from commit d0b1702)
  • Loading branch information
AWSHurneyt authored and github-actions[bot] committed Apr 18, 2023
1 parent b483cd1 commit 34f8fb5
Show file tree
Hide file tree
Showing 36 changed files with 582 additions and 871 deletions.
22 changes: 15 additions & 7 deletions MAINTAINERS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
## Maintainers
| Maintainer | GitHub ID | Affiliation |
| --------------- | --------- | ----------- |
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
| Subhobrata Dey | [sbcd90](https://github.com/sbcd90) | Amazon |
| Praveen Sameneni | [praveensameneni](https://github.com/praveensameneni) | Amazon |
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |
## Overview

This document contains a list of maintainers in this repo. See [opensearch-project/.github/RESPONSIBILITIES.md](https://github.com/opensearch-project/.github/blob/main/RESPONSIBILITIES.md#maintainer-responsibilities) that explains what the role of maintainer means, what maintainers do in this and other repos, and how they should be doing it. If you're interested in contributing, and becoming a maintainer, see [CONTRIBUTING](CONTRIBUTING.md).

## Current Maintainers

| Maintainer | GitHub ID | Affiliation |
| ---------------- | ----------------------------------------------------- | ----------- |
| Ashish Agrawal | [lezzago](https://github.com/lezzago) | Amazon |
| Subhobrata Dey | [sbcd90](https://github.com/sbcd90) | Amazon |
| Thomas Hurney | [awshurneyt](https://github.com/AWSHurneyt) | Amazon |
| Surya Sashank Nistala | [eirsep](https://github.com/eirsep) | Amazon |
| Praveen Sameneni | [praveensameneni](https://github.com/praveensameneni) | Amazon |
| Amardeepsingh Siglani | [amsiglan](https://github.com/amsiglan) | Amazon |
| Saurabh Singh | [getsaurabh02](https://github.com/getsaurabh02) | Amazon |

[This document](https://github.com/opensearch-project/.github/blob/main/MAINTAINERS.md) explains what maintainers do in this repo, and how they should be doing it. If you're interested in contributing, see [CONTRIBUTING](CONTRIBUTING.md).
26 changes: 26 additions & 0 deletions cypress/fixtures/integration_tests/rule/create_network_rule.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": "25b9c01c-350d-4b95-bed1-836d04a4f326",
"category": "network",
"title": "Cypress Network Rule",
"description": "Detects network changes",
"status": "experimental",
"author": "Cypress Tests",
"references": [
{
"value": ""
}
],
"tags": [
{
"value": "network.low"
}
],
"log_source": "",
"detection": "selection:\n keywords:\n - erase\n - delete\n - YXC\ncondition: selection",
"level": "low",
"false_positives": [
{
"value": ""
}
]
}
39 changes: 39 additions & 0 deletions cypress/fixtures/sample_network_index_settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"mappings": {
"properties": {
"name": {
"type": "text"
},
"path": {
"type": "text"
},
"keywords": {
"type": "text"
},
"operation": {
"type": "text"
},
"action": {
"type": "text"
},
"dst_port": {
"type": "integer"
},
"timeframe": {
"type": "text"
},
"user_agent": {
"type": "text"
},
"method": {
"type": "text"
}
}
},
"settings": {
"index": {
"number_of_shards": "1",
"number_of_replicas": "1"
}
}
}
1 change: 1 addition & 0 deletions cypress/integration/2_rules.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ describe('Rules', () => {
);

// Enter the reference
cy.contains('Add another URL').click();
cy.get('[data-test-subj="rule_references_field_0"]').type(SAMPLE_RULE.references);

// Enter the false positive cases
Expand Down
6 changes: 3 additions & 3 deletions models/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export interface Rule {
log_source: string;
title: string;
description: string;
tags: { value: string }[];
false_positives: { value: string }[];
tags: Array<{ value: string }>;
false_positives: Array<{ value: string }>;
level: string;
status: string;
references: { value: string }[];
references: Array<{ value: string }>;
author: string;
detection: string;
}
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"resolutions": {
"@types/react": "^16.9.8",
"**/@types/angular": "1.6.50",
"**/@types/jest": "^24.0.9",
"**/@types/jest": "^29.3.1",
"**/@types/react-dom": "^16.9.8",
"eslint-utils": "^1.4.2",
"path-parse": "^1.0.7",
Expand All @@ -57,14 +57,15 @@
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.3.2",
"cypress": "^6.0.0",
"cypress-real-events": "1.7.6",
"cypress-recurse": "^1.27.0",
"eslint-plugin-no-unsanitized": "^3.0.2",
"eslint-plugin-prefer-object-spread": "^1.2.1",
"husky": "^3.0.0",
"jest-cli": "^27.5.1",
"jest-environment-jsdom": "^27.5.1",
"lint-staged": "^10.2.0",
"ts-loader": "^6.2.1",
"cypress-real-events": "1.7.6"
"ts-loader": "^6.2.1"
},
"engines": {
"yarn": "^1.21.1"
Expand Down
4 changes: 4 additions & 0 deletions public/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,7 @@ $euiTextColor: $euiColorDarkestShade !default;
.sa-overview-widget-empty tbody > .euiTableRow > .euiTableRowCell {
border-bottom: none;
}

.detailsFormRow {
width: auto !important;
}
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ export default class ConfigureFieldMapping extends Component<
<EuiAccordion
buttonContent={
<div data-test-subj="mapped-fields-btn">
<EuiTitle>
<EuiTitle size={'s'}>
<h6>{`Automatically mapped fields (${mappedRuleFields.length})`}</h6>
</EuiTitle>
</div>
Expand Down Expand Up @@ -303,7 +303,7 @@ export default class ConfigureFieldMapping extends Component<

<EuiSpacer size={'m'} />

<EuiTitle>
<EuiTitle size={'s'}>
<h6>Pending field mappings</h6>
</EuiTitle>
<FieldMappingsTable<MappingViewType.Edit>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const DetectionRules: React.FC<DetectionRulesProps> = ({
<EuiAccordion
buttonContent={
<div data-test-subj="detection-rules-btn">
<EuiTitle>
<EuiTitle size={'s'}>
<h4>{`Detection rules (${enabledRulesCount} selected)`}</h4>
</EuiTitle>
<EuiText size="s" color="subdued">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,14 @@ export const AlertTriggerView: React.FC<AlertTriggerViewProps> = ({
<h5>If any detection rule matches</h5>
</EuiTitle>
<EuiSpacer size={'m'} />
{createTextDetailsGroup(
[
{ label: 'Log type', content: `${types[0]}` || DEFAULT_EMPTY_DATA },
{ label: 'Rule names', content: conditionRuleNames.join('\n') || DEFAULT_EMPTY_DATA },
],
3
)}
{createTextDetailsGroup(
[
{ label: 'Rule severities', content: sev_levels.join('\n') || DEFAULT_EMPTY_DATA },
{ label: 'Tags', content: tags.join('\n') || DEFAULT_EMPTY_DATA },
],
3
)}
{createTextDetailsGroup([
{ label: 'Log type', content: `${types[0]}` || DEFAULT_EMPTY_DATA },
{ label: 'Rule names', content: conditionRuleNames.join('\n') || DEFAULT_EMPTY_DATA },
])}
{createTextDetailsGroup([
{ label: 'Rule severities', content: sev_levels.join('\n') || DEFAULT_EMPTY_DATA },
{ label: 'Tags', content: tags.join('\n') || DEFAULT_EMPTY_DATA },
])}
<EuiSpacer size="xl" />

<EuiTitle size="s">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Object {
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -100,14 +100,13 @@ Object {
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive detailsFormRow"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -142,11 +141,10 @@ Object {
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -185,14 +183,13 @@ Object {
class="euiSpacer euiSpacer--xl"
/>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive detailsFormRow"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -227,11 +224,10 @@ Object {
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -281,7 +277,7 @@ Object {
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -318,7 +314,7 @@ Object {
class="euiSpacer euiSpacer--l"
/>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -413,7 +409,7 @@ Object {
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -458,14 +454,13 @@ Object {
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive detailsFormRow"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -500,11 +495,10 @@ Object {
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -543,14 +537,13 @@ Object {
class="euiSpacer euiSpacer--xl"
/>
<div
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive"
class="euiFlexGroup euiFlexGroup--gutterLarge euiFlexGroup--directionRow euiFlexGroup--responsive detailsFormRow"
>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -585,11 +578,10 @@ Object {
</div>
</div>
<div
class="euiFlexItem euiFlexItem--flexGrowZero"
style="min-width: 33.333333333333336%;"
class="euiFlexItem"
>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -639,7 +631,7 @@ Object {
class="euiSpacer euiSpacer--m"
/>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down Expand Up @@ -676,7 +668,7 @@ Object {
class="euiSpacer euiSpacer--l"
/>
<div
class="euiFormRow"
class="euiFormRow euiFormRow--fullWidth"
id="some_html_id-row"
>
<div
Expand Down
Loading

0 comments on commit 34f8fb5

Please sign in to comment.