Skip to content
Merged
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
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ RUN adduser --disabled-password --gecos "" --no-create-home --uid 1000 cronos

RUN mkdir -p /home/cronos/data && mkdir -p /home/cronos/config
RUN apt-get update -y && apt-get install wget curl procps net-tools jq lz4 -y
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.5/cronos_1.4.5-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.5-testnet_Linux_x86_64.tar.gz \
&& rm cronos_1.4.5-testnet_Linux_x86_64.tar.gz && mv ./* /home/cronos/
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.7/cronos_1.4.7-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.7-testnet_Linux_x86_64.tar.gz \
&& rm cronos_1.4.7-testnet_Linux_x86_64.tar.gz && mv ./* /home/cronos/
Comment on lines +7 to +8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Insecure disabling of certificate validation in wget command

Disabling SSL certificate verification (--no-check-certificate) opens the build to man-in-the-middle attacks. GitHub releases are served over valid HTTPS, so this flag is unnecessary.

Additionally, to make future version bumps simpler and avoid hard-coding, consider parameterizing the Cronos version with a build argument (ARG CRONOS_VERSION=1.4.7-testnet).

Apply this diff:

-RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.7/cronos_1.4.7-testnet_Linux_x86_64.tar.gz \
+ARG CRONOS_VERSION=1.4.7-testnet
+RUN cd /tmp && wget https://github.com/crypto-org-chain/cronos/releases/download/v${CRONOS_VERSION}/cronos_${CRONOS_VERSION}_Linux_x86_64.tar.gz \
      && tar -xvf cronos_${CRONOS_VERSION}_Linux_x86_64.tar.gz \
      && rm cronos_${CRONOS_VERSION}_Linux_x86_64.tar.gz \
      && mv ./* /home/cronos/
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.7/cronos_1.4.7-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.7-testnet_Linux_x86_64.tar.gz \
&& rm cronos_1.4.7-testnet_Linux_x86_64.tar.gz && mv ./* /home/cronos/
# parameterize Cronos version for easier bumps
ARG CRONOS_VERSION=1.4.7-testnet
RUN cd /tmp && \
wget https://github.com/crypto-org-chain/cronos/releases/download/v${CRONOS_VERSION}/cronos_${CRONOS_VERSION}_Linux_x86_64.tar.gz && \
tar -xvf cronos_${CRONOS_VERSION}_Linux_x86_64.tar.gz && \
rm cronos_${CRONOS_VERSION}_Linux_x86_64.tar.gz && \
mv ./* /home/cronos/
🧰 Tools
🪛 Checkov (3.2.334)

[HIGH] 7-8: Ensure that certificate validation isn't disabled with wget

(CKV2_DOCKER_3)

🤖 Prompt for AI Agents
In Dockerfile lines 7 to 8, remove the `--no-check-certificate` flag from the
wget command to ensure SSL certificate validation is enforced, preventing
security risks. Introduce a build argument `ARG CRONOS_VERSION=1.4.7-testnet` at
the top of the Dockerfile and replace the hard-coded version in the wget URL and
filenames with this variable to simplify future version updates.

RUN chown -R cronos:cronos /home/cronos && chmod 1777 /tmp

USER root
Expand Down