Single Packet Authorization with fwknop example environment in Docker-Compose.
$ git clone https://github.com/antonioalfa22/SPA-Example
$ cd SPA-Example
$ docker-compose up -d --build
First, generate the Base64 keys on the client:
$ docker exec -it spa-client /bin/bash
$ fwknop -A [SERVICES (tcp/80, tcp/22)] --use-hmac -R -D [SERVER_IP] --key-gen --save-rc-stanza --verbose
Then, copy the KEY_BASE64
and the HMAC_KEY_BASE64
to the server access.conf
file.
$ docker exec -it spa-server /bin/bash
$ fwknopd -f
First, replace the [Gateway IP]
on the /root/.fwknoprc
file with the gateway IP.
Then, run the following command to request access to the server:
$ docker exec -it spa-client /bin/bash
$ fwknop -n [SERVER_IP] --wget-cmd /usr/bin/wget -a [CLIENT_IP]