Skip to content

Commit

Permalink
feat: add trivial check to detect if current user has the permission …
Browse files Browse the repository at this point in the history
…to run docker
  • Loading branch information
thelicato committed Jan 12, 2024
1 parent 9cf02e2 commit 75f6c2b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docker_vuln_runner/vuln.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,21 @@ def vuln_init():


def check_docker():
# Check if the current user has the permissions to run docker
# Just run a 'ps' command and check if it throws
try:
docker_cli.ps()
except:
err("""
An error occurred while running docker
Check if the current user is in the 'docker' group
To add it run the following:
```
sudo usermod -aG docker $USER
```
""")
if not docker_cli.compose.is_installed():
err("""
Please install 'docker compose' (version 2)
Expand Down

0 comments on commit 75f6c2b

Please sign in to comment.