Skip to content

Comments

Dockerize and k8sitize EOTK#110

Open
sp3nx0r wants to merge 18 commits intoalecmuffett:masterfrom
sp3nx0r:reddit-kubernetes-update
Open

Dockerize and k8sitize EOTK#110
sp3nx0r wants to merge 18 commits intoalecmuffett:masterfrom
sp3nx0r:reddit-kubernetes-update

Conversation

@sp3nx0r
Copy link

@sp3nx0r sp3nx0r commented Dec 27, 2022

Summary

Massive update based on Reddit's experience with modernizing the Dockerfile and deploying into k8s. Commits are organized by content and have detailed commit messages for content changing.

Details

Beyond simple infrastructure change, there are a few EOTK changes that are worth mentioning:

  • We pull down OpenSSL1 for use in OpenResty (not using ubuntu:jammy's OpenSSL3
  • We patch openssl and nginx to provide JA3 fingerprinting in a header for upstream to consume
  • We use tor's HiddenServiceExportCircuitID setting in conjunction with nginx's proxy_protocol to provide the circuit ID as another fingerprint (as detailed by Cloudflare) in a header for upstream to consume
  • It uses stdout JSON logging for nginx. Tor's logging doesn't play well with stdout currently and doesn't have a JSON option. Oh well...
  • The versions of things are abstracted to the Dockerfile (and a .envrc for those still wishing to use the local scripts). This makes it much easier to use bots to update those dependencies (an example renovate.json is included here, will need help enabling for the repo if desired).

Also included update to documentation around HARICA usage and some onion address v3 changes that weren't reflected in the existing docs.

How to test

  • Run make docker-build and make docker-run, check stdout docker logs eotk-container for your onion service address and browse.
  • Note: I couldn't find an easy way to mock up the script builds in the 30min I looked. Let me know if there's an easy no-touch way of doing this. Might come back in a followup PR with something.

Commit list

  • chore: update docs
  • chore: update some more docs, add proxy debugging notes
  • chore: add helper files and references for environment setup
  • feat: update Makefile with docker build/test commands
  • feat: add Dockerfile for main eotk container
  • feat: update tor.conf file
  • feat: add LOG_STDOUT config option for nginx.conf.txt
  • feat: modernize the build scripts for docker
  • feat: update nginx.conf.txt for docker changes
  • feat: add docker entrypoint script to handle initialization and secrets
  • feat: add a Dockerfile to faciliate HARICA's onion csr validation
  • chore: add mkcert's signature
  • feat: add k8s kustomize definition
  • fix: move default config into ./demo.d, fix up docs
  • fix: remove extraneous -f argument from 'docker run'
  • chore: update install details for docker/k8s
  • chore: remove docker-compose for now
  • feat: add a renovate config (will need to enable repo later)

* call out stdout logging is borked currently
* add metrics port so we can grab prometheus metrics
* set RendPostPeriod as part of "good practice"
* call out SocksPort cannot be anything but 0
* add HiddenServiceExportCircuitID to get circuit ID
* move all pinned versions into centralized environment variables
* genericize/improve the checksum / signing validation
* add an OpenSSL install to allow custom patches to be applied
* add new nginx modules for tls fingerprint, logging, metrics
* add LOG_STDOUT handling to pipe logs to PID 1 for docker
* expose ONION_HEADER_SECRET env var and add header logic
* add json logging
* modernize nginx:
    * gzip
    * ssl/tls hardening
    * drop NEL/reporting api headers
* add proxy_protocol directive for tor circuit ID
* fix connection_upgrade bug with Upgrade vs upgrade
* add observability endpoints (metrics/health)
* bunch of k8s gibberish, check READMEs for overview/instruction
Copy link

@Channelmiddle Channelmiddle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

HELLO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants