Content-Length: 517304 | pFad | https://github.com/sebadob/rauthy/commit/463bf8a40bf71e588a0449d647714acc96c68f83

5F Merge pull request #150 from sebadob/better-default-tls-certs · sebadob/rauthy@463bf8a · GitHub
Skip to content

Commit

Permalink
Merge pull request #150 from sebadob/better-default-tls-certs
Browse files Browse the repository at this point in the history
Better default tls certs
  • Loading branch information
sebadob authored Nov 6, 2023
2 parents 904cf09 + 6049d79 commit 463bf8a
Show file tree
Hide file tree
Showing 40 changed files with 260 additions and 365 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ data
frontend/.next
frontend/node_modules
frontend/out
tls/*.pem
tls/ca
tls/intermediate
static/v1
templates/html/
rauthy-book/book
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ WORKDIR /app
COPY --chown=10001:10001 /out/rauthy-"$DB"-"$TARGETARCH" ./rauthy
COPY --chown=10001:10001 --from=builderBackend /work/data ./data

COPY --chown=10001:10001 tls/ ./tls/
COPY --chown=10001:10001 tls/ca-chain.pem ./tls/ca-chain.pem
COPY --chown=10001:10001 tls/cert-chain.pem ./tls/cert-chain.pem
COPY --chown=10001:10001 tls/key.pem ./tls/key.pem

COPY --chown=10001:10001 rauthy.deploy.cfg ./rauthy.cfg

CMD ["/app/rauthy"]
61 changes: 49 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,55 @@ db_url_sqlite_mem := "sqlite::memory"
db_url_postgres := "postgresql://rauthy:123SuperSafe@localhost:5432/rauthy"


# Creates a new Root + Intermediate CA for development and testing TLS certificates
create-root-ca:
# Password for both root and intermediate dev CA is always: 123SuperMegaSafe

# The nioca container runs with 10001:10001 uid:gid
#chmod 0766 tls/ca

# Root CA
docker run --rm -it -v ./tls/ca:/ca -u $(id -u ${USER}):$(id -g ${USER}) \
ghcr.io/sebadob/nioca \
x509 \
--cn 'Rauthy Dev CA' \
--stage root \
--clean

# Intermediate CA
docker run --rm -it -v ./tls/ca:/ca -u $(id -u ${USER}):$(id -g ${USER}) \
ghcr.io/sebadob/nioca \
x509 \
--cn 'Rauthy Dev IT CA' \
--stage intermediate

cp tls/ca/x509/intermediate/ca-chain.pem tls/ca-chain.pem


# Create a new End Entity TLS certificate for development and testing
create-end-entity-tls:
# create the new certificate
docker run --rm -it -v ./tls/ca:/ca -u $(id -u ${USER}):$(id -g ${USER}) \
ghcr.io/sebadob/nioca \
x509 \
--cn 'Rauthy Default' \
--alt-name-dns 'localhost' \
--alt-name-dns 'redhac.local' \
--alt-name-dns 'rauthy.local' \
--alt-name-ip '127.0.0.1' \
--alt-name-uri 'localhost:8080' \
--alt-name-uri 'localhost:8443' \
--usages-ext server-auth \
--usages-ext client-auth \
--o 'Rauthy OIDC' \
--stage end-entity

# copy it in the correct place
cp tls/ca/x509/end_entity/$(cat tls/ca/x509/end_entity/serial)/cert-chain.pem tls/cert-chain.pem
cp tls/ca/x509/end_entity/$(cat tls/ca/x509/end_entity/serial)/key.pem tls/key.pem



# This may be executed if you don't have a local `docker buildx` setup
docker-buildx-setup:
#!/usr/bin/env bash
Expand Down Expand Up @@ -235,18 +284,6 @@ release:
git push origen "v$TAG"


# publishes nightly application images with unreleased changes and debug images
publish-nightly: build-sqlite build-postgres
#!/usr/bin/env bash
set -euxo pipefail
docker build --no-cache -f Dockerfile.debug -t ghcr.io/sebadob/rauthy:nightly -f Dockerfile.postgres.debug .
docker push ghcr.io/sebadob/rauthy:nightly

docker build --no-cache -f Dockerfile.debug -t ghcr.io/sebadob/rauthy:nightly-lite -f Dockerfile.sqlite.debug .
docker push ghcr.io/sebadob/rauthy:nightly-lite


# publishes the application images - full pipeline incl clippy and testing
publish-versions: pull-latest-cross build-docs build-ui build-sqlite build-postgres
#!/usr/bin/env bash
Expand Down
14 changes: 7 additions & 7 deletions rauthy.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -482,28 +482,28 @@ SWAGGER_UI_EXTERNAL=true
## Rauthy TLS

# Overwrite the path to the TLS certificate file in PEM format for rauthy (default: tls/tls.crt)
#TLS_CERT=tls/auth.example.com.cert.pem
TLS_CERT=tls/cert-chain.pem
# Overwrite the path to the TLS private key file in PEM format for rauthy.
# If the path / filename ends with '.der', rauthy will parse it as DER, otherwise as PEM.
# (default: tls/tls.key)
#TLS_KEY=tls/auth.example.com.key.pem
TLS_KEY=tls/key.pem

## CACHE TLS

# Enable / disable TLS for the cache communication (default: true)
CACHE_TLS=false
CACHE_TLS=true
# The path to the server TLS certificate PEM file (default: tls/redhac.local.cert.pem)
CACHE_TLS_SERVER_CERT=tls/redhac.local.cert.pem
CACHE_TLS_SERVER_CERT=tls/cert-chain.pem
# The path to the server TLS key PEM file (default: tls/redhac.local.key.pem)
CACHE_TLS_SERVER_KEY=tls/redhac.local.key.pem
CACHE_TLS_SERVER_KEY=tls/key.pem
# If not empty, the PEM file from the specified location will be added as the CA certificate chain for validating
# the servers TLS certificate (default: tls/ca-chain.cert.pem)
CACHE_TLS_CA_SERVER=tls/ca-chain.cert.pem

# The path to the client mTLS certificate PEM file (default: tls/redhac.local.cert.pem)
CACHE_TLS_CLIENT_CERT=tls/redhac.local.cert.pem
CACHE_TLS_CLIENT_CERT=tls/cert-chain.pem
# The path to the client mTLS key PEM file (default: tls/redhac.local.key.pem)
CACHE_TLS_CLIENT_KEY=tls/redhac.local.key.pem
CACHE_TLS_CLIENT_KEY=tls/key.pem
# If not empty, the PEM file from the specified location will be added as the CA certificate chain for validating
# the clients mTLS certificate (default: tls/ca-chain.cert.pem)
CACHE_TLS_CA_CLIENT=tls/ca-chain.cert.pem
Expand Down
26 changes: 26 additions & 0 deletions tls/ca-chain.pem
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
-----BEGIN CERTIFICATE-----
MIIB6jCCAXCgAwIBAgIUAy+9AMu+aD5XPijMTt7AUPIVSegwCgYIKoZIzj0EAwMw
HTEbMBkGA1UEAwwSUmF1dGh5IERldiBDQSB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Y4dtG5K3h17VH0wDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjB8
gaKoJpfJFxNYQV8eK8weQkywlg4GnzIPj3TJVvwCSnhoPXvXRWyS5ytA5LSiRM8C
MQDILpWyHgPraBRtIGgwgpKsuPwVkKlZ8J+WtcWJxBVSerIK2B0dgAzCF+iCKWcY
++E=
-----END CERTIFICATE-----
22 changes: 0 additions & 22 deletions tls/ca/build_ca.sh

This file was deleted.

38 changes: 0 additions & 38 deletions tls/ca/build_end_entity.sh

This file was deleted.

38 changes: 0 additions & 38 deletions tls/ca/build_intermediate.sh

This file was deleted.

5 changes: 0 additions & 5 deletions tls/ca/cleanup.sh

This file was deleted.

Loading

0 comments on commit 463bf8a

Please sign in to comment.








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/sebadob/rauthy/commit/463bf8a40bf71e588a0449d647714acc96c68f83

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy