feat: gate Splunk Cloud writes behind two explicit opt-ins - #84
Open
JacobPEvans-personal wants to merge 1 commit into
Open
feat: gate Splunk Cloud writes behind two explicit opt-ins#84JacobPEvans-personal wants to merge 1 commit into
JacobPEvans-personal wants to merge 1 commit into
Conversation
This was referenced Aug 18, 2026
Draft
Adds create/update/delete for index, role, and hec-token via Splunk Cloud ACS. Every real write, on any backend, now requires SPLUNK_ENABLE_WRITES=true (never a CLI flag, so a saved command line cannot enable one); a Cloud write additionally requires SPLUNK_CLOUD_WRITE=true, checked even for a --dry-run preview since it also proves the object is one of the three ACS-writable resources. --dry-run itself needs neither variable and sends nothing. Adds a Splunk Cloud Write Canary GitHub Actions workflow: workflow_dispatch only, a typed confirm=WRITE input, a commit-subject check, and a protected splunk-cloud-write environment with required reviewers gating the destructive half. It runs the Cloud read canary first, so one approved dispatch is the full read-then-write certification.
JacobPEvans-personal
force-pushed
the
feat/cloud-writes
branch
from
August 18, 2026 13:29
9919e00 to
f09b904
Compare
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
Second of a 3-PR stack replacing #80 (stacked on #83).
create/update/deleteforindex,role, andhec-tokenvia Splunk Cloud ACS.--dry-run) write, on any backend, now requiresSPLUNK_ENABLE_WRITES=true. Never a CLI flag, so a saved command line cannot enable one. This is a breaking change for existing Enterprise write callers.SPLUNK_CLOUD_WRITE=true, and only unlocks the three ACS-writable resources -- enable/disable and every other resource stay refused regardless. This check is enforced even for a--dry-runpreview, since it also proves the object is one of the three ACS-writable resources.--dry-runitself needs neither variable and sends nothing, on either backend.SPLUNK_ACS_WRITE_TOKENcan scope the write auth apart from the read token.Splunk Cloud Write CanaryGitHub Actions workflow:workflow_dispatchonly, a typedconfirm=WRITEinput, atests: splunk cloud writeHEAD commit-subject requirement, and a protectedsplunk-cloud-writeenvironment with required reviewers gating the destructive half. It runs the Cloud read canary first, so one approved dispatch is the full read-then-write end-to-end check. With no secrets configured it stops and runs nothing.WRITABLEtable plus onecloud_write()function.Test plan
ruff check .,ruff format --check .,pyright,pytest(1251 passed) all green locallypre-commit run --all-filesand the pre-push stage (adds pytest) both greentests/unit/test_write_gating.py: every write leaf refuses withoutSPLUNK_ENABLE_WRITESon Enterprise; every write leaf refuses on Cloud withoutSPLUNK_CLOUD_WRITE; the nine ACS-writable leaves reach a mocked ACS transport once opted in; everything else stays refused even when opted in;--dry-runneeds neither variable on Enterprisesplunk-cloud-writeGitHub Environment with required reviewers, and its secrets (SPLUNK_URL,SPLUNK_ACS_WRITE_TOKEN,SPLUNK_ACS_STACK, optionalSPLUNK_ACS_BASE_URL,SPLUNK_TOKEN), once readyvct_ci_*object is left over