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

[AUTO] Increment version to 2.8.0.0 #612

Closed
wants to merge 7 commits into from
Closed
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
7 changes: 3 additions & 4 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ on:
branches:
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '2.7.0'
OPENSEARCH_VERSION: '2.7.0-SNAPSHOT'
OPENSEARCH_DASHBOARDS_VERSION: '2.x'
SECURITY_ANALYTICS_BRANCH: '2.x'
jobs:
tests:
Expand All @@ -32,7 +31,7 @@ jobs:
uses: actions/setup-java@v1
with:
# TODO: Parse this from security analytics plugin (https://github.com/opensearch-project/security-analytics/issues/170)
java-version: 11
java-version: 17

- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
Expand All @@ -48,7 +47,7 @@ jobs:
- name: Run opensearch with plugin
run: |
cd security-analytics
./gradlew run -Dopensearch.version=${{ env.OPENSEARCH_VERSION }} &
./gradlew run &
sleep 300
shell: bash

Expand Down
44 changes: 30 additions & 14 deletions cypress/integration/2_rules.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ const SAMPLE_RULE = {
name: `Cypress test rule ${uniqueId}`,
logType: 'windows',
description: 'This is a rule used to test the rule creation workflow.',
detection:
'selection:\n Provider_Name: Service Control Manager\nEventID: 7045\nServiceName: ZzNetSvc\n{backspace}{backspace}condition: selection',
detectionLine: [
'selection:',
'Provider_Name: Service Control Manager',
'EventID: 7045',
'ServiceName: ZzNetSvc',
'condition: selection',
'condition: Selection_1',
'Selection_1:',
'Provider_Name|contains:',
'- Service Control Manager',
'EventID|contains:',
"- '7045'",
'ServiceName|contains:',
'- ZzNetSvc',
],
severity: 'critical',
tags: ['attack.persistence', 'attack.privilege_escalation', 'attack.t1543.003'],
Expand Down Expand Up @@ -45,7 +46,7 @@ const YAML_RULE_LINES = [
`- '${SAMPLE_RULE.references}'`,
`author: ${SAMPLE_RULE.author}`,
`detection:`,
...SAMPLE_RULE.detection.replaceAll(' ', '').replaceAll('{backspace}', '').split('\n'),
...SAMPLE_RULE.detectionLine,
];

const checkRulesFlyout = () => {
Expand Down Expand Up @@ -138,7 +139,7 @@ describe('Rules', () => {

// Check that correct page is showing
cy.waitForPageLoad('rules', {
contains: 'Rules',
contains: 'Detection rules',
});
});

Expand Down Expand Up @@ -180,8 +181,23 @@ describe('Rules', () => {
// Enter the author
cy.get('[data-test-subj="rule_author_field"]').type(`${SAMPLE_RULE.author}{enter}`);

// Enter the detection
cy.get('[data-test-subj="rule_detection_field"] textarea').type(SAMPLE_RULE.detection, {
cy.get('[data-test-subj="detection-visual-editor-0"]').within(() => {
cy.getFieldByLabel('Key').type('Provider_Name');
cy.getInputByPlaceholder('Value').type('Service Control Manager');

cy.getButtonByText('Add map').click();
cy.get('[data-test-subj="Map-1"]').within(() => {
cy.getFieldByLabel('Key').type('EventID');
cy.getInputByPlaceholder('Value').type('7045');
});

cy.getButtonByText('Add map').click();
cy.get('[data-test-subj="Map-2"]').within(() => {
cy.getFieldByLabel('Key').type('ServiceName');
cy.getInputByPlaceholder('Value').type('ZzNetSvc');
});
});
cy.get('[data-test-subj="rule_detection_field"] textarea').type('Selection_1', {
force: true,
});

Expand All @@ -204,15 +220,15 @@ describe('Rules', () => {
cy.wait('@getRules');

cy.waitForPageLoad('rules', {
contains: 'Rules',
contains: 'Detection rules',
});

checkRulesFlyout();
});

it('...can be edited', () => {
cy.waitForPageLoad('rules', {
contains: 'Rules',
contains: 'Detection rules',
});

cy.get(`input[placeholder="Search rules"]`).ospSearch(SAMPLE_RULE.name);
Expand Down Expand Up @@ -262,7 +278,7 @@ describe('Rules', () => {
});

cy.waitForPageLoad('rules', {
contains: 'Rules',
contains: 'Detection rules',
});

cy.wait('@getRules');
Expand Down
14 changes: 9 additions & 5 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"id": "securityAnalyticsDashboards",
"version": "2.7.0.0",
"opensearchDashboardsVersion": "2.7.0",
"configPath": ["opensearch_security_analytics"],
"requiredPlugins": ["data"],
"version": "2.8.0.0",
"opensearchDashboardsVersion": "2.8.0",
"configPath": [
"opensearch_security_analytics"
],
"requiredPlugins": [
"data"
],
"server": true,
"ui": true
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch_security_analytics_dashboards",
"version": "2.7.0.0",
"version": "2.8.0.0",
"description": "OpenSearch Dashboards plugin for Security Analytics",
"main": "index.js",
"license": "Apache-2.0",
Expand All @@ -15,6 +15,7 @@
},
"scripts": {
"cypress:open": "cypress open",
"cypress:run": "cypress run",
"osd": "node ../../scripts/osd",
"opensearch": "node ../../scripts/opensearch",
"lint": "node ../../scripts/eslint .",
Expand Down Expand Up @@ -77,4 +78,4 @@
"formik": "^2.2.6",
"react-graph-vis": "^1.0.7"
}
}
}
2 changes: 2 additions & 0 deletions public/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ $euiTextColor: $euiColorDarkestShade !default;
@import "./pages/Correlations/Correlations.scss";
@import "./pages/Correlations/components/FindingCard.scss";
@import "./pages/Findings/components/CorrelationsTable/CorrelationsTable.scss";
@import "./pages/Rules/components/RuleEditor/RuleEditorForm.scss";
@import "./pages/Rules/components/RuleEditor/DetectionVisualEditor.scss";

.selected-radio-panel {
background-color: tintOrShade($euiColorPrimary, 90%, 70%);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const DetectionRulesTable: React.FC<DetectionRulesTableProps> = ({
onRuleDetails
)}
items={ruleItems}
itemId={(item: RuleItem) => `${item.name}`}
itemId={(item: RuleItem) => `${item.id}`}
search={search}
pagination={pagination}
onTableChange={onTableChangeHandler}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "category",
"multiSelect": "or",
"name": "Rule Type",
"name": "Log type",
"options": Array [
Object {
"name": "Network",
Expand Down Expand Up @@ -476,7 +476,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "level",
"multiSelect": "or",
"name": "Rule Severity",
"name": "Rule severity",
"options": Array [
Object {
"color": "#cc5642",
Expand Down Expand Up @@ -563,7 +563,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "category",
"multiSelect": "or",
"name": "Rule Type",
"name": "Log type",
"options": Array [
Object {
"name": "Network",
Expand Down Expand Up @@ -623,7 +623,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "level",
"multiSelect": "or",
"name": "Rule Severity",
"name": "Rule severity",
"options": Array [
Object {
"color": "#cc5642",
Expand Down Expand Up @@ -782,7 +782,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "category",
"multiSelect": "or",
"name": "Rule Type",
"name": "Log type",
"options": Array [
Object {
"name": "Network",
Expand Down Expand Up @@ -842,7 +842,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "level",
"multiSelect": "or",
"name": "Rule Severity",
"name": "Rule severity",
"options": Array [
Object {
"color": "#cc5642",
Expand Down Expand Up @@ -923,7 +923,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "category",
"multiSelect": "or",
"name": "Rule Type",
"name": "Log type",
"options": Array [
Object {
"name": "Network",
Expand Down Expand Up @@ -1013,7 +1013,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
iconType="arrowDown"
onClick={[Function]}
>
Rule Type
Log type
</EuiFilterButton>
}
closePopover={[Function]}
Expand Down Expand Up @@ -1085,10 +1085,10 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
>
<span
className="euiFilterButton__textShift"
data-text="Rule Type"
title="Rule Type"
data-text="Log type"
title="Log type"
>
Rule Type
Log type
</span>
</span>
</span>
Expand All @@ -1105,7 +1105,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
Object {
"field": "level",
"multiSelect": "or",
"name": "Rule Severity",
"name": "Rule severity",
"options": Array [
Object {
"color": "#cc5642",
Expand Down Expand Up @@ -1173,7 +1173,7 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
iconType="arrowDown"
onClick={[Function]}
>
Rule Severity
Rule severity
</EuiFilterButton>
}
closePopover={[Function]}
Expand Down Expand Up @@ -1245,10 +1245,10 @@ exports[`<DetectorRulesView /> spec renders the component 1`] = `
>
<span
className="euiFilterButton__textShift"
data-text="Rule Severity"
title="Rule Severity"
data-text="Rule severity"
title="Rule severity"
>
Rule Severity
Rule severity
</span>
</span>
</span>
Expand Down
Loading
Loading