Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fabriziofiorucci/nap-compiler-rest-api
A REST API for NGINX App Protect WAF 5.0 Compiler
https://github.com/fabriziofiorucci/nap-compiler-rest-api
app-protection nginx rest-api
Last synced: 4 days ago
JSON representation
A REST API for NGINX App Protect WAF 5.0 Compiler
- Host: GitHub
- URL: https://github.com/fabriziofiorucci/nap-compiler-rest-api
- Owner: fabriziofiorucci
- Created: 2024-02-09T17:45:39.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-07-01T10:39:43.000Z (6 months ago)
- Last Synced: 2024-11-09T12:40:29.619Z (2 months ago)
- Topics: app-protection, nginx, rest-api
- Language: Python
- Homepage: https://docs.nginx.com/nginx-app-protect-waf/
- Size: 21.5 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# REST API for NGINX App Protect WAF Compiler
This repository provides a set of REST API to use the NGINX App Protect policy compiler within an automation pipeline.
The service can be run either on `docker-compose` or on `Kubernetes`.## Requirements
- NGINX App Protect WAF Compiler
- docker version v24+ to build the image
- One of:
- Docker-compose v2.20+
- Kubernetes cluster## REST API Endpoints
- `/v1/compile/policy` - compiles a JSON policy into a bundle
- Method: `POST`
- Payload: `{"global-settings": "", "policy": ""}`
- `/v1/compile/logprofile` - compiles a log profile JSON into a bundle
- Method: `POST`
- Payload: `{"logprofile": ""}`
- `/v1/bundle/info` - returns details on a compiled bundle
- Method: `POST`
- Payload: `{"bundle": ""}`Headers required for all endpoints:
```
Content-Type: application/json
```## Building the Docker image
The docker image can be built using:
```
docker build --no-cache -f Dockerfile \
--secret id=nginx-key,src= --secret id=nginx-crt,src= \
-t .
```Example:
```
docker build --no-cache -f Dockerfile \
--secret id=nginx-key,src=/etc/ssl/nginx/nginx-repo.key --secret id=nginx-crt,src=/etc/ssl/nginx/nginx-repo.crt \
-t nap-compiler:latest .
```Note: the docker image is automatically built by the `docker-compose.yaml` in the example
## How to run
This repository can be run on:
- [Docker compose](contrib/docker-compose)
- [Kubernetes](contrib/kubernetes)## How to test
- See the [examples](contrib/examples)
- Use the [Postman collection](contrib/postman)