Skip to content

Commit 8d4b84c

Browse files
Desvelaojcorredor-specAdman23rodrigofezFernandoCastilla
authored
Merge 5.0.0 into main (#8726)
* add Responses events tab with linked finding flyout (#8681) * add Responses events tab with linked finding flyout * wrap ids query in lucene language envelope for searchSource * refactor: replace custom flyout with standard DocumentViewTableAndJson in Responses tab * fix: expose source finding _id in Source Finding tab * fix: use sentence case for Active Response flyout title * Prettier fix * fix: prettier fixes for active responses events tab * fix labels * Add spacer * fix: update changelog description * fix: update changelog description * fix: prettier --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> * Moved file from root folder to server in order to fix import on `index.ts` (#8693) * fix import on index.ts and plugin.ts from file on the root of the project. Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> * changelog Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> * change import :( Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> --------- Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> * Document new app Indexer management > Settings app (#8691) * chore: add docs * chore: update image * chore: update image --------- Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> * Change height inside FIM > Inventory sub-tabs (#8709) * Change height * Update CHANGELOG * Use same value than the other tabs * Remove column from malware detection findings table (#8703) * Removed column Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> * changelog Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> --------- Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> * Changed the management of daemons status to the new API response schema (#8706) * change: adapt GET /cluster/{node_id}/status API manager response - Adapt checkDaemons function in frontend side - Adapt checkDaemons function in backend side - Redesing daemons view in Status app: - Add ready and running status information to each daemon - Add overiew ready information - Wrap daemons information into a panel * chore(changelog): add entry * feat(status): move damoens panel to bottom * chore(status): removed unused styles * feat(status): sort daemons by name * feat(status): lowercase the daemon status tooltip * feat(status): lowercase the daemon status tooltip * feat(status): change porperty accessors * Fix `Configuration Assesment > Inventory & Findings` columns width (#8699) * Rework columns Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> * Restore constants and move decimalFormat to helpers + changelog Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> --------- Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> * Migrate artifact handling to S3 in build workflows (#8695) ### Description Migrate artifact handling to S3 in build workflows ### Evidence [(5.x) Build app package (on demand)](https://github.com/wazuh/wazuh-dashboard-plugins/actions/runs/28447770857) ### Check List - [ ] All tests pass - [ ] `yarn test:jest` - [ ] New functionality includes testing. - [ ] New functionality has been documented. - [ ] Update [CHANGELOG.md](./../CHANGELOG.md) - [ ] Commits are signed per the DCO using --signoff * Merge 4.14.7 into 5.0.0 (#8725) * Sanitize Markdown component (#8713) * fix: add missing sanitization * chore: update unit tests * chore: add changelog entry * fix: apply prettier * fix: apply prettier * Migrate artifact handling to S3 in build workflows (#8686) * Migrate dashboard plugins package-building and bumper workflow runner… (#8651) * Migrate dashboard plugins package-building workflow runners to AWS CodeBuild Move the runs-on values of the package-building workflows off the self-hosted wz-linux-amd64 runner and onto AWS CodeBuild ephemeral runners, following issue wazuh/internal-devel-requests#5246 and mirroring wazuh/wazuh-dashboard#1372. - 4_builderpackage_plugins.yml (test-packages): wz-linux-amd64 -> Form A (amd) - 4_builderprecompiled_base-dev-environment.yml (deploy_and_run_command): wz-linux-amd64 -> Form A (amd) These workflows are AMD-only on 4.14.6 (no architecture input/matrix), so both use the fixed AMD CodeBuild runner label. Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> * Pull OSD test image from ECR Public to avoid Docker Hub rate limits * Migrate remaining 4.x workflow runners to CodeBuild and log in to Docker Hub --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> * Migrate GitHub runners to aws runners (#8660) fix: add missing secrets for Docker Hub authentication in build workflow * feat: bump 4.14.6 * Change tag reference for 4.14.6 (#8672) chore(tag-reference): change tag reference for 4.14.6 * feat: migrate artifact handling to S3 in build workflows * feat: update workflows to streamline S3 artifact handling * fix: refine artifact upload path to ensure correct file handling * fix: add recursive flag to aws s3 cp for complete directory copy * fix: simplify plugin installation command in install-plugins.sh * feat: update environment workflows to enhance S3 artifact handling * fix: remove unnecessary blank line in variable setting step * feat: update workflows to migrate artifact handling from base environment to package-specific workflow * fix: update workflow_run reference in build job for clarity * feat: enhance workflow inputs to allow dynamic workflow name for artifact building * feat: migrate artifact handling to use execution repository format for S3 uploads * feat: refine plugin installation script to target specific zip files in /tmp * feat: migrate CI_DEV_INTERNAL_BUCKET and AWS role to use secrets for enhanced security * feat: add id-token permission for enhanced security in workflows * feat: update permissions in build workflow to ensure id-token access is correctly set * feat: add id-token permission to test packages job for enhanced security --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Co-authored-by: jcorredor-spec <juli.ricar0413@gmail.com> Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> Co-authored-by: Antonio <34042064+Desvelao@users.noreply.github.com> * Merge 4.14.6 into 4.14.7 (#8722) * Migrate dashboard plugins package-building and bumper workflow runner… (#8651) * Migrate dashboard plugins package-building workflow runners to AWS CodeBuild Move the runs-on values of the package-building workflows off the self-hosted wz-linux-amd64 runner and onto AWS CodeBuild ephemeral runners, following issue wazuh/internal-devel-requests#5246 and mirroring wazuh/wazuh-dashboard#1372. - 4_builderpackage_plugins.yml (test-packages): wz-linux-amd64 -> Form A (amd) - 4_builderprecompiled_base-dev-environment.yml (deploy_and_run_command): wz-linux-amd64 -> Form A (amd) These workflows are AMD-only on 4.14.6 (no architecture input/matrix), so both use the fixed AMD CodeBuild runner label. Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> * Pull OSD test image from ECR Public to avoid Docker Hub rate limits * Migrate remaining 4.x workflow runners to CodeBuild and log in to Docker Hub --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> * Migrate GitHub runners to aws runners (#8660) fix: add missing secrets for Docker Hub authentication in build workflow * feat: bump 4.14.6 * Change tag reference for 4.14.6 (#8672) chore(tag-reference): change tag reference for 4.14.6 * feat: bump 4.14.6 --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> Co-authored-by: jcorredor-spec <juli.ricar0413@gmail.com> Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Co-authored-by: Rodrigo López <37187963+rodrigofez@users.noreply.github.com> Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Co-authored-by: jcorredor-spec <juli.ricar0413@gmail.com> Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com> --------- Signed-off-by: jcorredor-spec <juli.ricar0413@gmail.com> Signed-off-by: Adam Navarro Megías <adam.navarro@wazuh.com> Signed-off-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Co-authored-by: jcorredor-spec <juli.ricar0413@gmail.com> Co-authored-by: Adam Navarro Megías <145340543+Adman23@users.noreply.github.com> Co-authored-by: Rodrigo López <37187963+rodrigofez@users.noreply.github.com> Co-authored-by: Fernando Castilla <164048568+FernandoCastilla@users.noreply.github.com> Co-authored-by: Ian Yenien Serrano <63758389+yenienserrano@users.noreply.github.com> Co-authored-by: wazuhci <22834044+wazuhci@users.noreply.github.com>
1 parent 462ac4d commit 8d4b84c

39 files changed

Lines changed: 532 additions & 559 deletions

File tree

.github/workflows/4_builderpackage_plugins.yml

Lines changed: 30 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ on:
2424
type: string
2525
default: 4.14.0
2626
description: Source code reference (branch, tag or commit SHA)
27+
execution_repository:
28+
required: true
29+
type: string
30+
default: ''
31+
description: 'Repository and workflow run to upload the artifact to (format: repo/workflow). This is used to locate the artifacts in S3.'
2732
secrets:
2833
DOCKERHUB_USERNAME:
2934
required: true
@@ -37,69 +42,70 @@ on:
3742
default: 4.14.0
3843
description: Source code reference (branch, tag or commit SHA)
3944

45+
env:
46+
CI_DEV_INTERNAL_BUCKET: ${{ secrets.CI_DEV_INTERNAL_BUCKET }}
47+
EXECUTION_REPOSITORY: 'wazuh-dashboard-plugins/4_builderpackage_plugins'
48+
4049
jobs:
4150
# Build an app package from the given source code reference.
4251
build:
4352
name: Build app package
4453
uses: ./.github/workflows/4_builderprecompiled_base-dev-environment.yml
4554
permissions:
4655
pull-requests: write
56+
id-token: write
4757
with:
4858
reference: ${{ inputs.reference }}
4959
command: 'yarn build'
5060
artifact_name: 'wazuh-dashboard-plugins'
61+
execution_repository: ${{ inputs.execution_repository || 'wazuh-dashboard-plugins/4_builderpackage_plugins' }}
5162
secrets: inherit
5263

5364
test-packages:
5465
needs: build
5566
name: Test packages
5667
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
68+
permissions:
69+
id-token: write
5770

5871
steps:
59-
- name: Step 01 - Download the plugin's source code
72+
- name: Download the plugin's source code
6073
uses: actions/checkout@v4
6174
with:
6275
repository: wazuh/wazuh-dashboard-plugins
6376
ref: ${{ inputs.reference }}
6477
path: wazuh
6578

66-
- name: Step 02 - Set variables
79+
- name: Set variables
6780
run: |
6881
echo "githubReference=$(echo ${{ inputs.reference }} | sed 's/\//-/g')" >> $GITHUB_ENV
69-
echo "currentDir=$(pwd -P)" >> $GITHUB_ENV
7082
echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
7183
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
7284
echo "versionPlatform=$(jq -r '.pluginPlatform.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
7385
74-
- name: Step 03 - Download the main plugin's artifact
75-
uses: actions/download-artifact@v4
86+
- name: Configure AWS credentials
87+
uses: aws-actions/configure-aws-credentials@v6
7688
with:
77-
name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
78-
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
79-
overwrite: true
89+
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
90+
aws-region: ${{ secrets.AWS_REGION }}
8091

81-
- name: Step 04 - Download the core plugin's artifact
82-
uses: actions/download-artifact@v4
83-
with:
84-
name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
85-
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
86-
overwrite: true
87-
88-
- name: Step 05 - Download the check-updates plugin's artifact
89-
uses: actions/download-artifact@v4
90-
with:
91-
name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
92-
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
93-
overwrite: true
92+
- name: Download plugin artifacts from S3
93+
run: |
94+
plugins_dir="${{ github.workspace }}/wazuh/scripts/test-packages/plugins"
95+
mkdir -p "${plugins_dir}"
96+
aws s3 cp --recursive \
97+
"${{ env.CI_DEV_INTERNAL_BUCKET }}/${{ inputs.execution_repository || env.EXECUTION_REPOSITORY }}/${{github.run_id}}" \
98+
"${plugins_dir}"
99+
ls -l "${plugins_dir}"
94100
95-
- name: Step 06 - Log in to Docker Hub
101+
- name: Log in to Docker Hub
96102
uses: docker/login-action@v3
97103
with:
98104
username: ${{ secrets.DOCKERHUB_USERNAME }}
99105
password: ${{ secrets.DOCKERHUB_TOKEN }}
100106

101-
- name: Step 07 - Build the Docker image
107+
- name: Build the Docker image
102108
run: |
103-
echo "current=${{ env.currentDir }}"
109+
echo "current=${{ github.workspace }}"
104110
cd ./wazuh/scripts/test-packages
105111
docker build --build-arg OSD_VERSION=${{ env.versionPlatform }} -f osd-test-packages.Dockerfile ./

.github/workflows/4_builderprecompiled_base-dev-environment.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,26 @@ on:
3434
default: 'build'
3535
description: Folder to include in the archive.
3636
required: false
37+
execution_repository:
38+
type: string
39+
default: ''
40+
description: 'Repository and workflow run to upload the artifact to (format: repo/workflow).'
41+
required: false
3742
notify_jest_coverage_summary:
3843
type: boolean
3944
default: false
4045
required: false
4146

47+
env:
48+
CI_DEV_INTERNAL_BUCKET: ${{ secrets.CI_DEV_INTERNAL_BUCKET }}
49+
4250
jobs:
4351
# Deploy the plugin in a development environment and run a command
4452
# using a pre-built Docker image, hosted in Quay.io.
4553
deploy_and_run_command:
4654
permissions:
4755
pull-requests: write
56+
id-token: write
4857
name: Deploy and run command
4958
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
5059
strategy:
@@ -69,7 +78,7 @@ jobs:
6978
]
7079

7180
steps:
72-
- name: Step 01 - Download the plugin's source code
81+
- name: Download the plugin's source code
7382
uses: actions/checkout@v4
7483
with:
7584
repository: wazuh/wazuh-dashboard-plugins
@@ -78,10 +87,10 @@ jobs:
7887

7988
# Fix source code ownership so the internal user of the Docker
8089
# container is also owner.
81-
- name: Step 02 - Change code ownership
90+
- name: Change code ownership
8291
run: sudo chown 1000:1000 -R wazuh;
8392

84-
- name: Step 03 - Set up the environment and run the command
93+
- name: Set up the environment and run the command
8594
run: |
8695
# Detect which platform to use from source code
8796
platform=kbn;
@@ -149,16 +158,23 @@ jobs:
149158
echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
150159
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
151160
152-
- name: Step 04 - Upload artifact to GitHub
161+
- name: Configure AWS credentials
153162
if: ${{ inputs.artifact_name && inputs.artifact_path }}
154-
uses: actions/upload-artifact@v4
163+
uses: aws-actions/configure-aws-credentials@v6
155164
with:
156-
name: ${{ inputs.artifact_name }}_${{ matrix.plugins.container_path }}_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
157-
path: ${{ matrix.plugins.path }}/${{ inputs.artifact_path }}
158-
if-no-files-found: 'error'
159-
overwrite: true
165+
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
166+
aws-region: ${{ secrets.AWS_REGION }}
167+
168+
- name: Upload artifact to S3
169+
if: ${{ inputs.artifact_name && inputs.artifact_path }}
170+
run: |
171+
artifact_zip="${{ inputs.artifact_name }}_${{ matrix.plugins.container_path }}_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip"
172+
s3_path="${{ env.CI_DEV_INTERNAL_BUCKET }}/${{ inputs.execution_repository }}/${{ github.run_id}}/${artifact_zip}"
173+
packagePath=$(find "${GITHUB_WORKSPACE}/${{ matrix.plugins.path }}/${{ inputs.artifact_path }}" -type f)
174+
aws s3 cp "${packagePath}" "${s3_path}"
175+
echo "::notice::Artifact uploaded to ${s3_path}"
160176
161-
- name: Step 05 - Upload coverage results to GitHub
177+
- name: Upload coverage results to GitHub
162178
if: ${{ inputs.notify_jest_coverage_summary && github.event_name == 'pull_request' }}
163179
uses: ./wazuh/.github/actions/comment-test-coverage
164180
with:

.github/workflows/5_builderpackage_plugins.yml

Lines changed: 30 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ on:
2424
type: string
2525
default: main
2626
description: Source code reference (branch, tag or commit SHA)
27+
execution_repository:
28+
required: true
29+
type: string
30+
default: ''
31+
description: 'Repository and workflow run to upload the artifact to (format: repo/workflow). This is used to locate the artifacts in S3.'
2732
workflow_dispatch:
2833
inputs:
2934
reference:
@@ -32,66 +37,70 @@ on:
3237
default: main
3338
description: Source code reference (branch, tag or commit SHA)
3439

40+
env:
41+
CI_DEV_INTERNAL_BUCKET: ${{ secrets.CI_DEV_INTERNAL_BUCKET }}
42+
EXECUTION_REPOSITORY: 'wazuh-dashboard-plugins/5_builderpackage_plugins'
43+
3544
jobs:
3645
# Build an app package from the given source code reference.
3746
build:
3847
name: Build app package
3948
uses: ./.github/workflows/5_builderprecompiled_base-dev-environment.yml
4049
permissions:
4150
pull-requests: write
51+
id-token: write
4252
with:
4353
reference: ${{ inputs.reference }}
4454
command: 'yarn build'
4555
artifact_name: 'wazuh-dashboard-plugins'
56+
execution_repository: ${{ inputs.execution_repository || 'wazuh-dashboard-plugins/5_builderpackage_plugins' }}
4657
secrets: inherit
4758

4859
test-packages:
4960
needs: build
5061
name: Test packages
5162
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
63+
permissions:
64+
id-token: write
5265

5366
steps:
54-
- name: Step 01 - Download the plugin's source code
67+
- name: Download the plugin's source code
5568
uses: actions/checkout@v4
5669
with:
5770
repository: wazuh/wazuh-dashboard-plugins
5871
ref: ${{ inputs.reference }}
5972
path: wazuh
6073

61-
- name: Step 02 - Set variables
74+
- name: Set variables
6275
run: |
6376
echo "githubReference=$(echo ${{ inputs.reference }} | sed 's/\//-/g')" >> $GITHUB_ENV
64-
echo "currentDir=$(pwd -P)" >> $GITHUB_ENV
6577
echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
6678
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
6779
echo "versionPlatform=$(jq -r '.pluginPlatform.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
6880
69-
- name: Step 03 - Download the main plugin's artifact
70-
uses: actions/download-artifact@v4
81+
- name: Configure AWS credentials
82+
uses: aws-actions/configure-aws-credentials@v6
7183
with:
72-
name: wazuh-dashboard-plugins_main_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
73-
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_main_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
84+
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
85+
aws-region: ${{ secrets.AWS_REGION }}
7486

75-
- name: Step 04 - Download the core plugin's artifact
76-
uses: actions/download-artifact@v4
77-
with:
78-
name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
79-
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
80-
81-
- name: Step 05 - Download the check-updates plugin's artifact
82-
uses: actions/download-artifact@v4
83-
with:
84-
name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
85-
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
87+
- name: Download plugin artifacts from S3
88+
run: |
89+
plugins_dir="${{ github.workspace }}/wazuh/scripts/test-packages/plugins"
90+
mkdir -p "${plugins_dir}"
91+
aws s3 cp --recursive \
92+
"${{ env.CI_DEV_INTERNAL_BUCKET }}/${{ inputs.execution_repository || env.EXECUTION_REPOSITORY }}/${{github.run_id}}" \
93+
"${plugins_dir}"
94+
ls -l "${plugins_dir}"
8695
87-
- name: Step 06 - Log in to Docker Hub
96+
- name: Log in to Docker Hub
8897
uses: docker/login-action@v3
8998
with:
9099
username: ${{ secrets.DOCKERHUB_USERNAME }}
91100
password: ${{ secrets.DOCKERHUB_TOKEN }}
92101

93-
- name: Step 07 - Build the Docker image
102+
- name: Build the Docker image
94103
run: |
95-
echo "current=${{ env.currentDir }}"
104+
echo "current=${{ github.workspace }}"
96105
cd ./wazuh/scripts/test-packages
97106
docker build --build-arg OSD_VERSION=${{ env.versionPlatform }} -f osd-test-packages.Dockerfile ./

.github/workflows/5_builderprecompiled_base-dev-environment.yml

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,26 @@ on:
3434
default: 'build'
3535
description: Folder to include in the archive.
3636
required: false
37+
execution_repository:
38+
type: string
39+
default: ''
40+
description: 'Repository and workflow run to upload the artifact to (format: repo/workflow).'
41+
required: false
3742
notify_jest_coverage_summary:
3843
type: boolean
3944
default: false
4045
required: false
4146

47+
env:
48+
CI_DEV_INTERNAL_BUCKET: ${{ secrets.CI_DEV_INTERNAL_BUCKET }}
49+
4250
jobs:
4351
# Deploy the plugin in a development environment and run a command
4452
# using a pre-built Docker image, hosted in Quay.io.
4553
deploy_and_run_command:
4654
permissions:
4755
pull-requests: write
56+
id-token: write
4857
name: Deploy and run command
4958
runs-on: codebuild-github-actions-codebuild-runner-dashboard-amd-${{ github.run_id }}-${{ github.run_attempt }}
5059
strategy:
@@ -69,7 +78,7 @@ jobs:
6978
]
7079

