
Gixy-Next: NGINX कॉन्फ़िगरेशन सुरक्षा स्कैनर और प्रदर्शन जाँचकर्ता
# Gixy-Next: सुरक्षा ऑडिट के लिए NGINX कॉन्फ़िगरेशन सुरक्षा स्कैनर
## अवलोकन
<a href="https://gixy.io/"><img width="192" height="192" alt="Gixy-Next Mascot Logo" style="float: right;" align="right" src="https://assets.kitploit.com/production/public/readmes/10695/943d5c952685014f6540ef9cb02fe9d8cd895479a41a8f78786b5f2997207ec0.jpg" /></a>
Gixy-Next (Gixy) एक ओपन-सोर्स NGINX कॉन्फ़िगरेशन सुरक्षा स्कैनर और हार्डनिंग टूल है जो उत्पादन तक पहुँचने से पहले सुरक्षा गलत कॉन्फ़िगरेशन, हार्डनिंग कमियों और सामान्य प्रदर्शन संबंधी समस्याओं का पता लगाने के लिए आपकी nginx.conf का स्थिर विश्लेषण करता है। यह Yandex के [Gixy](https://github.com/yandex/gixy) का सक्रिय रूप से अनुरक्षित फ़ोर्क है। Gixy-Next का सोर्स कोड [GitHub पर उपलब्ध है](https://github.com/megamansec/gixy-next)।
Gixy-Next को [इस पृष्ठ](https://gixy.io/scanner/) पर ब्राउज़र में भी चलाया जा सकता है। किसी डाउनलोड की आवश्यकता नहीं है; आप वेबसाइट पर अपने कॉन्फ़िगरेशन स्कैन कर सकते हैं (स्थानीय रूप से, WebAssembly का उपयोग करके)।
### त्वरित शुरुआत
Gixy-Next (`gixy` या `gixy-next` CLI) [PyPI](https://pypi.python.org/pypi/Gixy-Next) पर वितरित किया जाता है। आप इसे pip या uv के साथ इंस्टॉल कर सकते हैं:
```shell-session
# pip
pip3 install gixy-next
# uv
uv pip install gixy-next
```
आप इसे तब चला सकते हैं:
```shell-session
# gixy defaults to reading /etc/nginx/nginx.conf
gixy
# But you can also specify a path to the configuration
gixy /opt/nginx.conf
```
आप अपने NGINX कॉन्फ़िगरेशन को एकल डंप फ़ाइल में भी निर्यात कर सकते हैं (देखें [nginx -T Live Configuration Dump](https://gixy.io/nginx-config-dump)):
```shell-session
# Dumps the full NGINX configuration into a single file (including all includes)
nginx -T > ./nginx-dump.conf
# Scan the dump elsewhere (or via stdin):
gixy ./nginx-dump.conf
# or
cat ./nginx-dump.conf | gixy -
```
### वेब-आधारित स्कैनर
Gixy-Next को स्थानीय रूप से डाउनलोड और चलाने के बजाय, आप [इस वेबपेज](https://gixy.io/scanner/) का उपयोग कर सकते हैं और अपने वेब ब्राउज़र से (स्थानीय रूप से, WebAssembly का उपयोग करके) किसी कॉन्फ़िगरेशन को स्कैन कर सकते हैं।
### Docker के साथ स्कैन करें
Gixy-Next [Docker Hub](https://hub.docker.com/r/megamansec/gixy-next/) या [GitHub Registry](https://github.com/MegaManSec/Gixy-Next/pkgs/container/gixy-next) से एक Docker इमेज के रूप में उपलब्ध है।
किसी स्थानीय कॉन्फ़िग फ़ाइल को कंटेनर में माउंट करके स्कैन करें:
```shell-session
# Use Github Registry
docker run --pull=always --rm -v "$PWD/nginx.conf:/nginx.conf:ro" ghcr.io/megamansec/gixy-next /nginx.conf
# Or Docker Hub
docker run --pull=always --rm -v "$PWD/nginx.conf:/nginx.conf:ro" megamansec/gixy-next /nginx.conf
```
NGINX लाइव कॉन्फ़िगरेशन डंप स्कैन करें:
```shell-session
# Dumps the full NGINX configuration into a single file (including all includes)
nginx -T > ./nginx-dump.conf
# Use Github Registry
docker run --pull=always --rm -v "$PWD/nginx-dump.conf:/nginx-dump.conf:ro" ghcr.io/megamansec/gixy-next /nginx-dump.conf
# Or Docker Hub
docker run --pull=always --rm -v "$PWD/nginx-dump.conf:/nginx-dump.conf:ro" megamansec/gixy-next /nginx-dump.conf
```
stdin से स्कैन करें:
```shell-session
# Use Github Registry
nginx -T | docker run --pull=always --rm -i ghcr.io/megamansec/gixy-next gixy-next -
# Or Docker Hub
nginx -T | docker run --pull=always --rm -i megamansec/gixy-next gixy-next -
```
## यह क्या कर सकता है
Gixy-Next `nginx.conf` और शामिल कॉन्फ़िगरेशन फ़ाइलों में NGINX सुरक्षा और प्रदर्शन संबंधी कई प्रकार की गलत कॉन्फ़िगरेशन का पता लगा सकता है। निम्नलिखित प्लगइन समर्थित हैं:
- [[add_header_content_type] add_header के माध्यम से Content-Type सेट करना](https://gixy.io/plugins/add_header_content_type/)
- [[add_header_multiline] बहु-पंक्ति प्रतिक्रिया हेडर](https://gixy.io/plugins/add_header_multiline/)
- [[add_header_redefinition] "add_header" निर्देश द्वारा प्रतिक्रिया हेडर का पुनर्परिभाषण](https://gixy.io/plugins/add_header_redefinition/)
- [[alias_traversal] गलत कॉन्फ़िगर किए गए alias के माध्यम से पथ ट्रैवर्सल](https://gixy.io/plugins/alias_traversal/)
- [[allow_without_deny] deny के बिना allow निर्दिष्ट](https://gixy.io/plugins/allow_without_deny/)
- [[default_server_flag] default_server फ़्लैग अनुपस्थित](https://gixy.io/plugins/default_server_flag/)
- [[error_log_off] `error_log` को `off` पर सेट किया गया](https://gixy.io/plugins/error_log_off/)
- [[filesystem_root_exposure] फ़ाइलसिस्टम रूट को डॉक्यूमेंट रूट के रूप में उपयोग](https://gixy.io/plugins/filesystem_root_exposure/)
- [[hash_without_default] hash ब्लॉक में default अनुपस्थित](https://gixy.io/plugins/hash_without_default/)
- [[host_spoofing] अनुरोध के Host हेडर का जालसाज़ी](https://gixy.io/plugins/host_spoofing/)
- [[http2_misdirected_request] HTTP/2 misdirected-request सुरक्षा उपाय अनुपस्थित](https://gixy.io/plugins/http2_misdirected_request/)
- [[http_splitting] HTTP प्रतिक्रिया विभाजन (Response Splitting)](https://gixy.io/plugins/http_splitting/)
- [[if_is_evil] location संदर्भ में उपयोग किए जाने पर if घातक है](https://gixy.io/plugins/if_is_evil/)
- [[invalid_regex] अमान्य regex कैप्चर समूह](https://gixy.io/plugins/invalid_regex/)
- [[low_keepalive_requests] कम `keepalive_requests`](https://gixy.io/plugins/low_keepalive_requests/)
- [[missing_worker_processes] `worker_processes` अनुपस्थित](https://gixy.io/plugins/missing_worker_processes/)
- [[mixed_case_variable] मिश्रित-केस चर संदर्भ](https://gixy.io/plugins/mixed_case_variable/)
- [[origins] referer/origin हेडर सत्यापन में समस्याएँ](https://gixy.io/plugins/origins/)
- [[overlapping_captures] rewrite redirect/args संदर्भ में अतिव्यापी कैप्चर](https://gixy.io/plugins/overlapping_captures/)
- [[proxy_buffering_off] `proxy_buffering` अक्षम करना](https://gixy.io/plugins/proxy_buffering_off/)
- [[proxy_pass_normalized] `proxy_pass` अपस्ट्रीम को अनपेक्षित पथ भेज सकता है](https://gixy.io/plugins/proxy_pass_normalized/)
- [[proxy_set_header_redefinition] "proxy_set_header" निर्देश द्वारा प्रॉक्सी किए गए अनुरोध हेडर का पुनर्परिभाषण](https://gixy.io/plugins/proxy_set_header_redefinition/)
- [[quic_bpf_reuseport] पुनः लोड के बाद QUIC कनेक्शन चुपचाप गिरा दिए जाते हैं](https://gixy.io/plugins/quic_bpf_reuseport/)
- [[regex_redos] रेगुलर एक्सप्रेशन डिनायल ऑफ़ सर्विस (ReDoS)](https://gixy.io/plugins/regex_redos/)
- [[resolver_external] बाहरी DNS नेमसर्वर का उपयोग](https://gixy.io/plugins/resolver_external/)
- [[return_bypasses_allow_deny] return निर्देश allow/deny प्रतिबंधों को बायपास करता है](https://gixy.io/plugins/return_bypasses_allow_deny/)
- [[ssl_ecdh_curve] पोस्ट-क्वांटम समूह पुराने OpenSSL पर NGINX को शुरू होने से रोकते हैं](https://gixy.io/plugins/ssl_ecdh_curve/)
- [[ssl_stapling_letsencrypt] Let's Encrypt प्रमाणपत्र के लिए OCSP stapling कुछ नहीं करता](https://gixy.io/plugins/ssl_stapling_letsencrypt/)
- [[ssl_stapling_without_resolver] resolver के बिना OCSP stapling चुपचाप विफल हो जाता है](https://gixy.io/plugins/ssl_stapling_without_resolver/)
- [[ssrf] सर्वर साइड रिक्वेस्ट फ़ोर्जरी](https://gixy.io/plugins/ssrf/)
- [[stale_dns_cache] proxy_pass में पुराने/बासी कैश्ड DNS रिकॉर्ड का उपयोग](https://gixy.io/plugins/stale_dns_cache/)
- [[status_page_exposed] सुनिश्चित करता है कि status_page दुनिया के सामने उजागर न हो](https://gixy.io/plugins/status_page_exposed/)
- [[try_files_is_evil_too] open_file_cache के बिना `try_files` निर्देश घातक है](https://gixy.io/plugins/try_files_is_evil_too/)
- [[unanchored_regex] अन-एंकर्ड रेगुलर एक्सप्रेशन](https://gixy.io/plugins/unanchored_regex/)
- [[unnamed_groups] rewrite क्वेरी स्ट्रिंग में अनाम कैप्चर समूह](https://gixy.io/plugins/unnamed_groups/)
- [[valid_referers] valid_referers में none/blocked](https://gixy.io/plugins/valid_referers/)
- [[version_disclosure] server_tokens के लिए असुरक्षित मानों का उपयोग](https://gixy.io/plugins/version_disclosure/)
- [[worker_rlimit_nofile_vs_connections] `worker_rlimit_nofile` कम से कम `worker_connections` का दोगुना होना चाहिए](https://gixy.io/plugins/worker_rlimit_nofile_vs_connections/)
कुछ पता नहीं चला? कृपया GitHub पर एक [issue](https://github.com/MegaManSec/Gixy-Next/issues) खोलें और बताएं कि क्या गायब है!
## उपयोग (फ़्लैग्स)
`gixy` डिफ़ॉल्ट रूप से सिस्टम की NGINX कॉन्फ़िगरेशन को `/etc/nginx/nginx.conf` से पढ़ता है। आप `gixy` को पास करके स्थान भी निर्दिष्ट कर सकते हैं:
```shell-session
# Analyze the configuration in /opt/nginx.conf
gixy /opt/nginx.conf
```
आप `--tests` के साथ जाँचों का एक केंद्रित उपसमुच्चय चला सकते हैं:
```shell-session
# Only run these checks
gixy --tests http_splitting,ssrf,version_disclosure
```
या `--skips` के साथ कुछ शोरगुल वाले जाँचों को छोड़ दें:
```shell-session
# Run everything except these checks
gixy --skips low_keepalive_requests,worker_rlimit_nofile_vs_connections
```
केवल एक निश्चित गंभीरता या उससे अधिक के मुद्दों की रिपोर्ट करने के लिए, संयोजक `-l` फ़्लैग का उपयोग करें:
```shell-session
# -l for LOW severity issues and higher, -ll for MEDIUM and higher, and -lll for only HIGH severity issues
gixy -ll
```
डिफ़ॉल्ट रूप से, `gixy` का आउटपुट ANSI-रंगीन होता है; इसे संगत टर्मिनल में सबसे अच्छी तरह देखा जा सकता है। बिना रंग वाला आउटपुट प्राप्त करने के लिए आप `--format` (`-f`) फ़्लैग का उपयोग `text` मान के साथ कर सकते हैं:
```shell-session
$ gixy -f text
==================== Results ===================
Problem: [http_splitting] Possible HTTP-Splitting vulnerability.
Description: Using variables that can contain "\n" may lead to http injection.
Additional info: https://gixy.io/plugins/http_splitting/
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:
Informational: 0
Low: 0
Medium: 0
High: 1
```
आप पुनरुत्पादनीय, मशीन-पठनीय JSON आउटपुट प्राप्त करने के लिए `-f json` का भी उपयोग कर सकते हैं:
```shell-session
$ gixy -f json
[{"config":"\nserver {\n\n\tlocation ~ /v1/((?<action>[^.]*)\\.json)?$ {\n\t\tadd_header X-Action $action;\n\t}\n}","description":"Using variables that can contain \"\\n\" or \"\\r\" may lead to http injection.","file":"/etc/nginx/nginx.conf","line":4,"path":"/etc/nginx/nginx.conf","plugin":"http_splitting","reason":"At least variable \"$action\" can contain \"\\n\"","reference":"https://gixy.io/plugins/http_splitting/","severity":"HIGH","summary":"Possible HTTP-Splitting vulnerability."}]
```
आप [SARIF 2.1.0](https://sarifweb.azurewebsites.net/) लॉग प्राप्त करने के लिए `-f sarif` का भी उपयोग कर सकते हैं, उदाहरण के लिए GitHub कोड स्कैनिंग पर अपलोड करने के लिए:
```shell-session
# Write a SARIF report to a file, e.g. for `github/codeql-action/upload-sarif`
gixy -f sarif -o gixy-results.sarif
```
`gixy` का उपयोग करने के बारे में अधिक फ़्लैग `--help` पास करके पाए जा सकते हैं। आप [Usage Guide](https://gixy.io/usage/) में अधिक जानकारी भी पा सकते हैं।
## कॉन्फ़िगरेशन और प्लगइन विकल्प
कुछ प्लगइन ऐसे विकल्प प्रदान करते हैं जिन्हें आप CLI फ़्लैग या कॉन्फ़िगरेशन फ़ाइल के माध्यम से सेट कर सकते हैं। आप इनके बारे में अधिक [Configuration guide](https://gixy.io/configuration/) में पढ़ सकते हैं।
## NGINX सुरक्षा और अनुपालन के लिए Gixy-Next
`nginx -t` चलाने के विपरीत, जो केवल सिंटैक्स की जाँच करता है, Gixy-Next वास्तव में आपके कॉन्फ़िगरेशन का विश्लेषण करता है और असुरक्षित (unhardened) इंस्टेंस और कमज़ोरियों का पता लगाता है।
Gixy-Next के साथ, आप एक स्वचालित NGINX कॉन्फ़िगरेशन सुरक्षा समीक्षा कर सकते हैं जिसे हर बदलाव पर स्थानीय रूप से चलाया जा सकता है, चाहे वह ऑडिटिंग, अनुपालन, या सामान्य परीक्षण के लिए हो, जिससे कार्रवाई योग्य निष्कर्ष निकालने में मदद मिलती है जो अस्थिर/धीमे NGINX सर्वर को रोकने में सहायता करते हैं, और असुरक्षित निर्देशों और असुरक्षित डिफ़ॉल्ट से जोखिम को कम करते हैं।
## योगदान
Gixy-Next का रखरखाव [Joshua Rogers](https://joshua.hu) द्वारा किया जाता है, लेकिन योगदान का सदैव स्वागत है! आप विभिन्न तरीकों से हमारी सहायता कर सकते हैं, जैसे:
- बग की रिपोर्ट करना।
- पहचान के लिए नए प्लगइन सुझाना।
- दस्तावेज़ीकरण में सुधार करना।
- कोड को ठीक करना, रिफ़ैक्टर करना, सुधारना और नया कोड लिखना।
पुल रिक्वेस्ट में कोई भी बदलाव सबमिट करने से पहले, कृपया योगदान दिशानिर्देश दस्तावेज़, [Contributing to Gixy-Next](https://gixy.io/contributing/) पढ़ें।
Gixy-Next का आधिकारिक होमपेज [https://gixy.io/](https://gixy.io/) है। Gixy-Next में दस्तावेज़ीकरण के किसी भी बदलाव को स्वचालित रूप से उस वेबसाइट पर दर्शाया जाएगा।
स्रोत कोड [https://github.com/MegaManSec/Gixy-Next](https://github.com/MegaManSec/Gixy-Next) पर पाया जा सकता है।
## Gixy क्या है? (पृष्ठभूमि)
_Gixy_ एक NGINX कॉन्फ़िगरेशन विश्लेषक है जिसे [मूल रूप से](https://github.com/yandex/gixy) Yandex के Andrew Krasichkov द्वारा विकसित किया गया था। इसे पहली बार 2017 में जारी किया गया था और तब से यह असुरक्षित (unmaintained) हो गया है। यह Python के आधुनिक संस्करणों का समर्थन नहीं करता, इसमें कई बग हैं, और यह अपनी कार्यक्षमता तथा कमज़ोर NGINX कॉन्फ़िगरेशन का पता लगाने की क्षमता में सीमित है। आज किसी आधुनिक सिस्टम पर मूल Gixy चलाने पर निम्नलिखित त्रुटि उत्पन्न होगी:
```text
File "gixy/core/sre_parse/sre_parse.py", line 61, in <module>
"t": SRE_FLAG_TEMPLATE,
^^^^^^^^^^^^^^^^^
NameError: name 'SRE_FLAG_TEMPLATE' is not defined. Did you mean: 'SRE_FLAG_VERBOSE'?
```
Gixy-Next, इसलिए, एक फ़ोर्क है जो आधुनिक सिस्टम के लिए समर्थन जोड़ता है, नई जाँचें, प्रदर्शन सुधार, हार्डनिंग सुझाव, और आधुनिक Python और NGINX संस्करणों के लिए समर्थन जोड़ता है।
### `gixy-ng` क्यों नहीं?
Gixy-Next वास्तव में `gixy-ng` का एक फ़ोर्क है, जो स्वयं मूल `gixy` का एक फ़ोर्क था। Gixy-Next तब बनाया गया था जब `gixy-ng` के अनुरक्षक ने बड़ी मात्रा में AI-सहायित परिवर्तन और स्वतः-उत्पन्न कोड का उत्पादन शुरू किया जो समीक्षा-अयोग्य रूप से बड़ा होने के साथ-साथ टूटा हुआ भी था।
कुछ समय बाद, `gixy-ng` के अनुरक्षक ने कोडबेस में AI-उत्पन्न परिवर्तन कमिट करने शुरू किए जिन्होंने स्पष्ट रिग्रेशन पेश किए, टूल के महत्वपूर्ण व्यवहार को तोड़ दिया (जिसे टूल का उपयोग करने वाला कोई भी व्यक्ति पकड़ लेता), यादृच्छिक AI-टूलिंग कलाकृतियाँ जोड़ीं, और ऐसा कोड पेश किया जो बस वह नहीं करता था जो उसे करना चाहिए था। सबसे महत्वपूर्ण बात, अनुरक्षक ने `gixy-ng` के **सभी दस्तावेज़ीकरण, सभी आउटपुट, और सभी स्रोत कोड** में **अपने व्यवसाय के लिए मार्केटिंग भी जोड़ दी**।
दूसरे शब्दों में, `gixy-ng` के अनुरक्षक ने मूल `gixy` लिया, AI से परिवर्तन करने को कहा, ढेर सारे बग (और अन्य AI बकवास) पेश किए, और फिर कोड में विज्ञापन जोड़ दिए। उन्होंने मर्ज अनुरोधों के रूप में योगदान भी स्वीकार किए, लेकिन लेखक की जानकारी हटा दी (देखें [यह](https://joshua.hu/gixy-ng-new-version-gixy-updated-checks#quality-degradation) पोस्ट और [यह](https://joshua.hu/gixy-ng-ai-slop-gixy-next-maintained) पोस्ट)।
Gixy-Next गुणवत्ता बहाल करने पर केंद्रित है, और इसे लगभग 100,000-पंक्तियों-लंबे NGINX कॉन्फ़िगरेशन पर युद्ध-परीक्षित किया गया है। यह `gixy-ng` में पेश किए गए परिवर्तनों द्वारा शुरू किए गए बग और गलत-पहचान को ठीक करता है, AI टूल कलाकृतियों/कचरे को हटाता है, और कोडबेस को समीक्षा-योग्य और अनुरक्षणीय रखने का प्रयास करता है। यह फ़ोर्क उन लोगों के लिए है जो स्वच्छ कोड और दीर्घकालिक अनुरक्षणीयता में रुचि रखते हैं।