Skip to content
Open
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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.9/cronos_1.4.9_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.9_Linux_x86_64.tar.gz \
RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.9/cronos_1.4.9-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.9_Linux_x86_64.tar.gz \
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Avoid --no-check-certificate unless absolutely necessary

Disabling TLS verification silences MITM-protection and triggers CVE scanners (CKV2_DOCKER_3).
If GitHub’s certificate problems are not expected, remove the flag; otherwise fetch the artifact with curl --proto '=https' --tlsv1.2 --location and pin the SHA256 to guarantee integrity.

🧰 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 at line 7, remove the wget option --no-check-certificate to avoid
disabling TLS verification. Instead, replace wget with curl using the flags
--proto '=https' --tlsv1.2 --location to securely fetch the file. Additionally,
add a step to verify the downloaded file's SHA256 checksum to ensure its
integrity before extraction.

&& rm cronos_1.4.9_Linux_x86_64.tar.gz && mv ./* /home/cronos/
RUN chown -R cronos:cronos /home/cronos && chmod 1777 /tmp
Comment on lines +7 to 9
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Archive name mismatch will break the build

The file you now download is cronos_1.4.9-testnet_Linux_x86_64.tar.gz, yet the subsequent tar -xvf and rm commands still reference cronos_1.4.9_Linux_x86_64.tar.gz.
At build time the tar step will fail with “cannot open: No such file or directory”, aborting the image build.

-RUN cd /tmp && wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.9/cronos_1.4.9-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.9_Linux_x86_64.tar.gz \
-    && rm cronos_1.4.9_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.9-testnet/cronos_1.4.9-testnet_Linux_x86_64.tar.gz \
+ && tar -xvf cronos_1.4.9-testnet_Linux_x86_64.tar.gz \
+ && rm cronos_1.4.9-testnet_Linux_x86_64.tar.gz \
+ && mv ./* /home/cronos/

(Notice I also fixed the release path to /v1.4.9-testnet/; the current one still points to /v1.4.9/.)

📝 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.9/cronos_1.4.9-testnet_Linux_x86_64.tar.gz && tar -xvf cronos_1.4.9_Linux_x86_64.tar.gz \
&& rm cronos_1.4.9_Linux_x86_64.tar.gz && mv ./* /home/cronos/
RUN chown -R cronos:cronos /home/cronos && chmod 1777 /tmp
RUN cd /tmp \
&& wget --no-check-certificate https://github.com/crypto-org-chain/cronos/releases/download/v1.4.9-testnet/cronos_1.4.9-testnet_Linux_x86_64.tar.gz \
&& tar -xvf cronos_1.4.9-testnet_Linux_x86_64.tar.gz \
&& rm cronos_1.4.9-testnet_Linux_x86_64.tar.gz \
&& mv ./* /home/cronos/
RUN chown -R cronos:cronos /home/cronos && chmod 1777 /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
In Dockerfile lines 7 to 9, the downloaded archive filename
cronos_1.4.9-testnet_Linux_x86_64.tar.gz does not match the filename used in the
tar and rm commands, causing build failure. Update the tar and rm commands to
reference cronos_1.4.9-testnet_Linux_x86_64.tar.gz instead of
cronos_1.4.9_Linux_x86_64.tar.gz. Also, ensure the download URL path matches the
testnet version /v1.4.9-testnet/ as corrected.


Expand Down