7180
steps:
72-
- name: Step 01 - Download the plugin's source code
81+
- name: Download the plugin's source code
7382
uses: actions/checkout@v4
7483
with:
7584
repository: wazuh/wazuh-dashboard-plugins
@@ -78,10 +87,10 @@ jobs:
7887

7988
# Fix source code ownership so the internal user of the Docker
8089
# container is also owner.
81-
- name: Step 02 - Change code ownership
90+
- name: Change code ownership
8291
run: sudo chown 1000:1000 -R wazuh;
8392

84-
- name: Step 03 - Set up the environment and run the command
93+
- name: Set up the environment and run the command
8594
run: |
8695
# Detect which platform to use from source code
8796
platform=kbn;
@@ -127,16 +136,23 @@ jobs:
127136
echo "version=$(jq -r '.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
128137
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
129138
130-
- name: Step 04 - Upload artifact to GitHub
139+
- name: Configure AWS credentials
131140
if: ${{ inputs.artifact_name && inputs.artifact_path }}
132-
uses: actions/upload-artifact@v4
141+
uses: aws-actions/configure-aws-credentials@v6
133142
with:
134-
name: ${{ inputs.artifact_name }}_${{ matrix.plugins.container_path }}_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip
135-
path: ${{ matrix.plugins.path }}/${{ inputs.artifact_path }}
136-
if-no-files-found: 'error'
137-
overwrite: true
143+
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
144+
aws-region: ${{ secrets.AWS_REGION }}
145+
146+
- name: Upload artifact to S3
147+
if: ${{ inputs.artifact_name && inputs.artifact_path }}
148+
run: |
149+
artifact_zip="${{ inputs.artifact_name }}_${{ matrix.plugins.container_path }}_${{ env.version }}-${{ env.revision }}_${{ env.githubReference }}.zip"
150+
s3_path="${{ env.CI_DEV_INTERNAL_BUCKET }}/${{ inputs.execution_repository }}/${{ github.run_id}}/${artifact_zip}"
151+
packagePath=$(find "${GITHUB_WORKSPACE}/${{ matrix.plugins.path }}/${{ inputs.artifact_path }}" -type f)
152+
aws s3 cp "${packagePath}" "${s3_path}"
153+
echo "::notice::Artifact uploaded to ${s3_path}"
138154
139-
- name: Step 05 - Upload coverage results to GitHub
155+
- name: Upload coverage results to GitHub
140156
if: ${{ inputs.notify_jest_coverage_summary && github.event_name == 'pull_request' }}
141157
uses: ./wazuh/.github/actions/comment-test-coverage
142158
with:

0 commit comments

Comments
 (0)