Git Product home page Git Product logo

go-rosenpass's Introduction

cunīcu logo

GitHub build goreportcard Codecov License GitHub go.mod Go version Go Reference Contributor Covenant

🚧 cunīcu is currently still in an Alpha state and not usable yet

cunīcu is a user-space daemon managing WireGuard® interfaces to establish a mesh of peer-to-peer VPN connections in harsh network environments.

To achieve this, cunīcu utilizes a signaling layer to exchange peer information such as public encryption keys, hostname, advertised networks and reachability information to automate the configuration of the networking links. From a user perspective, cunīcu alleviates the need of manual configuration such as exchange of public keys, IP addresses, endpoints, etc.. Hence, it adopts the design goals of the WireGuard project, to be simple and easy to use.

Thanks to Interactive Connectivity Establishment (ICE), cunīcu is capable to establish direct connections between peers which are located behind NAT firewalls such as home routers. In situations where ICE fails, or direct UDP connectivity is not available, cunīcu falls back to using TURN relays to reroute traffic over an intermediate hop or encapsulate the WireGuard traffic via TURN-TCP.

It relies on the awesome pion/ice package for ICE as well as bundles the a Go user-space implementation of WireGuard in a single binary for systems in which WireGuard kernel support has not landed yet.

With these features, cunīcu can be used to quickly build multi-agent systems or connect field devices such as power grid monitoring infrastructure into a fully connected mesh. Within the ERIGrid 2.0 project, cunīcu is used to interconnect smart grid laboratories for geographically distributed simulation of energy systems.

Documentation

cunīcu's documentation can be found here: cunicu.li/docs.

Contact

Please have a look at the contact page: https://cunicu.li/docs/contact

License

cunīcu is licensed under the Apache 2.0 license.

  • SPDX-FileCopyrightText: 2023 Steffen Vogel [email protected]
  • SPDX-License-Identifier: Apache-2.0

Funding acknowledgement

The project has been initiated by Steffen Vogel while working at the Institute for Automation of Complex Power Systems (ACS) of RWTH Aachen University.

European Flag The development of cunīcu has been supported by the ERIGrid 2.0 project of the H2020 Programme under Grant Agreement No. 870620

Trademark

WireGuard and the WireGuard logo are registered trademarks of Jason A. Donenfeld.

go-rosenpass's People

Contributors

renovate[bot] avatar stv0g avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

textaligncenter

go-rosenpass's Issues

Biscuit counter is 12 bytes in size

By @koraa in #27 (comment)

https://github.com/stv0g/go-rosenpass/blob/d7e38ecaf9e7803f2824a03ac24ac34944a53af6/biscuit.go#L8

Severity: A (Functionality) – Biscuit counter is 12 bytes in size; using just 8 bytes is not necessarily catastrophic. The biscuit counter is always created and consumed by the same peer, so changing the format is not catastrophic; however it is a violation of the spec. Using just 8 bytes may also have an impact on overflow handling which I am unable to assess right now

Cryptographic code review

Thank you for writing this module. I think you did an incredible job with this!
Cryptography implementation is hard; I will document any observations about crypto I make

I will use the following scale to mark my observations:

  1. Critical
  2. Severe
  3. Dangerous

--------

  1. Concerning
  2. Tradeoff
  3. (Just barely) acceptable

--------

A. Functionality
B. Observation

The first block of ratings is for vulnerabilities with a high impact; these must be addressed, otherwise I would strongly argue against anyone ever using go-rosenpass. The second block is for issues that may reduce the security of go-rosenpass but not to the point that I would advise against using go-rosenpass.

EDIT: The last category is about the quality of the code, not about the security.

Summary

Eliminate IO/logging initiated by unauthenticated code paths

By @koraa in #27 (comment)

https://github.com/stv0g/go-rosenpass/blob/d7e38ecaf9e7803f2824a03ac24ac34944a53af6/handshake_initiator.go#L101

https://github.com/stv0g/go-rosenpass/blob/d7e38ecaf9e7803f2824a03ac24ac34944a53af6/server.go#L143

Severity: 3 (Dangerous) – No IO should be performed in response to maliciously crafted messages as performing IO opens up pandoras box in regards to DOS attacks (think of logs filling up, disk exhaustion, ghastly stuff like that).

Note that this performs a lot of allocations even if log level Debug was used.

Add auto-configuration mode

We could introduce a schema for configuration files to automatically infer a Rosenpass configuration from an existing WireGuard config.

Example

  • RP listen port = WG listen port (single port mode)
  • RP peer endpoints = WG peer endpoints port (single port mode)
  • RP static public key: /etc/wireguard/<intf-name>/pqpk
  • RP static public key: /etc/wireguard/<intf-name>/pksk
  • RP static peer public key: /etc/wireguard/<intf-name>/<peers-b64-wg-pubkey>.pqpk

Add single-port mode via eBPF filtered connection

The Rosenpass wire-protocol has been designed to be orthogonal to the WireGuard protocol.

As a result it is possible to speak both protocols over the same port which eases firewall / NAT configuration.

We can use the Linux/BSDs SO_ATTACH_FILTER socket option to attach a eBPF program which filters-out Rosenpass packets and leaves everything else to the in-kernel WireGuard handler.

I've built a proof-of-concept in Go here: https://github.com/stv0g/cunicu/tree/6965a8c42b8a2663b7fea7de2695a1b6c27cd29d/ebpf_poc

Check dual-stack support for OpenBSD and other platforms

// BUG(rsc,mikio): On DragonFly BSD and OpenBSD, listening on the
// "tcp" and "udp" networks does not listen for both IPv4 and IPv6
// connections. This is due to the fact that IPv4 traffic will not be
// routed to an IPv6 socket - two separate sockets are required if
// both address families are to be supported.
// See inet6(4) for details.

Source: https://go.dev/src/net/ipsock.go

Workaround: Open two sockets for DragonFly and OpenBSD.

This issue does not seem to affect Windows.

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.