Skip to content

Add NGTS (Strata Cloud Manager) support - VC-54745#198

Open
TomaszSwierszczCA wants to merge 2 commits into
Venafi:masterfrom
TomaszSwierszczCA:ngts-support
Open

Add NGTS (Strata Cloud Manager) support - VC-54745#198
TomaszSwierszczCA wants to merge 2 commits into
Venafi:masterfrom
TomaszSwierszczCA:ngts-support

Conversation

@TomaszSwierszczCA

@TomaszSwierszczCA TomaszSwierszczCA commented Jun 12, 2026

Copy link
Copy Markdown

Add NGTSConnection for Palo Alto Networks Next-Gen Trust Security, a VaaS-derived backend that reuses CloudConnection's outagedetection/v1 REST endpoints but differs in authentication and zone format:

  • Auth: Strata Cloud Manager OAuth2 client-credentials via a service account (client_id/client_secret/tsg_id), sent as a Bearer token and auto-refreshed ahead of the ~15-min expiry, instead of the api-key header.
  • Zone: a Certificate Issuing Template alias only (no Application\CIT split); requests omit applicationId.
  • URLs default to production: both the API base URL and the token URL are optional and fall back to the published Palo Alto production endpoints (api.strata.paloaltonetworks.com/ngts, auth.apps.paloaltonetworks.com/...); only non-production environments need to supply them. Defaulting the token URL is a deliberate divergence from Go (which still requires it).
  • token_url safeguards: because the service-account credentials are exchanged at the token URL via HTTP Basic auth, it is forced to HTTPS, a warning is logged when it falls back to the production default (so a non-prod tenant doesn't silently send credentials to production), and a warning is logged when its host falls outside .paloaltonetworks.com. Both warnings warn rather than block.
  • Scope validation: the scope is anchored to tsg_id:<10-digit TSG ID>.

Wire NGTSConnection into venafi_connection (auto-detected from token_url + client_id + client_secret, or platform=VenafiPlatform.NGTS) and add the VenafiPlatform.NGTS enum and NGTS fields on Authentication.

Add a usage example, live tests (tests/test_ngts.py, gated on NGTS_* env vars) and offline unit tests, and ignore generated cert material.

Add NGTSConnection for Palo Alto Networks Next-Gen Trust Security, a
VaaS-derived backend that reuses CloudConnection's outagedetection/v1
REST endpoints but differs in authentication and zone format:

- Auth: Strata Cloud Manager OAuth2 client-credentials via a service
  account (client_id/client_secret/tsg_id), sent as a Bearer token and
  auto-refreshed ahead of the ~15-min expiry, instead of the api-key
  header.
- Zone: a Certificate Issuing Template alias only (no Application\CIT
  split); requests omit applicationId.
- Base and token URLs are environment-specific and must be supplied
  (no hardcoded default).

Wire NGTSConnection into venafi_connection (auto-detected from
token_url + client_id + client_secret, or platform=VenafiPlatform.NGTS)
and add the VenafiPlatform.NGTS enum and NGTS fields on Authentication.

Add a usage example, live tests (tests/test_ngts.py, gated on NGTS_*
env vars) and offline unit tests, and ignore generated cert material.

@stkomitov stkomitov left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is good to have a README doc similar to the one we have in vcert Go https://github.com/Venafi/vcert/blob/master/README-CLI-NGTS.md

Comment thread vcert/connection_ngts.py Outdated
# path, so neither can be hardcoded - both must be supplied by the caller.
if not url:
raise ClientBadData("NGTS requires the API base URL (it differs per environment)")
if not access_token and not token_url:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make the token_url optional, and if it is not provided use the default token url specified in the Palo docs: https://auth.apps.paloaltonetworks.com/auth/v1/oauth2/access_token
source: https://pan.dev/sase/api/auth/post-auth-v-1-oauth-2-access-token/
Note: This is not implemented in vcert go, but it will be later.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Comment thread vcert/connection_ngts.py Outdated
http_request_kwargs=None):
# The NGTS API base URL and token URL both differ per environment (dev/prod), including the
# path, so neither can be hardcoded - both must be supplied by the caller.
if not url:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lets make the url optional, similar to the vcert Go implementation, if there is no value provided we can use the default one: https://api.sase.paloaltonetworks.com/ngts

@TomaszSwierszczCA TomaszSwierszczCA Jun 16, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Updated to new API url.

… sink

Make url and token_url optional (default to Palo Alto production), so NGTS works
with service-account credentials alone. Since token_url is where credentials are
exchanged, add safeguards: force HTTPS, warn on default fallback, and warn when
the host is outside .paloaltonetworks.com. Also anchor scope validation, simplify
NGTS auto-detection (client_id + client_secret), and add README-NGTS.md.
@TomaszSwierszczCA

Copy link
Copy Markdown
Author

It is good to have a README doc similar to the one we have in vcert Go https://github.com/Venafi/vcert/blob/master/README-CLI-NGTS.md

Readme file added.

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.

2 participants