Code Monkey home page Code Monkey logo

yswan's Introduction

yswan

Final Project for "Computer Networking Security": A Layer-3 VPN implementation over TLS

  • Written in Rust with tokio

  • Features

    • client authentication (PAM)
    • client authentication (cert)
    • multiple clients
    • centralized route installing

Building

You can either use cargo directly to build:

cargo build

or run the custom build script (it will copy binaries to ./bin)

./build

Testing

testing

"Gateway" is also serving as DNS on public networks to fake some domains (e.g., gateway.example.net).

# Enter gateway shell
docker-compose exec gateway bash
# Run yswan server
cd /app
./yswan server --tun-inet 10.233.233.1 --key ./pki/gateway/gateway.example.net.key --cert ./pki/gateway/gateway.example.net.pem --cacert ./pki/ca/ca.pem
# Enter client1 shell
docker-compose exec client1 bash
# Run yswan client
./yswan client --connect gateway.example.net --tun-inet 10.233.233.100 --cacert ./pki/ca/ca.pem --cert _ --key _

Some utilities

  • ypki: A small utility to make CA and endpoint certificates by OpenSSL.

    Example usage:

    # Make pki directory
    mkdir -p ./bin/pki
    
    # Generate certificates (+ keypairs) for CA
    mkdir ./pki/ca
    ./ypki ca --outputdir ./bin/pki/ca --cadir ./bin/pki/ca --subject example-ca --days 3650
    
    # Generate certificates (+ keypairs) for servers
    mkdir ./pki/gateway
    ./ypki endpoint --outputdir ./bin/pki/gateway --cadir ./bin/pki/ca --subject gateway.example.net --days 180
  • ytcpdump: Wrapper for docker-compose + tcpdump

    Example usage:

    # Capture ICMP packets involving 10.233.233.1 at "yswan" interface on service "client1"
    ./ytcpdump client1 -i yswan 'icmp and host 10.233.233.1'

    ytcpdump

  • ywireshark: Wireshark wrapper for docker-compose + tcpdump

    This is similar to ytcpdump.

    Example usage:

    # Capture ICMP packets involving 10.233.233.1 at "yswan" interface on service "client1"
    sudo ./ywireshark client1 -i yswan 'icmp and host 10.233.233.1'

    ywireshark

yswan's People

Contributors

sigeryang avatar

Stargazers

Chen avatar nyovelt avatar

Watchers

 avatar

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.