Giter Club home page Giter Club logo

wifi_eap-tls's Introduction

Secure Wifi: WPA3 & WPA2 Enterprise with EAP-TLS

Wifi is nearly everywhere and adequate security is important. User friendly and secure alternative to the password based solution is WPA3 & WPA2 Enterprise (further: WPA2 Enterprise). One of the options within WPA2 Enterprise is EAP-TLS. This authentication protocol uses X.509 certificates to make sure that a user connects to an authentic Wifi network. The client side certificate guarantees to the Wifi network the authenticity of the client. This repository gives some scripts to create and manage some of the key components for an EAP-TLS setup: a RADIUS server and a Public Key Infrastructure (PKI) for managing a Certificate Authority (CA) and managing X.509 certificates. For the RADIUS server the FreeRadius opensource project is used. The complexity of configuring FreeRadius is taken away by using a few wrapper scripts. The RADIUS server is run using Docker and docker-compose.

A complete setup consists of the following elements:

  • a Wifi client, e.g. a Windows 11 laptop connecting to a Wifi network
  • a Wifi access point supporting RADIUS authentication. The setup presented was tested with Ubiquity UniFi access points and UniFi Network Controller software (no relationship whatsoever between this project and Ubiquiti).
  • a RADIUS server and PKI (this project) running on a Docker server with docker-compose. Regular WPA3 Enterprise is tested (and used) succesfully. Necessary changes to use the 192-bit security mode offered by WPA3 Enterprise still have to be determined. Input on this subject is welcomed.

Getting started

  • Start with a functioning Wifi network using WPA2 preshared key
  • Clone this repository to a Docker server with docker-compose installed
  • Execute the following commands as root (or use sudo) in the main directory of this repository.
  • Run ./scripts/init.sh to create some directories and create the .env file.
  • Edit the .env file in the main directory. Necessary adjustments are documented in the comments in this file.
  • Do a docker-compose build followed by a docker-compose up (this can take some time).
  • Wait until the initialization is finished. End with Ctrl+c and restart with docker-compose up -d
  • Run ./scripts/start_management.sh. This gives a root shell within a directory with some management scripts.
  • Run ./manageclients.sh to get help to register Radius clients. A Radius client is e.g. a Wifi access point.
  • Register your Radius clients. Don't forget to take note of the password.
  • Create a WPA2 enterprise Wifi network and register the Radius server by IP in the Network controller software. Enable usage of VLAN's supplied by the Radius server if you need this.
  • Close the shell using exit (or Ctrl+d). The radius service will restart.

Adding your first device using EAP-TLS

  • Execute the following commands as root (or use sudo) in the main directory of this repository.
  • Run ./scripts/start_management.sh. This gives a root shell within a directory with some management scripts.
  • Run ./manageusers.sh to get help to create the key/certificate pair for your device.
  • Generate the key/certificate pair. Take note of the password and close the shell.
  • In the provision directory you can find the Certificate Authority certificate (ca.der) and the password secured key/certificate file (*.p12). Copy these to your device using an USB stick or e.g. scp. In a lab environment a command like python3 -m http.server 8000 can be used in the provision dir to make the files available.
  • Use these files to configure Wifi with EAP-TLS authentication. See for example Windows instructions, Android instructions, Linux instructions or iOS instructions

wifi_eap-tls's People

Contributors

oviserv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

wifi_eap-tls's Issues

Help with a permissions error

Hi, I'm facing this error. I tried several different permutations, sudo, su etc but cannot seem to get past it.

Creating wifieaptls_prepare_radiusd_1 ... 
Creating wifieaptls_prepare_radiusd_1 ... done
Creating wifieaptls_radiusd_1 ... 
Creating wifieaptls_radiusd_1 ... done
Attaching to wifieaptls_prepare_radiusd_1, wifieaptls_radiusd_1
prepare_radiusd_1  | ls: /backup/*_backup.tar.gz: No such file or directory
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | make: /bin/sh: Operation not permitted
prepare_radiusd_1  | Makefile:23: passwords.mk: No such file or directory
prepare_radiusd_1  | make: *** [Makefile:49: passwords.mk] Error 127
wifieaptls_prepare_radiusd_1 exited with code 2


drwxr-s--- 2 root    rancher 4.0K Mar  9 03:29 backup
drwxrwsr-x 3 rancher rancher 4.0K Mar  8 22:58 docker
-rw-rw-r-- 1 rancher rancher 1.1K Mar  8 22:58 docker-compose.yml
drwxrwsr-x 2 rancher rancher 4.0K Mar  8 22:58 docs
-rw-rw-r-- 1 rancher rancher  35K Mar  8 22:58 LICENSE
drwxr-s--- 2 root    rancher 4.0K Mar  9 03:29 provision
-rw-rw-r-- 1 rancher rancher 3.7K Mar  8 22:58 README.md
-rw-rw-r-- 1 rancher rancher 2.6K Mar  8 22:58 RELEASE.md
drwxrwsr-x 2 rancher rancher 4.0K Mar  8 22:58 scripts
drwxrwsr-x 2 rancher rancher 4.0K Mar  8 22:58 templates
drwxrwsr-x 2 rancher rancher 4.0K Mar  8 22:58 test

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.