Feat/compliance posture#2205
Open
refoo0 wants to merge 6 commits into
Open
Conversation
Signed-off-by: rafi <refaei.shikho@hotmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class “compliance posture” support to DevGuard by introducing a new persisted model, repository/service/controller layers, and HTTP routes, plus new vuln event/state types to support posture lifecycle tracking.
Changes:
- Introduces
FrameworkControl+CompliancePosturemodels and DB migrations to persist compliance controls and posture state. - Adds repository/service/controller + router wiring for listing, reading, stats, and creating posture events across org/project/asset scopes.
- Extends vuln events/types/states and access checks to include compliance posture events.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| transformer/compliance_posture_transformer.go | Maps CompliancePosture model data + events into DTOs. |
| statemachine/dependency_vuln_statemachine.go | Adds handling for new event types to set vuln states. |
| shared/common_interfaces.go | Introduces repository/service interfaces for compliance posture. |
| services/providers.go | Registers the new CompliancePostureService with Fx. |
| services/compliance_posture_service.go | Implements compliance posture service methods (list/stats/read/update state). |
| router/providers.go | Registers the new compliance posture router with Fx. |
| router/project_router.go | Adds project-scoped compliance posture endpoints. |
| router/org_router.go | Adds org-scoped compliance posture endpoints. |
| router/compliance_posture_router.go | Adds asset-version-scoped compliance posture endpoints. |
| dtos/vulnevent_dto.go | Adds compliance posture vuln type + new event types. |
| dtos/dependency_vuln_dto.go | Adds new states used for compliance posture. |
| dtos/comilance_posture_dto.go | Adds DTOs for compliance posture list/details/stats. |
| database/repositories/vulnevent_repository.go | Extends event access checks to include compliance posture events. |
| database/repositories/providers.go | Registers the new compliance posture repository with Fx. |
| database/repositories/compliance_posture_repository.go | Implements posture persistence + scoped lookup/list/stats queries. |
| database/models/vulnevent_model.go | Adds compliance posture FK to events + constructors + status validation. |
| database/models/framework_control_model.go | Adds FrameworkControl model for frameworks_controls table. |
| database/models/compliance_posture_model.go | Adds CompliancePosture model and hashing logic. |
| database/migrations/20260625000001_create_compliance_postures.up.sql | Creates compliance_postures table and extends vuln_events constraints. |
| database/migrations/20260625000000_add_compliance_frameworks_to_policies.up.sql | Creates frameworks_controls table. |
| controllers/providers.go | Registers the new compliance posture controller with Fx. |
| controllers/compliance_posture_controller.go | Implements read/list/stats/event creation endpoints for postures. |
| cmd/devguard/main.go | Invokes the new compliance posture router on startup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: rafi <refaei.shikho@hotmail.com>
Signed-off-by: rafi <refaei.shikho@hotmail.com>
Signed-off-by: rafi <refaei.shikho@hotmail.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.
No description provided.