Repository navigation
ROX-36856: retire Compliance 1.0 REST and gRPC endpoints - #23399
taimurhafeez wants to merge 5 commits into
Conversation
Unregister the v1 ComplianceService and ComplianceManagementService and drop the /api/compliance/export/csv route, making the Compliance 1.0 API surface unreachable. This is the first backend cut; the now-orphaned central/compliance tree is deleted in follow-ups. /api/splunk/ta/compliance is kept as a stub returning 410 Gone rather than being deleted outright. The acceptance criteria require existing Splunk TA Compliance feed configurations to fail closed: a 404 is liable to be retried as transient by a modular input, and an empty 200 would be indexed as "no compliance findings" -- both hide the removal. The stub no longer takes a datastore, which decouples central/splunk from central/compliance so that tree can be removed independently. qa-tests-backend's ComplianceTest exercises only the removed v1 API, so it is deleted along with the service and object classes that became orphaned with it. This change was partially generated with the help of an AI agent. Co-Authored-By: Claude Opus 5
|
Skipping CI for Draft Pull Request. |
🚀 Build Images ReadyImages are ready for commit 1c186dd. To use with deploy scripts: export MAIN_IMAGE_TAG=5.1.x-281-g1c186dd341 |
|
/test all |
The previous CHANGELOG entry pointed Splunk TA users at Compliance v2 as the replacement. That is accurate for the gRPC/REST APIs but misleading for the feed: there is no v2 Splunk feed (RFE-9120 / RFE-6372, out of scope here), so a reader would expect to reconfigure the TA and keep receiving data. This also matters more than it first appears for Compliance Operator users. CO results reach the retired feed through the pre-v2 bridge (central/complianceoperator/manager -> GetMachineConfigs -> compliance domain -> MachineConfigResults in v1 storage), so retiring it stops CO results reaching Splunk even though the Compliance Operator itself is unaffected. Split the entry in two and say outright that no Splunk replacement exists. This change was partially generated with the help of an AI agent. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #23399 +/- ##
==========================================
- Coverage 52.00% 51.96% -0.05%
==========================================
Files 2912 2912
Lines 183385 183273 -112
==========================================
- Hits 95372 95232 -140
- Misses 79684 79705 +21
- Partials 8329 8336 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| - ROX-36856: The Compliance 1.0 API has been removed. The `ComplianceService` and `ComplianceManagementService` gRPC services, their `/v1/compliance/*` REST equivalents, and the `/api/compliance/export/csv` export endpoint are no longer served. Use Compliance (v2), backed by the Compliance Operator, instead. | ||
| - ROX-36856: The Splunk TA Compliance feed at `/api/splunk/ta/compliance` has been retired and now responds with HTTP 410 Gone rather than returning data, so that stale feed configurations fail loudly instead of silently reporting zero compliance findings. Remove the Compliance modular input from your Splunk TA configuration. **There is no Splunk replacement for this feed.** Note that this also affects Compliance Operator results: those were previously routed into Compliance 1.0 storage and surfaced through this feed, and they are no longer delivered to Splunk. Compliance Operator results remain available in the product through Compliance (v2). |
There was a problem hiding this comment.
That's a lot of words. Perhaps we should be more succinct in the CHANGELOG and more wordy in the release notes shipped by the docs team.
|
/test all |
|
/test gke-qa-e2e-tests |
|
/retest |
|
All PipelineRuns for this commit have already succeeded. Use |
|
@taimurhafeez: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Description
First backend cut of Compliance 1.0 removal (ROX-36856). This PR removes the externally reachable Compliance 1.0 API surface; the ~271 files under
central/compliance/are left in place, now unreachable, and are deleted in follow-ups once the compiler can prove it is safe.Removed
ComplianceServiceandComplianceManagementServiceare no longer registered inservicesToRegister(). Becausepkg/grpc.APIServicecarries bothRegisterServiceServerandRegisterServiceHandler, this removes the gRPC services and their grpc-gateway REST equivalents under/v1/compliance/*in one step. Callers now getUnimplemented/ HTTP 501./api/compliance/export/csvcustom route.qa-tests-backend'sComplianceTest(@Tag("BAT")), which exercises only the removed v1 API and would otherwise fail against this change, plus the service/object classes that became orphaned with it.Kept, deliberately:
/api/splunk/ta/compliancenow returns 410 GoneThe acceptance criteria require existing Splunk TA Compliance feed configurations to fail closed. Alternatives considered:
[]🔔 This 410 is a contract with external TA users and is the one decision in this PR that wants explicit sign-off. Happy to change the status code or wording if the Splunk TA owner prefers something else.
The handler also drops its
datastore.DataStoreparameter. That is load-bearing beyond the 410: it severscentral/splunk's compile-time import ofcentral/compliance, which is what allows that tree to be deleted independently in a later PR.Not in this PR: GraphQL resolvers (~1,177 lines + 449 refs in generated code, coupled to proto removal), the
.protodefinitions, thecentral/compliance/tree itself, and the five Compliance 1.0 Postgres tables (GORM AutoMigrate never drops, so those need an explicit migration).resources.Complianceis intentionally untouched — it is shared with Compliance v2 and is a customer-visible permission name.This PR has no file overlap with #23360 and can merge in either order.
Customer impact worth explicit review: Compliance Operator results stop reaching Splunk
This surfaced from a review question about the
ocp4-cis-node-master/MachineConfigResultsfixtures in the deleted test. They are not Compliance v2 data, but tracing them found a real consequence.Compliance Operator results reach this feed through the pre-v2 bridge:
So a customer running the Compliance Operator today, with the TA Compliance modular input enabled, loses that data in Splunk when this merges. They cannot migrate, because there is no v2 Splunk feed (RFE-9120 / RFE-6372, out of scope here). The Compliance Operator itself and Compliance v2 in-product are unaffected; only the Splunk delivery path goes away.
The CHANGELOG now splits the API removal from the feed retirement and states plainly that no Splunk replacement exists, rather than implying v2 covers it. Flagging here so this is a conscious call by the Splunk TA owner and release-notes reviewer, not a surprise.
For the record on the original question: Compliance v2 is fully independent — grepping
central/complianceoperator/v2/for imports ofcentral/compliance/returns zero hits, and v2 has its own storage (checkresults,scans,profiles, ...). Separately, a_test.gofile is only ever compiled into its own package's test binary, so no other package could have depended on the deleted test regardless.User-facing documentation
Downstream docs are tracked by ROX-36856's own Documentation & Release Notes acceptance criterion and will follow separately. CHANGELOG entries are included here under "Removed Features" — one for the API removal, one for the Splunk feed retirement and its Compliance Operator consequence.
Testing and quality
Automated testing
Added a unit test asserting the Splunk endpoint returns 410 with the removal message. This is deliberately a test rather than a bare stub: the fail-closed behavior is an external contract, so a later "tidy-up" to 404 should break the build.
How I validated my change
go build ./...— passgo vet ./...— pass (type-checks_test.gofiles, so the new test compiles)go test -tags test ./central/...— 296 packages pass, 1 fails. The failure iscentral/clusters/zippanicking ininit()viatestutils.MustBeInTest; it reproduces identically on cleanmasteratc4b073da25, so it is pre-existing and unrelated.gofmt— clean/api/compliance/export/csv,complianceHandlers,complianceManagerService,CSV_COLUMN_MAPPING,objects.Control,CsvRow, orComplianceServiceGrpcoutside the tree scheduled for later deletion.Gap I want to be explicit about: I could not compile the Groovy locally —
generateProtofails becausescanner/api/v1/{component,note}.protoare absent fromqa-tests-backend/src/main/proto, so no Java proto classes are generated and everyio.stackrox.proto.*import fails. This reproduces on cleanmaster(199 unresolved-proto errors before my change, 181 after; the delta is exactly the imports in the files I deleted, and zero errors name any file I touched). Confidence in the Groovy deletions therefore rests on grep rather than a compiler. CI is the real check here.🤖 Co-Generated with [Claude Code]