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.10/cronos_1.4.10_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.10_Linux_x86_64.tar.gz \
&& rm cronos_1.4.10_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.5.0/cronos_1.5.0_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.0_Linux_x86_64.tar.gz \
&& rm cronos_1.5.0_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

❓ Verification inconclusive

Remove insecure TLS bypass; verify downloads and extract directly into target.

wget --no-check-certificate disables TLS verification (flagged by Checkov CKV2_DOCKER_3). Also, mv ./* /home/cronos/ from /tmp is brittle—extract straight into the destination and avoid moving unrelated files.

Apply this diff to harden the fetch and extraction:

-RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.0_Linux_x86_64.tar.gz \
-     && rm cronos_1.5.0_Linux_x86_64.tar.gz && mv ./* /home/cronos/
+RUN set -eux; \
+  cd /tmp; \
+  curl -fsSLO https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz; \
+  curl -fsSLO https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz.sha256; \
+  sha256sum -c cronos_1.5.0_Linux_x86_64.tar.gz.sha256; \
+  mkdir -p /home/cronos; \
+  tar -xzf cronos_1.5.0_Linux_x86_64.tar.gz -C /home/cronos --strip-components=1; \
+  rm -rf /tmp/*

Follow-up: if the tarball layout differs, adjust --strip-components accordingly.


Remove insecure TLS bypass; verify downloads and extract directly into target.

File: Dockerfile (lines 7–8) — wget --no-check-certificate disables TLS verification (Checkov CKV2_DOCKER_3). Avoid mv ./* /home/cronos from /tmp; download+verify checksum and extract straight into /home/cronos.

Apply this diff to harden the fetch and extraction:

-RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.0_Linux_x86_64.tar.gz \
-     && rm cronos_1.5.0_Linux_x86_64.tar.gz && mv ./* /home/cronos/
+RUN set -eux; \
+  cd /tmp; \
+  curl -fsSLO https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz; \
+  curl -fsSLO https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz.sha256; \
+  sha256sum -c cronos_1.5.0_Linux_x86_64.tar.gz.sha256; \
+  mkdir -p /home/cronos; \
+  tar -xzf cronos_1.5.0_Linux_x86_64.tar.gz -C /home/cronos --strip-components=1; \
+  rm -rf /tmp/*

Follow-up: if the tarball layout differs, adjust --strip-components accordingly.

📝 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.5.0/cronos_1.5.0_Linux_x86_64.tar.gz && tar -xvf cronos_1.5.0_Linux_x86_64.tar.gz \
&& rm cronos_1.5.0_Linux_x86_64.tar.gz && mv ./* /home/cronos/
RUN set -eux; \
cd /tmp; \
curl -fsSLO https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz; \
curl -fsSLO https://github.com/crypto-org-chain/cronos/releases/download/v1.5.0/cronos_1.5.0_Linux_x86_64.tar.gz.sha256; \
sha256sum -c cronos_1.5.0_Linux_x86_64.tar.gz.sha256; \
mkdir -p /home/cronos; \
tar -xzf cronos_1.5.0_Linux_x86_64.tar.gz -C /home/cronos --strip-components=1; \
rm -rf /tmp/*
🧰 Tools
🪛 Checkov (3.2.334)

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

(CKV2_DOCKER_3)

🤖 Prompt for AI Agents
Dockerfile lines 7-8: the RUN uses wget --no-check-certificate and moves
everything from /tmp into /home/cronos; replace this with a secure download
flow: fetch the tarball with a TLS-valid tool (curl -fSL or wget without
--no-check-certificate) into a temp file, fetch the corresponding checksum (or
signature) and verify it (sha256sum --check or gpg --verify) before extraction,
then extract the tarball directly into /home/cronos using tar with an
appropriate --strip-components value to avoid unwanted directory nesting, set
correct ownership/permissions, and remove temp files; ensure the step fails on
verification errors so builds stop on tampered downloads.

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

USER root
Expand Down