Nginx configuration static analyzer
Gixy is a tool to analyze Nginx configuration. The main goal of Gixy is to prevent security misconfiguration and automate flaw detection.
Currently supported Python versions are 2.7, 3.5, 3.6 and 3.7.
Disclaimer: Gixy is well tested only on GNU/Linux, other OSs may have some issues.
Right now Gixy can find:
You can find things that Gixy is learning to detect at Issues labeled with "new plugin"
Gixy is distributed on PyPI. The best way to install it is with pip:
pip install gixyRun Gixy and check results:
gixyBy default Gixy will try to analyze Nginx configuration placed in /etc/nginx/nginx.conf.
But you can always specify needed path:
…Or skip some tests:
$ gixy --skips http_splitting /etc/nginx/nginx.conf
==================== Results ===================
No issues found.
==================== Summary ===================
Total issues:
Unspecified: 0
Low: 0
Medium: 0
High: 0Or something else, you can find all other gixy arguments with the help command: gixy --help
Gixy is available as a Docker image from the Docker hub. To use it, mount the configuration that you want to analyse as a volume and provide the path to the configuration file when running the Gixy image.
$ docker run --rm -v `pwd`/nginx.conf:/etc/nginx/conf/nginx.conf yandex/gixy /etc/nginx/conf/nginx.confIf you have an image that already contains your nginx configuration, you can share the configuration with the Gixy container as a volume.
$ docker run --rm --name nginx -d -v /etc/nginx
nginx:alpinef68f2833e986ae69c0a5375f9980dc7a70684a6c233a9535c2a837189f14e905
$ docker run --rm --volumes-from nginx yandex/gixy /etc/nginx/nginx.conf
==================== Results ===================
No issues found.
==================== Summary ===================
Total issues:
Unspecified: 0
Low: 0
Medium: 0
High: 0
Contributions to Gixy are always welcome! You can help us in different ways:
Code guidelines:
PEP8 WIP
Fix exponential memory exhaustion in regex combination generator
[nginx_parser] WARNING Skip unparseable block: "map"
Feature Request: Checkstyle output
Detection of scenario when default is not specified for map directive
Detect exposing Nginx version
Detect incorrect ACL (allow without deny)
[Feature Request] detect `if-evil`
Crashes on config with lua options
[nginx_parser] WARNING Skip unparseable block: "server"