feat(nico): add AUTH-XX-03 specified-key access validation#469
Draft
abegnoche wants to merge 5 commits into
Draft
feat(nico): add AUTH-XX-03 specified-key access validation#469abegnoche wants to merge 5 commits into
abegnoche wants to merge 5 commits into
Conversation
Verify a tenant-specified key (SSH key) can access out-of-band components, with the serial console (SOL) as the verifiable example. - nico_client: add NICo tenant REST (/nico/) path helpers alongside the Forge control-plane (/carbide/) helpers; SSH key groups and per-site serial-console config live only on the tenant REST API. - query_key_access.py: read the site's SSH key groups and serial-console configuration and emit the provider-neutral access contract; network devices are provider-managed and reported as unverified. - SpecifiedKeyAccessCheck: pass when a specified key can reach at least one component, fail when a key-access path is disabled/broken, skip when access can only be left unverified. - Wire query_key_access into the bare_metal suite + NICo config. Ships unreleased (not added to released_tests.json). Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Alexandre Begnoche <abegnoche@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
The deployed NICo clusters serve the API under the /carbide/ segment (/nico/ is the newer name). Use the existing forge_get/forge_get_all helpers like every other NICo script instead of introducing /nico/ helpers, which 404 on current clusters. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Alexandre Begnoche <abegnoche@users.noreply.github.com>
When no SSH key group with a key is synced to the site, emit a structured skip that distinguishes 'no key groups exist at all' from 'key groups exist but none are synced to this site' (carrying an org_key_groups count), so the operator knows what to configure. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Alexandre Begnoche <abegnoche@users.noreply.github.com>
Add a key_access.yaml config that provisions an ephemeral SSH key + key group synced to the site (setup), runs SpecifiedKeyAccessCheck (test), then deletes them (teardown), so AUTH-XX-03 can go green in CI without manual key setup. The throwaway private key is generated and discarded immediately; only the unusable public key is registered. - nico_client: add forge_post/forge_patch/forge_delete write helpers. - setup_key_access.py / teardown_key_access.py scripts (best-effort, emit created IDs even on failure so teardown stays reliable). - Unit coverage for the query/setup/teardown scripts in test_nico_provider.py. Read-only bare_metal.yaml flow is unchanged. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Alexandre Begnoche <abegnoche@users.noreply.github.com>
Signed-off-by: Alexandre Begnoche <abegnoche@nvidia.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.
Summary
Adds
SpecifiedKeyAccessCheck(AUTH-XX-03), a provider-neutral "a tenant-specified key can access out-of-band components" check, wired for NICo via thebare_metalsuite. Following the recent NICo-validation pattern (#457/#458/#466). Ships unreleased (released_tests.jsonuntouched); run withISVTEST_INCLUDE_UNRELEASED=1.NICo models a specified key as an SSH Key Group synced to a Site; the Site's serial console (SOL) is key-accessible when the provider enables it (
isSerialConsoleEnabled), SSH-key auth is on (isSerialConsoleSSHKeysEnabled), and a key group is synced to the site. The serial console is the verifiable target; network-device access is provider-managed and reported asnull(unverified) rather than passing vacuously. Key material is never emitted.Two ways to run it:
bare_metal.yaml): reports against whatever keys exist. When nothing is synced to the site it emits a structured skip whose reason distinguishes "no key groups exist at all" from "key groups exist but none synced to this site" (with anorg_key_groupscount), so the operator knows what to configure.key_access.yaml): asetup → test → teardownconfig that provisions an ephemeral SSH key + key group synced to the site, runs the check, then deletes them — so AUTH-XX-03 goes green in CI with no manual key setup. The throwaway private key is generated and discarded immediately; only the unusable public key is registered.Changes
SpecifiedKeyAccessCheck: passes when a specified key can reach ≥1 component, fails when a key-access path is disabled/broken, skips (with a precise reason) when access can't be evidenced.query_key_access.py(read-only) +setup_key_access.py/teardown_key_access.py(provisioning), via the existing/carbide/helpers; addsforge_post/forge_patch/forge_deletetonico_client.suites/bare_metal.yaml+providers/nico/config/bare_metal.yaml; adds the dedicatedproviders/nico/config/key_access.yaml.isvtest/tests/test_key_access.pyand the query/setup/teardown scripts inisvctl/tests/providers/nico/test_nico_provider.py.Testing
make test(full suite, incl. new validation + script tests)make lintmake demo-testuvx pre-commit run -a/carbide/stub — auto-provisioningkey_access.yamlruns setup → check PASS → teardown, and the throwaway key group is removed afterward; read-only skip diagnostics and the disabled-key fail path also verified.auth_xx_03_key_access_provision_e2e.log
auth_xx_03_key_access_e2e.log
Closes #248
To show artifacts inline, enable in settings.