Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Provide a TAP device to enclave application #43

Merged
merged 55 commits into from
Jan 24, 2023
Merged

Provide a TAP device to enclave application #43

merged 55 commits into from
Jan 24, 2023

Commits on Nov 17, 2022

  1. PoC for TAP support.

    This fixes #26.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    6d1f996 View commit details
    Browse the repository at this point in the history
  2. Add executable.

    ...because nitriding is no longer (just) a package.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    772c1db View commit details
    Browse the repository at this point in the history
  3. Add config validation step.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    63533c0 View commit details
    Browse the repository at this point in the history
  4. Add system architecture diagram.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    95c1aab View commit details
    Browse the repository at this point in the history
  5. Add handler that allows for secret registration.

    Nitriding is going to be running two Web servers: one is public-facing
    and meant to be accessed by clients and the other is enclave-facing and
    meant to be accessed by the enclave application.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    63faf97 View commit details
    Browse the repository at this point in the history
  6. Add Makefile and refactor standalone application.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    3ffa59d View commit details
    Browse the repository at this point in the history
  7. Add .gitignore.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    523667b View commit details
    Browse the repository at this point in the history
  8. Add target to build nitriding executable.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    d2b9202 View commit details
    Browse the repository at this point in the history
  9. Add function for creating a unix domain socket.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    21d68c8 View commit details
    Browse the repository at this point in the history
  10. Refactor.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    755834f View commit details
    Browse the repository at this point in the history
  11. Remove AddRoute.

    Nitriding is now a stand-alone application, obviating the need for an
    API to add HTTP handlers.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    167c5cf View commit details
    Browse the repository at this point in the history
  12. Re-create networking if necessary.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    3f19c82 View commit details
    Browse the repository at this point in the history
  13. Rename handler.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    a202081 View commit details
    Browse the repository at this point in the history
  14. Display domain socket address.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    52ad0d6 View commit details
    Browse the repository at this point in the history
  15. Add log messages.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    ea0971f View commit details
    Browse the repository at this point in the history
  16. Rename handlers and add tests.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    3461486 View commit details
    Browse the repository at this point in the history
  17. Add sync handler.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    cf0284c View commit details
    Browse the repository at this point in the history
  18. Update comment.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    f60dcf2 View commit details
    Browse the repository at this point in the history
  19. Block forever after starting the enclave.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    894f701 View commit details
    Browse the repository at this point in the history
  20. Add Go dependencies of command line tool.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    02da09e View commit details
    Browse the repository at this point in the history
  21. Add reverse proxy for enclave application.

    The reverse proxy terminates TLS and forwards all but a select few HTTP
    requests to the enclave application, which runs its own Web server.
    Since the reverse proxy terminates TLS, the enclave application does not
    need to bother with certificates and can expose a simple HTTP server.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    a120b7c View commit details
    Browse the repository at this point in the history
  22. Provide a function to shut down the enclave.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    00f40b8 View commit details
    Browse the repository at this point in the history
  23. Allow application to register key material.

    Non-HTTP enclave applications need a way to link their key material to
    the attestation document, which serves as our root of trust.  This
    commit adds a new enclave-internal endpoint that allows applications to
    register a hash over their public key material.  This hash (along with
    a hash over nitriding's HTTPS certificate) is then embedded in
    attestation documents.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    b3d08c2 View commit details
    Browse the repository at this point in the history
  24. Add handler to signal readiness.

    This enclave-internal HTTP handler allows applications to signal their
    readiness to nitriding.  When the handler is called, nitriding starts
    its Internet-facing Web server.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    efb5580 View commit details
    Browse the repository at this point in the history
  25. Replace domain socket with TCP port.

    Domain sockets are great for high-throughput applications but we don't
    need troughput here; we need ease of use.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    80812c1 View commit details
    Browse the repository at this point in the history
  26. Re-add loopback interface creation.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    f86cd67 View commit details
    Browse the repository at this point in the history
  27. Add example application.

    A simple Python client that retrieves its IP address by connecting to a
    Web server.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    9ab4012 View commit details
    Browse the repository at this point in the history
  28. Rename path from "key" to "hash".

    The endpoint takes as input a SHA-256 hash, so "hash" better reflects
    what's going on behind the scenes; "key" is too broad of a term.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    e757a4c View commit details
    Browse the repository at this point in the history
  29. Update documentation and architecture diagram.

    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    82c0b1f View commit details
    Browse the repository at this point in the history
  30. Simplify the way we use autocert.

    This patch makes use of Let's Encrypt's tls-alpn-01 challenge which
    is simpler than the http-01 challenge because it does not require a
    separate listener on port 80.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    130eb77 View commit details
    Browse the repository at this point in the history
  31. Add missing Go dependencies.

    ...and add a -f to rm, while we're at it.
    Philipp Winter committed Nov 17, 2022
    Configuration menu
    Copy the full SHA
    695161d View commit details
    Browse the repository at this point in the history

Commits on Nov 18, 2022

  1. Make handler naming consistent.

    Philipp Winter committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    e4c63a9 View commit details
    Browse the repository at this point in the history
  2. Move Sleep call to signalReady.

    Philipp Winter committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    83863b2 View commit details
    Browse the repository at this point in the history
  3. Simplify Makefile.

    There's no real need for cmddeps.
    Philipp Winter committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    8d8133d View commit details
    Browse the repository at this point in the history
  4. Initialize array with a handful of bytes.

    ...to make the array distinct from the default, which is all 0-bytes.
    Philipp Winter committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    e8b9338 View commit details
    Browse the repository at this point in the history
  5. Fix incorrect endpoint.

    Philipp Winter committed Nov 18, 2022
    Configuration menu
    Copy the full SHA
    2ed7aba View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2022

  1. Use hard-coded IP addresses.

    So far, nitriding has used DHCP to obtain an IP address, which adds
    complexity and unnecessary attack surface.  This commit replaces our use
    of DHCP with a hard-coded IP address.
    Philipp Winter committed Nov 19, 2022
    Configuration menu
    Copy the full SHA
    e05c1f4 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2022

  1. Finish creation of tap0 interface.

    This commit wraps up the configuration of the tap0 interface.  We
    configure the interface statically to avoid having to use an in-enclave
    DHCP client -- an unnecessary security risk.
    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    bcac0c9 View commit details
    Browse the repository at this point in the history
  2. Add clarifying content.

    Cheers to Ralph for pointing out the lack of explanation.
    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    c4c72c5 View commit details
    Browse the repository at this point in the history
  3. Don't use multicast MAC address.

    Least significant bit of the most significant byte indicates a multicast
    address if set.
    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    6c17bfd View commit details
    Browse the repository at this point in the history
  4. Set default gateway after activating link.

    ...otherwise, the operation fails.
    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    6990ac2 View commit details
    Browse the repository at this point in the history
  5. Use requests.status_codes.codes.ok instead of 200.

    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    621b1e4 View commit details
    Browse the repository at this point in the history
  6. Invoke r.raise_for_status() after request.

    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    41d8af8 View commit details
    Browse the repository at this point in the history
  7. Don't mix chi's major version numbers.

    This commit removes the chi import that's not part of its v5 API.  It
    also initializes chi's middleware before we create routes because chi
    requires that.
    Philipp Winter committed Nov 22, 2022
    Configuration menu
    Copy the full SHA
    a832419 View commit details
    Browse the repository at this point in the history

Commits on Nov 23, 2022

  1. Validate all command line arguments.

    This commit 1) ensures that all required command line arguments are
    present and 2) validates the arguments' values.  This commit also
    changes the type of some configuration variables to more appropriate
    types, e.g., uint16 for AF_INET port numbers.
    Philipp Winter committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    9906e90 View commit details
    Browse the repository at this point in the history
  2. Add prefix to serialized attestation hashes.

    This is going to facilitate the transition to a different hash function.
    Philipp Winter committed Nov 23, 2022
    Configuration menu
    Copy the full SHA
    c568165 View commit details
    Browse the repository at this point in the history

