NGINX configuration [sec]analyzer
Project description
GIXY
Overview
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 3.6, 3.7, 3.8 and 3.9.
Disclaimer: Gixy is well tested only on GNU/Linux, other OSs may have some issues.
What it can do
Right now Gixy can find:
- [ssrf] Server Side Request Forgery
- [http_splitting] HTTP Splitting
- [origins] Problems with referrer/origin validation
- [add_header_redefinition] Redefining of response headers by "add_header" directive
- [host_spoofing] Request's Host header forgery
- [valid_referers] none in valid_referers
- [add_header_multiline] Multiline response headers
- [alias_traversal] Path traversal via misconfigured alias
- [if_is_evil] If is evil when used in location context
- [allow_without_deny] Allow specified without deny
- [add_header_content_type] Setting Content-Type via add_header
- [resolver_external] Using external DNS nameservers
You can find things that Gixy is learning to detect at Issues labeled with "new plugin"
Installation
CentOS/RHEL and other RPM-based systems
yum -y install https://extras.getpagespeed.com/release-latest.rpm
yum -y install gixy
Other systems
Gixy is distributed on PyPI. The best way to install it is with pip:
pip install gixy-ng
Run Gixy and check results:
gixy
Usage
By default, Gixy will try to analyze Nginx configuration placed in /etc/nginx/nginx.conf
.
But you can always specify needed path:
$ gixy /etc/nginx/nginx.conf
==================== Results ===================
Problem: [http_splitting] Possible HTTP-Splitting vulnerability.
Description: Using variables that can contain "\n" may lead to http injection.
Additional info: https://github.com/dvershinin/gixy/blob/master/docs/ru/plugins/httpsplitting.md
Reason: At least variable "$action" can contain "\n"
Pseudo config:
include /etc/nginx/sites/default.conf;
server {
location ~ /v1/((?<action>[^.]*)\.json)?$ {
add_header X-Action $action;
}
}
==================== Summary ===================
Total issues:
Unspecified: 0
Low: 0
Medium: 0
High: 1
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: 0
Or something else, you can find all other gixy
arguments with the help command: gixy --help
You can also make gixy
use pipes (stdin), like so:
echo "resolver 1.1.1.1;" | gixy -
Docker usage
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 getpagespeed/gixy /etc/nginx/conf/nginx.conf
If 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 dvershinin/gixy /etc/nginx/nginx.conf
==================== Results ===================
No issues found.
==================== Summary ===================
Total issues:
Unspecified: 0
Low: 0
Medium: 0
High: 0
Contributing
Contributions to Gixy are always welcome! You can help us in different ways:
- Open an issue with suggestions for improvements and errors you're facing;
- Fork this repository and submit a pull request;
- Improve the documentation.
Code guidelines:
- Python code style should follow pep8 standards whenever possible;
- Pull requests with new plugins must have unit tests for it.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file gixy-ng-0.1.23.tar.gz
.
File metadata
- Download URL: gixy-ng-0.1.23.tar.gz
- Upload date:
- Size: 63.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc1f4933702ad96d11b8cf5d15f961863b0f9a1b08db4c1347a17820eb4c10c2 |
|
MD5 | 25e45511c5f64aa4c7cc9b0734d1ee6b |
|
BLAKE2b-256 | fe3bfd212690abed0b76ff3976c6eeda518dafd9c253907a949da2ca0e8c3e06 |
File details
Details for the file gixy_ng-0.1.23-py3-none-any.whl
.
File metadata
- Download URL: gixy_ng-0.1.23-py3-none-any.whl
- Upload date:
- Size: 59.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.12.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d2ed20006ea0f2e682d8035e762774d4588d0f2b2bda414cbaf0e9a96a9ef0b |
|
MD5 | b6278bb9002517f36fc81abf06b1bc22 |
|
BLAKE2b-256 | 1bb9013dff0a4fc5ecb9f94bcff4dbc3567e2b5bfc9e5efce10cc5873557ab25 |