NGINX 配置分析工具
 
 
Go to file
anshil b3b10e8352
Merge 1f3c7b7ac5 into 6f68624a75
2025-02-21 00:24:19 -05:00
docs correct minor spelling mistake 2019-10-23 17:51:34 +03:00
gixy release 0.1.21 2024-01-06 14:35:36 +03:00
rpm Version bump to 0.1.5 2017-05-21 23:10:32 +03:00
tests removed useless import 2023-01-06 02:27:47 +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 fix(docs): corrects typo in CONTRIBUTING documentation 2023-01-06 02:27:02 +03:00
Dockerfile Updated Dockerfile for Python3 2020-01-09 11:18:46 +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 2025-02-21 00:24:05 -05:00
requirements.dev.txt Added tox to dev dependencies 2017-05-12 17:22:46 +03:00
requirements.txt Fix #125 - Don't install newer versions of pyparsing than v3 2024-01-06 14:24:39 +03:00
setup.py Fix #125 - Don't install newer versions of pyparsing than v3 2024-01-06 14:24:39 +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 for analyzing Nginx configurations, designed to help administrators, security engineers, and developers detect and mitigate security risks before they become critical vulnerabilities.

Its primary goal is to prevent security misconfigurations by identifying unsafe directives, improper access controls, and other configuration flaws that could expose systems to attacks. Gixy also automates flaw detection, allowing users to efficiently audit their Nginx configurations without manual inspection.Gixy helps strengthen the security posture of web applications and services that rely on Nginx. Whether used in CI/CD pipelines, manual audits, or automated security testing, Gixy provides a robust solution for securing Nginx environments.

Supported Python versions: 2.7, 3.5, 3.6 and 3.7

OS Compability: GNU/Linux, macOS, Windows

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

Functionality

Currently, Gixy can find: (Click on the links if you want more information on the topics)

🔧 Want to see whats coming next? Issues labeled with "new plugin"

Installation

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

python3 -m venv gixy_env
source gixy_env/bin/activate
pip install gixy

Run Gixy and check results:

gixy

To verify installation, run:

gixy --version

Usage

Basic Scan

By default Gixy will try to analyze Nginx configuration placed in /etc/nginx/nginx.conf. But you can always specify needed path:

Example Output:

$ 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.

Scan a Configuration File

$ 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.

Scan a Running Nginx Container

$  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.
  • Follow pre-use code sytle