|
|
||
|---|---|---|
| .. | ||
| README-short.txt | ||
| README.md | ||
| content.md | ||
| github-repo | ||
| license.md | ||
| logo.svg | ||
| maintainer.md | ||
README.md
Quick reference
-
Maintained by:
The Wallarm Team -
Where to get help:
the Docker Community Forums, the Docker Community Slack, or Stack Overflow
Supported tags and respective Dockerfile links
Quick reference (cont.)
-
Where to file issues:
https://github.com/wallarm/api-firewall/issues -
Published image artifact details:
repo-info repo'srepos/api-firewall/directory (history)
(image metadata, transfer size, etc) -
Image updates:
official-images repo'slibrary/api-firewalllabel
official-images repo'slibrary/api-firewallfile (history) -
Source of this description:
docs repo'sapi-firewall/directory (history)
What is API Firewall?
Light-weighted Wallarm API Firewall protects your API endpoints in cloud-native environments with API schema validation. Wallarm API Firewall relies on a positive security model allowing calls that match a predefined API specification, while rejecting everything else.
API schema validation and positive security model
When starting API Firewall, you should provide the OpenAPI 3.0 specification of the application to be protected with API Firewall. The started API Firewall will operate as a reverse proxy and validate whether requests and responses match the schema defined in the specification.
The traffic that does not match the schema will be logged using the STDOUT and STDERR Docker services or blocked (depending on the configured API Firewall operation mode). If operating in the logging mode and detecting the traffic on endpoints that are not included in the specification, API Firewall also logs these endpoints as the shadow ones (except for endpoints returning the code 404).
Provided API schema should be described using the OpenAPI 3.0 specification in the YAML or JSON file (.yaml, .yml, .json file extensions).
By allowing you to set the traffic requirements with the OpenAPI 3.0 specification, Wallarm API Firewall relies on a positive security model.
Technical characteristics
API Firewall works as a reverse proxy with a built-in OpenAPI 3.0 request and response validator. The validator is written in Go and optimized for extreme performance and near-zero added latency.
How to use this image
Quick start with Docker
This quick start guide walks through downloading and starting Wallarm API Firewall with minimal configuration on Docker.
Requirements
- Installed and configured Docker
- OpenAPI 3.0 specification developed for the REST API of the application that should be protected with Wallarm API Firewall
Up and running
To run Wallarm API Firewall with minimal configuration on Docker:
-
Create the Docker network to connect your application and Wallarm API Firewall (e.g.
api-firewall-network):docker network create api-firewall-network -
Start the containerized application to be protected with API Firewall (e.g. kennethreitz/httpbin):
docker run --rm -it --network api-firewall-network \ --network-alias backend -p 8090:8090 kennethreitz/httpbin -
Start the API Firewall image:
docker run --rm -it --network api-firewall-network --network-alias api-firewall \ -v <HOST_PATH_TO_SPEC>:<CONTAINER_PATH_TO_SPEC> -e APIFW_API_SPECS=<PATH_TO_MOUNTED_SPEC> \ -e APIFW_URL=<API_FIREWALL_URL> -e APIFW_SERVER_URL=<PROTECTED_APP_URL> \ -e APIFW_REQUEST_VALIDATION=<REQUEST_VALIDATION_MODE> -e APIFW_RESPONSE_VALIDATION=<RESPONSE_VALIDATION_MODE> \ -p 8088:8088 api-firewall:v0.6.5Variables Description For the -voption<HOST_PATH_TO_SPEC>The path to the OpenAPI 3.0 specification for your application REST API located on the host machine. The accepted file formats are YAML and JSON ( .yaml,.yml,.jsonfile extensions). For example:/opt/my-api/openapi3/swagger.json.<CONTAINER_PATH_TO_SPEC>The path to the container directory to mount the OpenAPI 3.0 specification to. For example: /api-firewall/resources/swagger.json.For the -eoptionAPIFW_API_SPECSPath to the OpenAPI 3.0 specification mounted to the container. For example: /api-firewall/resources/swagger.json.APIFW_URLURL for API Firewall. For example: http://0.0.0.0:8088/. The port value should correspond to the container port published to the host.APIFW_SERVER_URLURL of the application described in the mounted OpenAPI specification that should be protected with API Firewall. For example: http://backend:80.APIFW_REQUEST_VALIDATIONAPI Firewall mode when validating requests sent to the application URL: BLOCKto block and log the requests that do not match the schema provided in the mounted OpenAPI 3.0 specification (the403 Forbiddenresponse will be returned to the blocked requests). Logs are sent to theSTDOUTandSTDERRDocker services.LOG_ONLYto log but not block the requests that do not match the schema provided in the mounted OpenAPI 3.0 specification. Logs are sent to theSTDOUTandSTDERRDocker services.DISABLEto disable request validation.
APIFW_RESPONSE_VALIDATIONAPI Firewall mode when validating application responses to incoming requests: BLOCKto block and log the request if the application response to this request does not match the schema provided in the mounted OpenAPI 3.0 specification. This request will be proxied to the application URL but the client will receive the403 Forbiddenresponse. Logs are sent to theSTDOUTandSTDERRDocker services.LOG_ONLYto log but not block the request if the application response to this request does not match the schema provided in the mounted OpenAPI 3.0 specification. Logs are sent to theSTDOUTandSTDERRDocker services.DISABLEto disable request validation.
-
Test API Firewall operation by sending the request that does not match the mounted Open API 3.0 specification to the API Firewall Docker container address. For example, you can pass the string value in the parameter that requires the integer value.
If the request does not match the provided API schema, the appropriate ERROR message will be added to the API Firewall Docker container logs.
You have successfully started Wallarm API Firewall with minimal configuration. To learn advanced configuration options, please use the separate instructions on running Wallarm API Firewall with Docker.
Demos
You can try API Firewall by running the demo environment that deploys an example application protected with Wallarm API Firewall. There are two available demo environments:
License
View license information for the software contained in this image.
As with all Docker images, these likely also contain other software which may be under other licenses (such as Bash, etc from the base distribution, along with any direct or indirect dependencies of the primary software being contained).
Some additional license information which was able to be auto-detected might be found in the repo-info repository's api-firewall/ directory.
As for any pre-built image usage, it is the image user's responsibility to ensure that any use of this image complies with any relevant licenses for all software contained within.