NGINX 配置分析工具
 
 
Go to file
Danila Vershinin 84660a128f
Update README.md
Blindly using `pip` against system Python packages in RHEL based systems is a direct recipe to disaster.
Added notes about the existing prebuilt package.
2019-07-25 17:08:02 +03:00
docs Add hint toaliastraversal documentation 2019-07-08 22:28:35 +03:00
gixy Fixed invalid escape sequences 2018-11-22 10:15:29 +03:00
rpm Version bump to 0.1.5 2017-05-21 23:10:32 +03:00
tests Try to deal with non latin encoding 2018-09-28 11:00:13 +03:00
.dockerignore Added dockerignore 2017-05-13 13:23:49 +03:00
.editorconfig Added editorconfig 2017-05-13 13:39:21 +03:00
.gitignore Added RPM specs 2017-04-29 13:18:47 +04:00
.travis.yml Drop Python 2.6 Support 2019-07-10 00:10:42 +03:00
AUTHORS Initial commit 2017-03-31 01:12:44 +03:00
CONTRIBUTING.md Replace CONTRIBUTING.md 2017-04-18 16:17:02 +03:00
Dockerfile Rebase docker image on python:2.7-alpine 2017-05-13 13:02:19 +03:00
LICENSE Initial commit 2017-03-31 01:12:44 +03:00
MANIFEST.in Publish tests 2018-11-22 09:09:54 +03:00
Makefile Added makefile 2017-04-16 21:57:26 +03:00
README.RU.md Drop Python 2.6 Support 2019-07-10 00:10:42 +03:00
README.md Update README.md 2019-07-25 17:08:02 +03:00
requirements.dev.txt Added tox to dev dependencies 2017-05-12 17:22:46 +03:00
requirements.txt Resolve #12: renamed requirements*.pip to requirements*.txt 2017-04-28 17:55:01 +03:00
setup.py Don't require argparse for Python >= 3.2 2019-04-05 12:50:49 +03:00
tox.ini Added python 3.7 2018-09-28 11:01:34 +03:00

README.md

GIXY

Mozilla Public License 2.0 Build Status Your feedback is greatly appreciated GitHub issues GitHub pull requests

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 2.7, 3.5, 3.6 and 3.7.

Disclaimer: Gixy is well tested only on GNU/Linux, other OSs may have some issues.

What it can do

Right now Gixy can find:

You can find things that Gixy is learning to detect at Issues labeled with "new plugin"

Installation

RHEL/CentOS 7

yum install https://extras.getpagespeed.com/release-el7-latest.rpm
yum install gixy

Other systems

Gixy is distributed on PyPI. The best way to install it is with pip:

pip install gixy

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/yandex/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

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 yandex/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 yandex/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.