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

Fix CVE-2024-4068, CVE-2023-28155 #1225

Closed
wants to merge 5 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
17 changes: 8 additions & 9 deletions .github/workflows/cypress-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ name: E2E tests workflow
on:
pull_request:
branches:
- main
- 1.*
- "*"
push:
branches:
- main
- 1.*
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
OPENSEARCH_VERSION: '1.3.0-SNAPSHOT'
OPENSEARCH_DASHBOARDS_VERSION: '1.3'
OPENSEARCH_VERSION: '1.3.7-SNAPSHOT'
ISM_PLUGIN_VERSION: '1.3'
jobs:
tests:
name: Run Cypress E2E tests
Expand All @@ -31,7 +30,7 @@ jobs:
with:
path: index-management
repository: opensearch-project/index-management
ref: 'main'
ref: ${{env.ISM_PLUGIN_VERSION}}
- name: Run opensearch with plugin
run: |
cd index-management
Expand Down Expand Up @@ -84,13 +83,13 @@ jobs:
wait-on: 'http://localhost:5601'
browser: chrome
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-screenshots
path: OpenSearch-Dashboards/plugins/index-management-dashboards-plugin/cypress/screenshots
# Test run video was always captured, so this action uses "always()" condition
- uses: actions/upload-artifact@v1
- uses: actions/upload-artifact@v4
if: always()
with:
name: cypress-videos
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/unit-tests-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,24 @@ name: Unit tests workflow
on:
pull_request:
branches:
- main
- 1.*
- "*"
push:
branches:
- main
- development-*
- "*"
env:
OPENSEARCH_DASHBOARDS_VERSION: '1.x'
jobs:
tests:
name: Run unit tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest , windows-latest ]
runs-on: ${{ matrix.os }}
steps:
- name: Enable longer filenames
if: ${{ matrix.os == 'windows-latest' }}
run: git config --system core.longpaths true
- name: Checkout Index Management Dashboards plugin
uses: actions/checkout@v2
with:
Expand All @@ -30,6 +35,7 @@ jobs:
run: |
echo "::set-output name=node_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.node).match(/[.0-9]+/)[0]")"
echo "::set-output name=yarn_version::$(node -p "(require('./OpenSearch-Dashboards/package.json').engines.yarn).match(/[.0-9]+/)[0]")"
shell: bash
- name: Setup node
uses: actions/setup-node@v1
with:
Expand All @@ -40,12 +46,14 @@ jobs:
npm uninstall -g yarn
echo "Installing yarn ${{ steps.versions_step.outputs.yarn_version }}"
npm i -g yarn@${{ steps.versions.outputs.yarn_version }}
shell: bash
- name: Bootstrap plugin/OpenSearch-Dashboards
run: |
mkdir -p OpenSearch-Dashboards/plugins
mv index-management-dashboards-plugin OpenSearch-Dashboards/plugins
cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin
yarn osd bootstrap
shell: bash
- name: Run tests
run: |
cd OpenSearch-Dashboards/plugins/index-management-dashboards-plugin
Expand Down
4 changes: 2 additions & 2 deletions opensearch_dashboards.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "indexManagementDashboards",
"version": "1.3.0.0",
"opensearchDashboardsVersion": "1.3.0",
"version": "1.3.7.0",
"opensearchDashboardsVersion": "1.3.7",
"configPath": ["opensearch_index_management"],
"requiredPlugins": ["navigation"],
"server": true,
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "opensearch_index_management_dashboards",
"version": "1.3.0.0",
"version": "1.3.7.0",
"description": "Opensearch Dashboards plugin for Index Management",
"main": "index.js",
"license": "Apache-2.0",
Expand All @@ -19,7 +19,7 @@
"opensearch": "node ../../scripts/opensearch",
"lint": "eslint .",
"plugin-helpers": "node ../../scripts/plugin_helpers",
"test:jest": "NODE_PATH=../../node_modules ../../node_modules/.bin/jest --config ./test/jest.config.js",
"test:jest": "../../node_modules/.bin/jest --config ./test/jest.config.js",
"build": "yarn plugin-helpers build",
"postbuild": "echo Renaming build artifact to [$npm_package_config_zip_name-$npm_package_version.zip] && mv build/$npm_package_config_id*.zip build/$npm_package_config_zip_name-$npm_package_version.zip"
},
Expand All @@ -41,7 +41,10 @@
"glob-parent": "^5.1.2",
"ssri": "^6.0.2",
"lodash": "^4.17.21",
"hosted-git-info": "^2.8.9"
"hosted-git-info": "^2.8.9",
"@cypress/request": "^2.8.12",
"braces": "^3.0.3",
"micromatch": "^4.0.8"
},
"devDependencies": {
"@elastic/elastic-eslint-config-kibana": "link:../../packages/opensearch-eslint-config-opensearch-dashboards",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@ export default class TransformIndices extends Component<TransformIndicesProps, T
label="Source index"
error={sourceIndexError}
isInvalid={sourceIndexError != ""}
helpText="The index where this transform job is performed on. Type in * as wildcard for index pattern.
Indices cannot be changed once the job is created. Please ensure that you select the right source index."
helpText="The index where this transform job is performed on. Type in * as wildcard for index pattern. Indices cannot be changed once the job is created. Please ensure that you select the right source index."
>
<EuiComboBox
placeholder="Select source index"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ export default class ApplyPolicyModal extends Component<ApplyPolicyModalProps, A
getRolloverAliasError = (rolloverAlias: string): string => {
const { hasRolloverAction } = this.state;
const { indices } = this.props;
const isDataStream = indices[0].includes(".ds");
const hasSingleIndexSelected = indices.length === 1;
const requiresAlias = hasRolloverAction && hasSingleIndexSelected;
const requiresAlias = hasRolloverAction && hasSingleIndexSelected && !isDataStream;
const hasAliasError = requiresAlias && !rolloverAlias;
return hasAliasError ? "Required" : "";
};
Expand Down
Loading
Loading