Commits on Nov 24, 2022

  1. Add FIXME and refer to GitHub issue.

    Philipp Winter committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    7b6f27e View commit details
    Browse the repository at this point in the history
  2. Use latest Go version in GitHub action.

    Philipp Winter committed Nov 24, 2022
    Configuration menu
    Copy the full SHA
    de88f4d View commit details
    Browse the repository at this point in the history

Commits on Nov 29, 2022

  1. Replace our own constants with the ones from math.

    This adds clarity.
    Philipp Winter committed Nov 29, 2022
    Configuration menu
    Copy the full SHA
    b78c4b8 View commit details
    Browse the repository at this point in the history
  2. Use flag.UintVar for all ports.

    There's no reason to allow negative ports and Go's spec guarantees that
    a uint is at least 32 bits -- the size of an AF_VSOCK port.
    Philipp Winter committed Nov 29, 2022
    Configuration menu
    Copy the full SHA
    a098ea3 View commit details
    Browse the repository at this point in the history
  3. Install requests via apk instead of pip.

    Ralph measured that this saves around 20 MB of space.
    Philipp Winter committed Nov 29, 2022
    Configuration menu
    Copy the full SHA
    8710b38 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2023

  1. Delete outdated references to HTTP-01 challenge.

    Philipp Winter committed Jan 20, 2023
    Configuration menu
    Copy the full SHA
    94d7d99 View commit details
    Browse the repository at this point in the history
  2. Update to latest dependencies.

    Note that we have to run `go get gvisor.dev/gvisor/runsc@go` in addition
    to `go get -u` because we need gvisor/runsc's Go branch:
    https://github.com/google/gvisor#using-go-get
    Philipp Winter committed Jan 20, 2023
    Configuration menu
    Copy the full SHA
    beed0b9 View commit details
    Browse the repository at this point in the history
  3. Remove unused curTime argument.

    Philipp Winter committed Jan 20, 2023
    Configuration menu
    Copy the full SHA
    c850d56 View commit details
    Browse the repository at this point in the history

Commits on Jan 24, 2023

  1. Be explicit about enclave-internal endpoints.

    Philipp Winter committed Jan 24, 2023
    Configuration menu
    Copy the full SHA
    9edb2c4 View commit details
    Browse the repository at this point in the history