Skip to content

Commit

Permalink
semgrep only allow hardcoded image name. We need to bypass it.
Browse files Browse the repository at this point in the history
  • Loading branch information
hdwhdw committed Nov 20, 2024
1 parent bda8ea4 commit 5e96619
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions host_modules/docker_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def _validate_command(command):
if not _validate_command(command):
return errno.EPERM, "Command {} is not allowed.".format(command)

# nosemgrep: python.docker.security.audit.docker-arbitrary-container-run.docker-arbitrary-container-run
container = client.containers.run(image, command, **kwargs)
return 0, "Container {} has been started.".format(container.name)
except docker.errors.ImageNotFound:
Expand Down

0 comments on commit 5e96619

Please sign in to comment.