You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
52
+
Wallarm API Firewall is an open-source light-weighted proxy designed to protect REST API endpoints in cloud-native environments by hardening based on a strict OpenAPI/Swagger schema validation. Wallarm API Firewall relies on a positive security model allowing calls that match a predefined API specification for requests and responses, while rejecting everything else.
53
53
54
-
## API schema validation and positive security model
54
+
The **key features** of API Firewall are:
55
55
56
-
When starting API Firewall, you should provide the [OpenAPI 3.0 specification](https://swagger.io/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.
57
-
58
-
The traffic that does not match the schema will be logged using the [`STDOUT` and `STDERR` Docker services](https://docs.docker.com/config/containers/logging/) 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`).
59
-
60
-
Provided API schema should be described using the [OpenAPI 3.0 specification](https://swagger.io/specification/) in the YAML or JSON file (`.yaml`, `.yml`, `.json` file extensions).
61
-
62
-
By allowing you to set the traffic requirements with the OpenAPI 3.0 specification, Wallarm API Firewall relies on a positive security model.
63
-
64
-
## Technical characteristics
65
-
66
-
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.
67
-
68
-
# How to use this image
56
+
- Protect REST API endpoints by blocking requests and responses that do not match the OAS/Swagger schema
57
+
- Discover Shadow API endpoints
58
+
- If using OAuth 2.0 protocol-based authentication, validate access tokens
59
+
- Quick and easy deployment and configuration
60
+
- Customization of request and response processing modes, response codes and log format
69
61
70
-
## Quick start with Docker
62
+
#Use cases
71
63
72
-
This quick start guide walks through downloading and starting Wallarm API Firewall with minimal configuration on Docker.
64
+
- Block abnormal requests and responses that do not match the OpenAPI 3.0 specification (if running API Firewall in the blocking mode)
65
+
- Discover Shadow APIs and undocumented endpoints (if running API Firewall in the logging mode)
66
+
- Log abnormal requests and responses that do not match the OpenAPI 3.0 specification (if running API Firewall in the logging mode)
73
67
74
-
### Requirements
68
+
#API schema validation and positive security model
75
69
76
-
-[Installed and configured Docker](https://docs.docker.com/get-docker/)
77
-
-[OpenAPI 3.0 specification](https://swagger.io/specification/) developed for the REST API of the application that should be protected with Wallarm API Firewall
78
-
79
-
### Up and running
80
-
81
-
To run Wallarm API Firewall with minimal configuration on Docker:
82
-
83
-
1. Create the Docker network to connect your application and Wallarm API Firewall (e.g. `api-firewall-network`):
84
-
85
-
```bash
86
-
docker network create api-firewall-network
87
-
```
70
+
When starting API Firewall, you should provide the [OpenAPI 3.0 specification](https://swagger.io/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.
88
71
89
-
2. Start the containerized application to be protected with API Firewall (e.g. [kennethreitz/httpbin](https://hub.docker.com/r/kennethreitz/httpbin/)):
72
+
The traffic that does not match the schema will be logged using the [`STDOUT` and `STDERR` Docker services](https://docs.docker.com/config/containers/logging/) 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`).
90
73
91
-
```bash
92
-
docker run --rm -it --network api-firewall-network \
Provided API schema should be described using the [OpenAPI 3.0 specification](https://swagger.io/specification/) in the YAML or JSON file (`.yaml`, `.yml`, `.json` file extensions).
97
77
98
-
```bash
99
-
docker run --rm -it --network api-firewall-network --network-alias api-firewall \
| `<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`, `.json` file extensions). For example: `/opt/my-api/openapi3/swagger.json`. |
110
-
| `<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`. |
111
-
| **For the `-e` option** | |
112
-
| `APIFW_API_SPECS` | Path to the OpenAPI 3.0 specification mounted to the container. For example: `/api-firewall/resources/swagger.json`. |
113
-
| `APIFW_URL` | URL for API Firewall. For example: `http://0.0.0.0:8088/`. The port value should correspond to the container port published to the host. |
114
-
| `APIFW_SERVER_URL` | URL of the application described in the mounted OpenAPI specification that should be protected with API Firewall. For example: `http://backend:80`. |
115
-
| `APIFW_REQUEST_VALIDATION` | API Firewall mode when validating requests sent to the application URL:<ul><li>`BLOCK` to block and log the requests that do not match the schema provided in the mounted OpenAPI 3.0 specification (the `403 Forbidden` response will be returned to the blocked requests). Logs are sent to the [`STDOUT` and `STDERR` Docker services](https://docs.docker.com/config/containers/logging/).</li><li>`LOG_ONLY` to log but not block the requests that do not match the schema provided in the mounted OpenAPI 3.0 specification. Logs are sent to the [`STDOUT` and `STDERR` Docker services](https://docs.docker.com/config/containers/logging/).</li><li>`DISABLE` to disable request validation.</li></ul> |
116
-
| `APIFW_RESPONSE_VALIDATION` | API Firewall mode when validating application responses to incoming requests:<ul><li>`BLOCK` to 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 the `403 Forbidden` response. Logs are sent to the [`STDOUT` and `STDERR` Docker services](https://docs.docker.com/config/containers/logging/).</li><li>`LOG_ONLY` to 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 the [`STDOUT` and `STDERR` Docker services](https://docs.docker.com/config/containers/logging/).</li><li>`DISABLE` to disable request validation.</li></ul> |
80
+
# Technical characteristics
117
81
118
-
4. 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.
82
+
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.
119
83
120
-
If the request does not match the provided API schema, the appropriate ERROR message will be added to the API Firewall Docker container logs.
84
+
# Starting API Firewall
121
85
122
-
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](https://docs.wallarm.com/api-firewall/installation-guides/docker-container/).
86
+
To download, install, and start Wallarm API Firewall on Docker, see the [instructions](https://docs.wallarm.com/api-firewall/installation-guides/docker-container/).
123
87
124
-
##Demos
88
+
# Demos
125
89
126
90
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:
127
91
128
92
-[Wallarm API Firewall demo with Docker Compose](https://github.com/wallarm/api-firewall/tree/main/demo/docker-compose)
129
93
-[Wallarm API Firewall demo with Kubernetes](https://github.com/wallarm/api-firewall/tree/main/demo/kubernetes)
130
94
95
+
# Wallarm's blog articles related to API Firewall
96
+
97
+
-[Discovering Shadow APIs with API Firewall](https://lab.wallarm.com/discovering-shadow-apis-with-a-api-firewall/)
98
+
-[Wallarm API Firewall outperforms NGINX in a production environment](https://lab.wallarm.com/wallarm-api-firewall-outperforms-nginx-in-a-production-environment/)
99
+
100
+
# Performance
101
+
102
+
When creating API Firewall, we prioritized speed and efficiency to ensure that our customers would have the fastest APIs possible. Our latest tests demonstrate that the average time required for API Firewall to process one request is 1.339 ms:
Time per request: 0.077 [ms] (mean, across all concurrent requests)
120
+
Transfer rate: 2730.71 [Kbytes/sec] received
121
+
360415.95 kb/s sent
122
+
363146.67 kb/s total
123
+
124
+
Connection Times (ms)
125
+
min mean[+/-sd] median max
126
+
Connect: 0 5 1.6 5 12
127
+
Processing: 2 10 5.4 9 59
128
+
Waiting: 2 8 5.2 7 56
129
+
Total: 3 15 5.7 14 68
130
+
131
+
Percentage of the requests served within a certain time (ms)
132
+
50% 14
133
+
66% 15
134
+
75% 16
135
+
80% 17
136
+
90% 18
137
+
95% 23
138
+
98% 36
139
+
99% 44
140
+
100% 68 (longest request)
141
+
```
142
+
143
+
These performance results are not the only ones we have got during API Firewall testing. Other results along with the methods used to improve API Firewall performance are described in this [Wallarm's blog article](https://lab.wallarm.com/wallarm-api-firewall-outperforms-nginx-in-a-production-environment/).
144
+
131
145
# License
132
146
133
147
View [license information](https://www.mozilla.org/en-US/MPL/2.0/) for the software contained in this image.
0 commit comments