{"id":21044915,"url":"https://github.com/smart-it-kirkham/naxsi","last_synced_at":"2026-05-15T01:39:31.488Z","repository":{"id":148071989,"uuid":"341671592","full_name":"Smart-IT-Kirkham/naxsi","owner":"Smart-IT-Kirkham","description":"Nginx with NAXSI module","archived":false,"fork":false,"pushed_at":"2021-04-14T11:15:23.000Z","size":486,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-13T22:11:29.008Z","etag":null,"topics":["naxsi","nginx","nginx-docker","waf"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Smart-IT-Kirkham.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-23T19:49:17.000Z","updated_at":"2023-08-08T11:13:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"04ee14cb-4d73-4f91-b81d-bac7fbf97e2c","html_url":"https://github.com/Smart-IT-Kirkham/naxsi","commit_stats":null,"previous_names":["smart-it-kirkham/naxsi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Smart-IT-Kirkham/naxsi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smart-IT-Kirkham%2Fnaxsi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smart-IT-Kirkham%2Fnaxsi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smart-IT-Kirkham%2Fnaxsi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smart-IT-Kirkham%2Fnaxsi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Smart-IT-Kirkham","download_url":"https://codeload.github.com/Smart-IT-Kirkham/naxsi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Smart-IT-Kirkham%2Fnaxsi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266561336,"owners_count":23948627,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["naxsi","nginx","nginx-docker","waf"],"created_at":"2024-11-19T14:19:08.827Z","updated_at":"2025-10-04T05:29:27.739Z","avatar_url":"https://github.com/Smart-IT-Kirkham.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"![NAXSI Logo](.assets/naxsi_logo.png)\n\n# Nginx with NAXSI Module\n\nThis container set provides a custom built Nginx with NAXSI Web Application Firewall module.\n\nSee [https://github.com/nbs-system/naxsi](https://github.com/nbs-system/naxsi)\n\nOriginally I built this from the ground up using `alpine:3.11` I got it running, but then ran into a problem when I wanted to shrink the image using a multi-stage build approach. Using a single build stage I ended up with a docker image size of 406MB. After rethinking and rebuilding using `nginx:alpine` I was able to get a multi-stage build and the image size shrank to a more palatable 128MB.\n\nThe problem with using `nginx:alpine` is that it does not support python2. The NAXSI version available for download requires python2 to build.\n\nTo resolve the python version issue i had to download the 1.3 version of NAXSI from their repo and edit a few of the files to make them syntactically correct for python3. This wasn't too difficult. There were plenty of `print` statements to be changed to `print()` statements and one literal comparison of `is not` to change to `!=`. Whilst syntactically correct it now builds and works, but not being a python expert, or familiar with the NAXSI project coding, this may cause issues later.\n\n## Testing\n\nThe rules in the default.conf location:\n\n```nginx\n    SecRulesEnabled; # enable naxsi\n    # LearningMode; # enable learning mode\n    LibInjectionSql; # enable libinjection support for SQLI\n    LibInjectionXss; # enable libinjection support for XSS\n\n    DeniedUrl \"/denied.html\"; # the location where naxsi will redirect the request when it is blocked\n    CheckRule \"$SQL \u003e= 8\" BLOCK; # the action to take when the $SQL score is superior or equal to 8\n    CheckRule \"$RFI \u003e= 8\" BLOCK;\n    CheckRule \"$TRAVERSAL \u003e= 5\" BLOCK;\n    CheckRule \"$UPLOAD \u003e= 5\" BLOCK;\n    CheckRule \"$XSS \u003e= 8\" BLOCK;\n```\n\nWhen triggered will cause a redirect to `/denied.html`.\n\nTo trigger it to prove this you can use an SQL injection attack in your URL, eg.\n\n[http://localhost:8080/index.html?table=--delete%20from%20table%20where%201=1;](http://localhost:8080/index.html?table=--delete%20from%20table%20where%201=1;)\n\n## Usage\n\nReplace the `default.conf` file by mounting your own on top of it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmart-it-kirkham%2Fnaxsi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmart-it-kirkham%2Fnaxsi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmart-it-kirkham%2Fnaxsi/lists"}