-
Notifications
You must be signed in to change notification settings - Fork 1
fix: respect env vars in XKS config.sh #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
p0wline
wants to merge
4
commits into
develop
Choose a base branch
from
fix/xks-config-env-override
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−73
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
d731085
fix: respect env vars in XKS config.sh (use ${VAR:-default})
p0wline b342e0a
test(server): add auth_verifier.toml fixture for AuthVerifierConfig test
p0wline 10be4a9
Merge remote-tracking branch 'origin/develop' into fix/xks-config-env…
p0wline a3b5ef8
fix(rbac): add crypto_officer_users.toml fixture for non-ceremony CO …
p0wline File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| # Change this to your XKS Proxy endpoint to test. | ||
| export XKS_PROXY_HOST="localhost:9998" | ||
| export XKS_PROXY_HOST="${XKS_PROXY_HOST:-localhost:9998}" | ||
| # Change this to the URI_PREFIX of a logical keystore supported by your XKS Proxy. | ||
| export URI_PREFIX="aws" | ||
| export URI_PREFIX="${URI_PREFIX:-aws}" | ||
| # Change this to the Access key ID for request authentication to your logical keystore. | ||
| # Valid characters are a-z, A-Z, 0-9, /, - (hyphen), and _ (underscore) | ||
| export SIGV4_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE" | ||
| export SIGV4_ACCESS_KEY_ID="${SIGV4_ACCESS_KEY_ID:-AKIAIOSFODNN7EXAMPLE}" | ||
| # Change this to the Secret access key for request authentication to your logical keystore. | ||
| # Secret access key must have between 43 and 64 characters. Valid characters are a-z, A-Z, 0-9, /, +, and = | ||
| export SIGV4_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" | ||
| export SIGV4_SECRET_ACCESS_KEY="${SIGV4_SECRET_ACCESS_KEY:-wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY}" | ||
| # Change this to a test key id supported by your logical keystore. | ||
| export KEY_ID="aws_xks_kek" | ||
| export KEY_ID="${KEY_ID:-aws_xks_kek}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,69 +1,4 @@ | ||
| # KMS server configured with Authentication Verifier (auth-verifier) | ||
| # as the primary auth method, served over HTTPS. | ||
| # | ||
| # The KMS server: | ||
| # 1. Terminates TLS using a PEM server certificate and private key. | ||
| # 2. Validates bearer tokens against the verifier's JWKS endpoint. | ||
| # 3. Exposes the Web UI login form (GET /ui/auth_method returns "AUTH_VERIFIER") | ||
| # and proxies credentials to the verifier via POST /ui/login_as. | ||
| # | ||
| # Because kms_public_url uses https://, the session cookie will carry the Secure | ||
| # flag — browsers only send it over HTTPS, which is the expected behaviour for | ||
| # production. For local dev with a self-signed certificate the KMS client must | ||
| # set accept_invalid_certs = true. | ||
| # | ||
| # Prerequisites: | ||
| # - A running Authentication Verifier at auth_verifier_url below. | ||
| # - The verifier's JWKS endpoint must be reachable from the KMS server. | ||
| # - The TLS cert/key files below must exist (relative to the repo root). | ||
| # | ||
| # Bound to port 9998 (default KMS port). | ||
|
|
||
| default_username = "admin" | ||
| kms_public_url = "https://localhost:9998" | ||
|
|
||
| [http] | ||
| port = 9998 | ||
| hostname = "0.0.0.0" | ||
|
|
||
| [tls] | ||
| # Server certificate and private key (PEM). No client CA → server-TLS only | ||
| # (no mutual authentication required). | ||
| tls_cert_file = "test_data/certificates/client_server/server/kmserver.acme.com.crt" | ||
| tls_key_file = "test_data/certificates/client_server/server/kmserver.acme.com.key" | ||
|
|
||
| [db] | ||
| database_type = "sqlite" | ||
| sqlite_path = "./sqlite-data-auth-verifier" | ||
| clear_database = false | ||
|
|
||
| # ── Authentication Verifier ────────────────────────────────────────────────── | ||
| # When both `auth_verifier_url` and `auth_verifier_realm` are set, the | ||
| # KMS server: | ||
| # 1. Validates bearer tokens against the verifier's JWKS endpoint | ||
| # 2. Exposes the Web UI login form (GET /ui/auth_method returns "AUTH_VERIFIER") | ||
| # 3. Proxies login credentials to the verifier via POST /ui/login_as | ||
| # | ||
| # `auth_verifier_accept_invalid_certs` allows the JWKS fetch to target an HTTP | ||
| # URL (or a server with a self-signed certificate). In production the verifier | ||
| # must be reachable over HTTPS with a valid certificate, and this flag must be | ||
| # set to false. | ||
| [auth_verifier] | ||
| auth_verifier_url = "https://localhost:8443" | ||
| auth_verifier_realm = "_" | ||
| auth_verifier_accept_invalid_certs = true # dev/test only — never in production | ||
|
|
||
| [ui_config] | ||
| ui_index_html_folder = "./ui/dist" | ||
| # A stable session salt ties the session cookie encryption key to this server's | ||
| # public URL, making it deterministic across restarts and portable across | ||
| # load-balanced instances. | ||
| # Generate your own with: openssl rand -hex 32 | ||
| ui_session_salt = "change-me-use-openssl-rand-hex-32" | ||
|
|
||
| [logging] | ||
| rust_log = "info,cosmian_kms=debug" | ||
| quiet = false | ||
| log_to_syslog = false | ||
| environment = "development" | ||
| ansi_colors = true | ||
| auth_verifier_url = "https://localhost:8443" | ||
| auth_verifier_realm = "_" | ||
| auth_verifier_accept_invalid_certs = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Test KMS server — RBAC mode with privileged users, no ceremony. | ||
| # Loaded by start_default_test_kms_server_with_crypto_officer_users() and | ||
| # start_default_test_kms_server_with_multi_crypto_officer_users(). | ||
| # The crypto_officer_users field is overridden at runtime by the test helper. | ||
| # Port and database paths are allocated dynamically at runtime. | ||
| # | ||
| # CO users: injected at runtime (owner.client@acme.com, user.privileged@acme.com, …) | ||
|
|
||
| default_username = "tech@cosmian.com" | ||
| kms_public_url = "https://localhost:10005" | ||
|
|
||
| [http] | ||
| port = 10005 | ||
| hostname = "0.0.0.0" | ||
|
|
||
| [db] | ||
| database_type = "sqlite" | ||
| sqlite_path = "/tmp/kms_test_crypto_officer_users" | ||
| clear_database = true | ||
|
|
||
| [workspace] | ||
| root_data_path = "/tmp/kms_test_workspace_crypto_officer_users" | ||
| tmp_path = "/tmp" | ||
|
|
||
| [tls] | ||
| tls_cert_file = "test_data/certificates/client_server/server/kmserver.acme.com.crt" | ||
| tls_key_file = "test_data/certificates/client_server/server/kmserver.acme.com.key" | ||
| clients_ca_cert_file = "test_data/certificates/client_server/ca/ca.crt" | ||
|
|
||
| [roles] | ||
| crypto_officer_require_ceremony = false |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not get why this file has changed