Repository navigation
fix: validate database and bucket names in user provisioning - #121
Merged
Merged
Conversation
Follow-up to #109, which validated spec.namespace but left two other tenant controlled WhiskUser fields flowing unsanitized into shell commands executed inside the data pods via kubectl exec. * spec.postgres.database reached `bash -c "... psql --dbname {db_name}"` in exec_psql_command_in_db. Unlike the namespace field it never becomes a filename, so it was not even constrained to path safe characters. * spec.object-storage.{data,route}.bucket reached `sh -c "echo '{command}' | weed shell"` in the seaweedfs client, where a quote breaks out of the single quoted string. Adds util.validate_database_name and util.validate_bucket_name next to the existing validate_namespace and applies them at the call sites and at the shell sinks, plus matching CEL rules on the CRD so the API server rejects the payload before the operator sees it. The regexes and the CEL rules were cross checked to accept exactly the same inputs. Also: * guards the latent render_kvrocks_script / exec_kvrocks_command pair, which repeats the same pattern but is not currently wired into the user path * makes validate_namespace return False for non string input instead of raising TypeError * corrects a copy pasted error message referring to exec_mongosh_command inside exec_psql_command Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
built and tested |
d4rkstar
approved these changes
Aug 29, 2026
sciabarracom
added a commit
that referenced
this pull request
Sep 8, 2026
* fix: fix absolute path in run.sh starting the operator locally gave error "No such file or directory task: Failed to run task "run": task: Failed to run task "d:run": exit status 127", because of an absolute path inside run.sh * fix: path to check for db ready changed the path for wait_db_ready. The path without the final / led to a 301 and not a 200 * fix: invoker and operator image from env removed hardcoded values for cfg.get operator.image / operator.tag and invoker.image and invoker.tag. Config now check env vars and defaults to old images * fix(test): milvus tests fixed tests for minio / seaweedfs . * chore(docs): taskfile added desc to taskfile tasks * fix: namespace validation added namespace validation in user creation * do not use a fixed offset to nuvolaris.io (#119) * do not use a fixed offset to nuvolaris.io * removed talos --------- Co-authored-by: Trustable User <noreply@example.com> * remove reference to nuvolaris logo (#120) Co-authored-by: Trustable User <noreply@example.com> * fix: validate database and bucket names in user provisioning (#121) Follow-up to #109, which validated spec.namespace but left two other tenant controlled WhiskUser fields flowing unsanitized into shell commands executed inside the data pods via kubectl exec. * spec.postgres.database reached `bash -c "... psql --dbname {db_name}"` in exec_psql_command_in_db. Unlike the namespace field it never becomes a filename, so it was not even constrained to path safe characters. * spec.object-storage.{data,route}.bucket reached `sh -c "echo '{command}' | weed shell"` in the seaweedfs client, where a quote breaks out of the single quoted string. Adds util.validate_database_name and util.validate_bucket_name next to the existing validate_namespace and applies them at the call sites and at the shell sinks, plus matching CEL rules on the CRD so the API server rejects the payload before the operator sees it. The regexes and the CEL rules were cross checked to accept exactly the same inputs. Also: * guards the latent render_kvrocks_script / exec_kvrocks_command pair, which repeats the same pattern but is not currently wired into the user path * makes validate_namespace return False for non string input instead of raising TypeError * corrects a copy pasted error message referring to exec_mongosh_command inside exec_psql_command Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * rebranding (#122) Co-authored-by: Michele Sciabarra <michele@sciabarra.com> * update naming * operator build updated * 0.9.0 (#124) * updating distro in dockerfile --------- Co-authored-by: Bruno Salzano <d4rkstar@gmail.com> Co-authored-by: Trustable User <noreply@example.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Michele Sciabarra <michele@sciabarra.com> Co-authored-by: miki3421 <42601846+miki3421@users.noreply.github.com>
sciabarracom
added a commit
that referenced
this pull request
Sep 8, 2026
* fix: fix absolute path in run.sh starting the operator locally gave error "No such file or directory task: Failed to run task "run": task: Failed to run task "d:run": exit status 127", because of an absolute path inside run.sh * fix: path to check for db ready changed the path for wait_db_ready. The path without the final / led to a 301 and not a 200 * fix: invoker and operator image from env removed hardcoded values for cfg.get operator.image / operator.tag and invoker.image and invoker.tag. Config now check env vars and defaults to old images * fix(test): milvus tests fixed tests for minio / seaweedfs . * chore(docs): taskfile added desc to taskfile tasks * fix: namespace validation added namespace validation in user creation * do not use a fixed offset to nuvolaris.io (#119) * do not use a fixed offset to nuvolaris.io * removed talos --------- Co-authored-by: Trustable User <noreply@example.com> * remove reference to nuvolaris logo (#120) Co-authored-by: Trustable User <noreply@example.com> * fix: validate database and bucket names in user provisioning (#121) Follow-up to #109, which validated spec.namespace but left two other tenant controlled WhiskUser fields flowing unsanitized into shell commands executed inside the data pods via kubectl exec. * spec.postgres.database reached `bash -c "... psql --dbname {db_name}"` in exec_psql_command_in_db. Unlike the namespace field it never becomes a filename, so it was not even constrained to path safe characters. * spec.object-storage.{data,route}.bucket reached `sh -c "echo '{command}' | weed shell"` in the seaweedfs client, where a quote breaks out of the single quoted string. Adds util.validate_database_name and util.validate_bucket_name next to the existing validate_namespace and applies them at the call sites and at the shell sinks, plus matching CEL rules on the CRD so the API server rejects the payload before the operator sees it. The regexes and the CEL rules were cross checked to accept exactly the same inputs. Also: * guards the latent render_kvrocks_script / exec_kvrocks_command pair, which repeats the same pattern but is not currently wired into the user path * makes validate_namespace return False for non string input instead of raising TypeError * corrects a copy pasted error message referring to exec_mongosh_command inside exec_psql_command Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> * rebranding (#122) Co-authored-by: Michele Sciabarra <michele@sciabarra.com> * update naming * operator build updated * 0.9.0 (#124) * updating distro in dockerfile --------- Co-authored-by: Bruno Salzano <d4rkstar@gmail.com> Co-authored-by: Trustable User <noreply@example.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Michele Sciabarra <michele@sciabarra.com> Co-authored-by: miki3421 <42601846+miki3421@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #109, which validated spec.namespace but left two other tenant controlled WhiskUser fields flowing unsanitized into shell commands executed inside the data pods via kubectl exec.
bash -c "... psql --dbname {db_name}"in exec_psql_command_in_db. Unlike the namespace field it never becomes a filename, so it was not even constrained to path safe characters.sh -c "echo '{command}' | weed shell"in the seaweedfs client, where a quote breaks out of the single quoted string.Adds util.validate_database_name and util.validate_bucket_name next to the existing validate_namespace and applies them at the call sites and at the shell sinks, plus matching CEL rules on the CRD so the API server rejects the payload before the operator sees it. The regexes and the CEL rules were cross checked to accept exactly the same inputs.
Also: