Skip to content

Commit

Permalink
Escalate root user privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
asteriscos committed Nov 26, 2024
1 parent 02ed73b commit 13b0867
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/manual-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,21 @@ jobs:
echo "revision=$(jq -r '.revision' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
echo "versionPlatform=$(jq -r '.pluginPlatform.version' $(pwd)/wazuh/plugins/main/package.json)" >> $GITHUB_ENV
- name: Step 03 - Download the plugin's artifact
- name: Step 03 - Download the main plugin's artifact
uses: actions/download-artifact@v4
with:
name: wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
overwrite: true

- name: Step 04 - Download the plugin's artifact
- name: Step 04 - Download the core plugin's artifact
uses: actions/download-artifact@v4
with:
name: wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
path: ${{ env.currentDir }}/wazuh/scripts/test-packages/plugins/wazuh-dashboard-plugins_wazuh-core_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
overwrite: true

- name: Step 05 - Download the plugin's artifact
- name: Step 05 - Download the check-updates plugin's artifact
uses: actions/download-artifact@v4
with:
name: wazuh-dashboard-plugins_wazuh-check-updates_${{ env.version }}-${{ env.revision }}_${{ inputs.reference }}.zip
Expand Down
4 changes: 2 additions & 2 deletions scripts/test-packages/install-plugins.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
plugins=$(ls /tmp)
plugins=$(ls /tmp)
echo $plugins
for plugin in $plugins; do
echo $plugin
unzip $plugin -d /unziped/
done
plugins=$(ls /tmp/unziped)
plugins=$(ls /tmp/unziped)
for plugin in $plugins; do
echo $plugin
/usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install file:///tmp/unziped/$plugin
Expand Down
11 changes: 5 additions & 6 deletions scripts/test-packages/osd-test-packages.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ ARG PACKAGE_NAME

ADD ./plugins /tmp/
# This is needed to run it local
#
# USER root
# RUN yum update -y && yum install -y unzip

USER root
RUN yum update -y && yum install -y unzip
# RUN unzip /tmp/${PACKAGE_NAME} -d /tmp/
# RUN rm /tmp/${PACKAGE_NAME}
# USER opensearch-dashboards
#
RUN yum update -y && yum install -y unzip
USER opensearch-dashboards

COPY --chown=opensearch-dashboards ./install-plugins.sh /
RUN chmod +x /install-plugins.sh
RUN /install-plugins.sh
Expand Down

0 comments on commit 13b0867

Please sign in to comment.