From 70c8fe7a26a0341a86672f349d306b3938becb6a Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 27 Mar 2025 10:44:18 -0700 Subject: [PATCH 1/7] Update version qualifier to beta1. Signed-off-by: AWSHurneyt --- .cypress/integration/1_detectors.spec.js | 24 ++++++++++++------- .cypress/integration/2_rules.spec.js | 2 +- .cypress/support/helpers.js | 3 +-- .github/workflows/cypress-workflow.yml | 2 +- .../workflows/verify-binary-installation.yml | 2 +- cypress.config.js | 4 ++-- opensearch_dashboards.json | 2 +- package.json | 2 +- 8 files changed, 23 insertions(+), 18 deletions(-) diff --git a/.cypress/integration/1_detectors.spec.js b/.cypress/integration/1_detectors.spec.js index 8a18db2c7..42a9355bc 100644 --- a/.cypress/integration/1_detectors.spec.js +++ b/.cypress/integration/1_detectors.spec.js @@ -207,16 +207,22 @@ describe('Detectors', () => { // Create test index cy.createIndex(cypressIndexDns, sample_dns_index_settings).then(() => cy - .request('POST', '_plugins/_security_analytics/rules/_search?prePackaged=true', { - from: 0, - size: 5000, - query: { - nested: { - path: 'rule', - query: { bool: { must: [{ match: { 'rule.category': 'dns' } }] } }, + .request( + 'POST', + `${Cypress.env( + 'opensearch_url' + )}/_plugins/_security_analytics/rules/_search?pre_packaged=true`, + { + from: 0, + size: 5000, + query: { + nested: { + path: 'rule', + query: { bool: { must: [{ match: { 'rule.category': 'dns' } }] } }, + }, }, - }, - }) + } + ) .should('have.property', 'status', 200) ); diff --git a/.cypress/integration/2_rules.spec.js b/.cypress/integration/2_rules.spec.js index a7d2271fd..fae4c028a 100644 --- a/.cypress/integration/2_rules.spec.js +++ b/.cypress/integration/2_rules.spec.js @@ -576,7 +576,7 @@ describe('Rules', () => { it('...can be imported with log type', () => { getImportButton().click({ force: true }); - getImportRuleFilePicker().selectFile('./cypress/fixtures/sample_aws_s3_rule_to_import.yml'); + getImportRuleFilePicker().selectFile('./.cypress/fixtures/sample_aws_s3_rule_to_import.yml'); // Check that AWS S3 log type is set. cy.contains('AWS S3'); }); diff --git a/.cypress/support/helpers.js b/.cypress/support/helpers.js index e430fb8f0..b3dbb1ff6 100644 --- a/.cypress/support/helpers.js +++ b/.cypress/support/helpers.js @@ -63,8 +63,7 @@ Cypress.Commands.add( } Cypress.log({ message: `Select combobox items: ${items.join(' | ')}` }); items.map((item) => { - cy.wrap(subject).type(item); - cy.get(`[title="${item}"]`).click({ force: true }); + cy.wrap(subject).type(item + '{downarrow}{enter}'); }); } ); diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index c6cb0d8bc..13321c256 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -8,7 +8,7 @@ on: - "*" env: OPENSEARCH_DASHBOARDS_VERSION: 'main' - OPENSEARCH_VERSION: '3.0.0-alpha1-SNAPSHOT' + OPENSEARCH_VERSION: '3.0.0-beta1-SNAPSHOT' SECURITY_ANALYTICS_BRANCH: 'main' GRADLE_VERSION: '7.6.1' jobs: diff --git a/.github/workflows/verify-binary-installation.yml b/.github/workflows/verify-binary-installation.yml index cc35b5255..84715ba79 100644 --- a/.github/workflows/verify-binary-installation.yml +++ b/.github/workflows/verify-binary-installation.yml @@ -2,7 +2,7 @@ name: 'Install Dashboards with Plugin via Binary' on: [push, pull_request] env: - OPENSEARCH_VERSION: '3.0.0-alpha1' + OPENSEARCH_VERSION: '3.0.0-beta1' CI: 1 # avoid warnings like "tput: No value for $TERM and no -T specified" TERM: xterm diff --git a/cypress.config.js b/cypress.config.js index e234d283e..4df7a42d8 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -8,7 +8,7 @@ module.exports = defineConfig({ responseTimeout: 300000, env: { opensearch_url: 'localhost:9200', - opensearch_dashboards: 'http://localhost:5601', + opensearch_dashboards: 'localhost:5601', security_enabled: false, }, fixturesFolder: '.cypress/fixtures', @@ -18,7 +18,7 @@ module.exports = defineConfig({ // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { - return require('./.cypress/plugins/index.js')(on, config); + return require('./.cypress/plugins/index.ts')(on, config); }, specPattern: '.cypress/integration/*.spec.js', supportFile: '.cypress/support/index.js', diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 3ae76e295..5d66f3c10 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,6 +1,6 @@ { "id": "securityAnalyticsDashboards", - "version": "3.0.0.0-alpha1", + "version": "3.0.0.0-beta1", "opensearchDashboardsVersion": "3.0.0", "configPath": ["opensearch_security_analytics"], "requiredPlugins": ["data", "navigation", "opensearchDashboardsUtils", "contentManagement"], diff --git a/package.json b/package.json index 97362170d..187f074b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "opensearch_security_analytics_dashboards", - "version": "3.0.0.0-alpha1", + "version": "3.0.0.0-beta1", "description": "OpenSearch Dashboards plugin for Security Analytics", "main": "index.js", "license": "Apache-2.0", From 1262c4aad7e3bb7ca2bd73d5f6e95a01c1b32d02 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Thu, 27 Mar 2025 13:26:49 -0700 Subject: [PATCH 2/7] Temporarily remove visualization widget. Signed-off-by: AWSHurneyt --- .../Overview/components/Widgets/Summary.tsx | 70 +++++++++---------- .../Overview/containers/Overview/Overview.tsx | 20 +++--- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/public/pages/Overview/components/Widgets/Summary.tsx b/public/pages/Overview/components/Widgets/Summary.tsx index 226570dbf..80b9287a5 100644 --- a/public/pages/Overview/components/Widgets/Summary.tsx +++ b/public/pages/Overview/components/Widgets/Summary.tsx @@ -149,41 +149,41 @@ export const Summary: React.FC = ({ )} )} - {/**/} - {/* {activeAlerts === 0 && totalFindings === 0 ? (*/} - {/* */} - {/*

No alerts and findings found

*/} - {/* */} - {/* }*/} - {/* body={*/} - {/* <>*/} - {/*

*/} - {/* */} - {/* Adjust the time range to see more results or create a
*/} - {/* detector to generate findings.*/} - {/*
*/} - {/*

*/} - {/* */} - {/* Create a detector*/} - {/* */} - {/* */} - {/* }*/} - {/* />*/} - {/* ) : (*/} - {/*
*/} - {/* */} - {/*
*/} - {/* )}*/} - {/*
*/} + + {activeAlerts === 0 && totalFindings === 0 ? ( + +

No alerts and findings found

+ + } + body={ + <> +

+ + Adjust the time range to see more results or create a
+ detector to generate findings. +
+

+ + Create a detector + + + } + /> + ) : ( +
+ +
+ )} +
); diff --git a/public/pages/Overview/containers/Overview/Overview.tsx b/public/pages/Overview/containers/Overview/Overview.tsx index ec1fc07e0..d2fc4d690 100644 --- a/public/pages/Overview/containers/Overview/Overview.tsx +++ b/public/pages/Overview/containers/Overview/Overview.tsx @@ -298,16 +298,16 @@ export const Overview: React.FC = (props) => { )} - - - + {/**/} + {/* */} + {/**/} From 874e8e983d8019973753de8695a78fb093d5f383 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Fri, 28 Mar 2025 11:22:20 -0700 Subject: [PATCH 3/7] Adjust cypress workflow. Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 13321c256..932279e13 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -17,7 +17,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest] - include: + fail-fast: false + include: - os: windows-latest cypress_cache_folder: ~/AppData/Local/Cypress/Cache - os: ubuntu-latest From e07a3d437eea7871b03bb473a16d733e48460610 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Fri, 28 Mar 2025 12:13:51 -0700 Subject: [PATCH 4/7] Fixed typo in workflow file. Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index 932279e13..aab7108a5 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -15,9 +15,9 @@ jobs: tests: name: Run Cypress E2E tests strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - fail-fast: false include: - os: windows-latest cypress_cache_folder: ~/AppData/Local/Cypress/Cache From 2554d9d0c2dc2a2a85997aa7bfc5f495f9e80b39 Mon Sep 17 00:00:00 2001 From: AWSHurneyt Date: Fri, 28 Mar 2025 15:04:38 -0700 Subject: [PATCH 5/7] Fixed typo in workflow file. Signed-off-by: AWSHurneyt --- .github/workflows/cypress-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cypress-workflow.yml b/.github/workflows/cypress-workflow.yml index aab7108a5..c80f84190 100644 --- a/.github/workflows/cypress-workflow.yml +++ b/.github/workflows/cypress-workflow.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest] - include: + include: - os: windows-latest cypress_cache_folder: ~/AppData/Local/Cypress/Cache - os: ubuntu-latest From d1727d27ee86545ba31ff1544aa079ced26174a7 Mon Sep 17 00:00:00 2001 From: Thomas Hurney Date: Fri, 28 Mar 2025 18:20:45 -0700 Subject: [PATCH 6/7] Fixed execpted text for test. Signed-off-by: Thomas Hurney --- .cypress/integration/1_detectors.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cypress/integration/1_detectors.spec.js b/.cypress/integration/1_detectors.spec.js index 42a9355bc..8ea7bd3b6 100644 --- a/.cypress/integration/1_detectors.spec.js +++ b/.cypress/integration/1_detectors.spec.js @@ -18,7 +18,7 @@ const cypressIndexDns = 'cypress-index-dns'; const cypressIndexWindows = 'cypress-index-windows'; const detectorName = 'test detector'; const cypressLogTypeDns = 'dns'; -const creationFailedMessage = 'Create detector failed.'; +const creationFailedMessage = 'Invalid field mappings.'; const cypressDNSRule = dns_name_rule_data.title; From ce4143c7136e5b7d870f57d438401ffdbf34fa3c Mon Sep 17 00:00:00 2001 From: Thomas Hurney Date: Fri, 28 Mar 2025 18:23:43 -0700 Subject: [PATCH 7/7] Fixed execpted text for test. Signed-off-by: Thomas Hurney --- .cypress/integration/1_detectors.spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cypress/integration/1_detectors.spec.js b/.cypress/integration/1_detectors.spec.js index 8ea7bd3b6..42a9355bc 100644 --- a/.cypress/integration/1_detectors.spec.js +++ b/.cypress/integration/1_detectors.spec.js @@ -18,7 +18,7 @@ const cypressIndexDns = 'cypress-index-dns'; const cypressIndexWindows = 'cypress-index-windows'; const detectorName = 'test detector'; const cypressLogTypeDns = 'dns'; -const creationFailedMessage = 'Invalid field mappings.'; +const creationFailedMessage = 'Create detector failed.'; const cypressDNSRule = dns_name_rule_data.title;