Skip to content

Conversation

@almoggue
Copy link

No description provided.

Copy link

@jit-ci jit-ci bot left a comment

Choose a reason for hiding this comment

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

❌ Jit has detected 2 important findings in this PR that you should review.
The findings are detailed below as separate comments.
It’s highly recommended that you fix these security issues before merge.

Repository Risks:

  • Database Integration: Connects to a database, often involving sensitive data that must be securely managed.
  • Internally Accessible: Accessible only within the internal network, reducing exposure to external threats but still requiring proper controls.
  • High Severity Findings: Indicates that the resource has high severity security findings that need attention.

Repository Context:

graph LR
    GitHub$Repository_U23_RedisLabs/redis_U2D_webcli["GitHub Repository<br/>RedisLabs/redis-webcli"]:::GitHub$Repository
    Team_U23_dev_U2D_team["Team<br/>dev-team"]:::Team
    Team_U23_SecurityManagers["Team<br/>SecurityManagers"]:::Team
    Team_U23_PCF$Devs["Team<br/>PCF Devs"]:::Team
    Team_U23_k8s_U2D_operator_U2D_pr_U2D_reviewers["Team<br/>k8s-operator-pr-reviewers"]:::Team
    DBIntegration_U23_redis["DBIntegration<br/>redis"]:::DBIntegration
    Team_U23_dev_U2D_team -- "Owns" --> GitHub$Repository_U23_RedisLabs/redis_U2D_webcli
    Team_U23_SecurityManagers -- "Owns" --> GitHub$Repository_U23_RedisLabs/redis_U2D_webcli
    Team_U23_PCF$Devs -- "Owns" --> GitHub$Repository_U23_RedisLabs/redis_U2D_webcli
    Team_U23_k8s_U2D_operator_U2D_pr_U2D_reviewers -- "Owns" --> GitHub$Repository_U23_RedisLabs/redis_U2D_webcli
    GitHub$Repository_U23_RedisLabs/redis_U2D_webcli -- "Is accessible to" --> DBIntegration_U23_redis
Loading

@@ -1,13 +1,21 @@
FROM python:3.8
FROM python:3.11-bookworm
Copy link

Choose a reason for hiding this comment

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

Security control: Docker Scan

Image User Should Not Be 'Root'

Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile.

Severity: HIGH

Learn more about this issue


Fix suggestion:

This fix suggestion was generated by Jit. Please note that the suggestion might not always fit every use case. It is highly recommended that you check and review it before merging.

Suggestion guidelines

  • First of all, check if your container is running as a root user. In most of the cases, you can do it by running a command like this: docker run <image> whoami. If it returns root, then you should consider using a non-root user, by following one of the next steps:
    • If a non-root user already exists in your container, consider using it.
    • If not, you can create a new user by adding a USER command to the Dockerfile, with a non-root user as argument, for example: USER <non-root-user-name>.
Suggested change
FROM python:3.11-bookworm
FROM python:3.11-bookworm
RUN addgroup --system <group>
RUN adduser --system <user> --ingroup <group>
USER <user>:<group>

Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_ignore_type_in_file Ignore any finding of type "Image user should not be 'root'" in Dockerfile; future occurrences will also be ignored.
  • #jit_undo_ignore Undo ignore command

echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list && \
apt-get update && \
apt-get install -y memtier-benchmark && \
rm -rf /var/lib/apt/lists/*
Copy link

Choose a reason for hiding this comment

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

Security control: Docker Scan

'Apt-Get' Missing '--No-Install-Recommends'

'apt-get' install should use '--no-install-recommends' to minimize image size.

Severity: HIGH

Learn more about this issue


Jit Bot commands and options (e.g., ignore issue)

You can trigger Jit actions by commenting on this PR review:

  • #jit_ignore_fp Ignore and mark this specific single instance of finding as “False Positive”
  • #jit_ignore_accept Ignore and mark this specific single instance of finding as “Accept Risk”
  • #jit_ignore_type_in_file Ignore any finding of type "'apt-get' missing '--no-install-recommends'" in Dockerfile; future occurrences will also be ignored.
  • #jit_undo_ignore Undo ignore command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants