Skip to content

Follow the next Tenet release: readiness, pending restarts, upstream password, guide - #60

Open
medazizktata25 wants to merge 7 commits into
mainfrom
feat/tenet-branch-adoption
Open

medazizktata25 wants to merge 7 commits into
mainfrom
feat/tenet-branch-adoption

Conversation

@medazizktata25

Copy link
Copy Markdown

Follows the next Tenet release (guepard-tenet branch feature/performance-tuning) and the public API changes that adopt it (Guepard-Corp/guepard-public-api#283).

What changes

  • deploy --masked waits for masked_status: ready, not just a Tenet port, and stops with the API's reason when it reports failed.
  • A Tenet command answered 202 (status: pending, proxy still starting) prints that instead of failing.
  • tenet deploy --upstream-password (or GUEPARD_TENET_UPSTREAM_PASSWORD, whose value help never shows) sends Tenet's upstream password for a standalone deploy. deploy --masked and tenet proxy set take none: the API supplies the password of the deployment user that auth.upstream.user names.
  • Tenet errors print the API's reason (Nomad: <body> for Nomad errors) instead of raw JSON.
  • Tenet guide: the four behaviour changes customers will notice, and how to keep each old behaviour:
    • writes refused by default (block_writes), and why allowing them needs strict_masking: true;
    • masked values change (seed_derivation);
    • rules with column patterns now apply;
    • LIKE/range filters on masked columns refused.

How it was tested

cargo test: 59 pass. Run end to end against the API PR's Lambdas (sam local), real Nomad 2.1.1 and a local Supabase:

  • masked deploy, proxy get/set and purge;
  • Tenet auth with the password supplied by the API and with --upstream-password;
  • a forced pending restart (node made ineligible);
  • a standalone tenet deploy by the deployment's owner;
  • the new Tenet's features through CLI-managed deployments.

The pattern-rule entry in the guide was measured on the published Tenet image: a phone column under column: "*phone*" came back in clear, and the same rule written literally masked it.

Not verified

  • Against the real API Gateway and AWS stage; local only.
  • Needs the API PR deployed: against the current API, deploy --masked with Tenet auth has no password source.

The next Tenet (guepard-tenet feature/performance-tuning) refuses
writes on a masked connection by default and derives masked values
with siphash instead of xxhash64, so every masked value changes for
the same salt. Both were run against a local Postgres with the branch
build and with main's: every sample proxy.yaml under scripts/ loads
and masks reads on both, the UPDATE main allows is refused, and
seed_derivation: xxhash64 reproduces main's hash. The CLI passes
proxy.yaml through unchanged, so no code changes are needed.
The previous commit told readers to set block_writes: false to keep
writes working. Run on Nomad with the branch image, that alone lets a
client copy a masked column into an unmasked one ('reach me: ' ||
email) and read the real value back; strict_masking: true refuses the
copy. Also note that an email inside free text in a column without a
rule is not masked by the content scanner.
deploy --masked returned as soon as GET /deploy/{id} carried a
tenet_proxy_port. The API sends that port while the Tenet job runs
and the database behind it is still starting or failing, so the CLI
could report success before the database accepted a connection
(against a local stack it returned after 7s). Only masked_status
ready now ends the wait; the port alone counts only for an API that
sends no masked_status.
deploy --masked, tenet deploy and tenet proxy set take
--upstream-password (env GUEPARD_TENET_UPSTREAM_PASSWORD) for Tenet's
auth mode; the API refuses it inline in proxy.yaml and keeps it in
the proxy's Nomad Variable. deploy sends it only with --masked, so
the env var does not leak into other deploys.

The API now answers tenet deploy/start/proxy set with 202 and status
pending when the proxy is not running within ~20 s. Those calls used
to accept only 200, so a 202 would have been reported as an error;
they now succeed and say the proxy is still starting.
…y set

The API now supplies Tenet's upstream password itself when
auth.upstream.user is one of the deployment's database users, which it
created and whose passwords it holds. The flag stays only on a
standalone `tenet deploy`, whose upstream is not a Guepard deployment.
Tenet commands printed the whole error body, e.g. Status 400:
{"message":"Nomad error","status":400,"body":"..."}. They now print
the API's message, and for a Nomad failure the reason it carries,
as deploy errors already do.
Two changes customers will notice were missing from the list. The
published Tenet matches rule columns literally, so a rule such as
column: "*phone*" left that column in clear; the next release applies
it. Measured on the published image: the real phone number came back
under "*phone*" and was masked under column: phone. LIKE, regex,
SIMILAR TO, BETWEEN and range filters on masked columns are now
refused; the wording follows refuse_unsupported_predicates in
guepard-tenet's config.rs.
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.

1 participant