Ghostwriter
Ghostwriter copied to clipboard
Nmap fix
Issue
https://github.com/GhostManager/Ghostwriter/issues/357
Description of the Change
This change adds the nmap binary to both local and production django containers.
Production django container is not running as root and cannot run an nmap scan with -sS:
-
libcaphas been added to the production docker container in order to set the nmap binary capabilities so as to not require root - An NMAP_PRIVILEGED environment variable has also been added to tell the nmap binary that it has the required capabilities already instead of checking for root
Alternate Designs
Running the container as root in production is a security risk. So this was not explored.
Nmap can be used without priviledges using the environment variable or using a --privileged option. Using the --privileged option would require this to be added to the rolodex tasks function instead.
Possible Drawbacks
Nmap is installed on the container potentially allowing anyone who has access to the container cli to run a SYN scan against the localhost or other servers not owned by the user
Verification Process
- Checked the Dockerfile setup the
queuecontainer as expected - correct binarys installed, cap's set correctly, env variable set - Run the nmap binary on the container using docker exec - nmap binary runs without error
- Spun up the production containers and added a task to scan servers - task completes without error
Release Notes
- Added nmap binary to local and production Dockerfile's
- Set capabilities on nmap binary so root priviledges are not required