nc2-iam-preflight
Before you onboard Nutanix Cloud Clusters (NC2), ask the cloud itself which permissions you're missing.
A checklist says "you need Contributor". This tells you "you are missing
Microsoft.Authorization/roleAssignments/write; ask for User Access Administrator on subscription X", and it
tells you before the onboarding wizard fails, not after.
Status: untested against live clouds. The logic is covered by offline tests (16, all passing) against recorded response shapes. It has not yet been run in a real AWS, Azure or Google Cloud account.
Run it
Open the cloud's own shell, signed in as the person who will do the onboarding, then:
pip install nc2-iam-preflight
nc2-iam-preflight aws
nc2-iam-preflight azure --subscription <SUBSCRIPTION_ID> [--app-id <NC2_APP_ID>]
nc2-iam-preflight gcp --project <PROJECT_ID> [--console-sa <EMAIL>] [--nodes-sa <EMAIL>]
Without installing, from a clone: git clone https://github.com/cloudlabworks/nc2-iam-preflight && cd nc2-iam-preflight,
then python3 -m nc2_iam_preflight aws (same arguments).
Add --json for machine-readable output. Exit code 0 = nothing missing, 1 = something MISSING,
2 = something BLOCKED or not evaluable.
It is read-only: it calls each cloud's permission evaluator and reads IAM. It never creates, grants or deletes anything. Python 3.9+, standard library only, plus the CLI every cloud shell already has.
Why not a utility VM: an IAM check has to run as you. A VM runs as its own identity and would report what the VM may do, not what you lack.
What it checks
| Cloud | A. Can I onboard? (you) | B. Does what I built match the guide? |
|---|---|---|
| AWS | iam simulate-principal-policy on your own principal for the CloudFormation + IAM actions the NC2 stack needs. SCP and permission-boundary denials are reported as BLOCKED, separately from MISSING. SSO / assumed-role sessions are mapped to the underlying role ARN. |
Whether Nutanix-Clusters-High-Nc2-Cluster-Role-Prod and …-Orchestrator-Role-Prod already exist. |
| Azure | Can you register an app in Entra ID (tenant setting or directory role)? Do you hold roleDefinitions/write and roleAssignments/write on the subscription, via the effective-permissions API? Contributor lacks the latter; that is the most common failure. |
With --app-id: the app's role assignments against every action and data action in Nutanix's nc2-custom-role. |
| Google Cloud | testIamPermissions for each setup step (enable the Compute Engine API, create custom roles, service accounts and keys, grant roles), plus the org policies no IAM grant can fix: iam.disableServiceAccountKeyCreation and compute.vmCanIpForward. |
With --console-sa / --nodes-sa: the roles bound to each service account against Nutanix's 98 / 23 permissions. |
Statuses: HAVE, MISSING (an IAM grant fixes it), BLOCKED (a policy above IAM denies it; an org admin has to change it), UNKNOWN (couldn't evaluate; never counted as a pass), INFO.
Where the permission lists come from
Only public sources. Nothing here comes from customer-authenticated material.
| File | Origin | Source |
|---|---|---|
nc2_iam_preflight/permissions/gcp-console-sa.json, gcp-nodes-sa.json |
Nutanix | NC2 on Google Cloud Deployment and User Guide, Appendix: Google Cloud Service Accounts Role Permissions |
nc2_iam_preflight/permissions/azure-nc2-app.json |
Nutanix | NC2 on Azure guide, Creating an Azure Custom Role |
nc2_iam_preflight/permissions/aws-onboarding-user-doc.json |
Nutanix | NC2 on AWS guide, Requirements for NC2 on AWS (names IAMFullAccess + AWSCloudFormationFullAccess and CreateRole) |
Setup-step lists in nc2_iam_preflight/__init__.py (AWS_SETUP_ACTIONS, AZ_SETUP_ACTIONS, GCP_SETUP) |
Derived | Each documented setup step mapped to the cloud vendor's permission for that operation. Labelled as derived in the code. |
Each JSON file records its source URL, the doc's Last Updated date and when it was fetched. To refresh:
node tools/fetch-sources.mjs # snapshots the public pages into sources/ (git-ignored)
python3 tools/extract-permissions.py # rebuilds nc2_iam_preflight/permissions/*.json; fails if a list parses shorter than the doc states
Doc note (2026-10-08): the Google Cloud appendix says the NC2 console service account needs "97
permissions" and then lists 98 distinct ones. The copy-paste gcloud iam roles create command in the guide
has the same 98. This tool checks all 98 and records the stated count alongside.
Known limits
- Azure: deny assignments aren't visible to the effective-permissions API, so an action shown as HAVE can still be blocked by one.
- Google Cloud, check B: counts only direct project-level bindings. Roles granted at folder/org level, through groups, or with conditions aren't counted, so a MISSING there may be a false alarm (the report says so).
- AWS: the setup action list is derived. If your organisation customises the NC2 CloudFormation template, the actions it needs may differ.
Tests
python3 -m unittest discover -s tests -v
Offline: every cloud call is faked. They prove the matching and classification logic, not live behaviour.
Disclaimer
Independent, personal project. Not a Nutanix product, not endorsed or supported by Nutanix. Permission lists come from Nutanix's public documentation and may lag it; the documentation is the authority. Issues and corrections welcome, especially output from a real run.
MIT licence, see LICENSE.
Metadata
Release files for nc2-iam-preflight 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nc2_iam_preflight-0.1.0.tar.gz | 23.2 kB | With provenance | Details for nc2_iam_preflight-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nc2_iam_preflight-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for nc2_iam_preflight-0.1.0-py3-none-any.whl |
Total release size: 39.6 kB
Release files / nc2_iam_preflight-0.1.0.tar.gz
| Download URL | nc2_iam_preflight-0.1.0.tar.gz |
|---|---|
| Size | 23.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2b6facb7cc7cb1180fa28958ab87a5054c2eb8d88c799371c003eb10248219db
|
|
BLAKE2b-256 checksum How to use checksums |
734b05954452f0d7d1428bbeb4729c48b564a8b478bf3d1fc3eaad077d1caf8d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logRelease files / nc2_iam_preflight-0.1.0-py3-none-any.whl
| Download URL | nc2_iam_preflight-0.1.0-py3-none-any.whl |
|---|---|
| Size | 16.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c654ee0a056c07145b4357e557d3b81ee6129603c1f719d5861dea2338d6e5d
|
|
BLAKE2b-256 checksum How to use checksums |
0f85ff7eeae055da11f930f3af54d4f48351c43cdd663d58ea9aa62d6acdc8c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logSecurity for nc2-iam-preflight 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for nc2_iam_preflight-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.