feat(security-posture): implement Security Posture Scoring System (#153)#161
Open
iyanumajekodunmi756 wants to merge 1 commit into
Conversation
- Add SecurityPostureResult, ScoringFactor, PostureSnapshot interfaces - Implement SecurityPostureService with weighted scoring model (5 factors), historical snapshot tracking (capped at 30 entries), grade computation (A-F), and trend detection (improving/stable/degrading) - Expose GET /security-posture and GET /security-posture/history endpoints via SecurityPostureController - Register SecurityPostureModule in AppModule - Add 13 unit tests covering score bounds, grade mapping, factor weights, history immutability, and trend logic Closes MD-Creative-Production#153
Collaborator
|
Hi @iyanumajekodunmi756 , thanks for your contributions, please kindly fix the remaining ci failures, please due ensure the all ci passed successfully. Well done for this effort you have put in so far. |
Collaborator
|
Hi @iyanumajekodunmi756 thank you for fixing some of the errors, please resolve conflict, pull from main and update your branch, fix typescript error and commit again. Well done |
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
Implements the Security Posture Scoring System as specified in issue #153.
Changes
New module:
src/modules/security-posture/interfaces/security-posture.interface.tsScoringFactor,PostureSnapshot,SecurityPostureResulttypessecurity-posture.service.tssecurity-posture.controller.tsGET /security-postureandGET /security-posture/historyendpointssecurity-posture.module.tssecurity-posture.service.spec.tsModified
apps/backend/src/app.module.ts— registersSecurityPostureModuleAcceptance Criteria
SecurityPostureService.getPosture()computes a weighted 0–100 score from 5 factorstrendfield returnsimproving | stable | degradingbased on last two snapshots;GET /security-posture/historyreturns full historyGET /security-posturereturns score, grade (A–F), weighted factors, history, and trendScoring Model
Five weighted factors (weights sum to 1.0):
History is capped at 30 snapshots, seeded with 7 days of synthetic data on first boot.
Tests
Full backend suite: 22/22 passed. Lint and format checks: clean.
Closes #153