feat(validation): add CRUD endpoints for validation bypass rules#481
Open
seansica wants to merge 3 commits into
Open
feat(validation): add CRUD endpoints for validation bypass rules#481seansica wants to merge 3 commits into
seansica wants to merge 3 commits into
Conversation
- added put endpoint and completed controller/service/repo implementations - wired up the routes in validation-bypasses-routes - added openapi tag/path/schema coverage - added regression tests - verified regression tests passing and linting successful
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## next #481 +/- ##
==========================================
+ Coverage 69.15% 69.66% +0.51%
==========================================
Files 220 220
Lines 30832 31102 +270
Branches 2676 2765 +89
==========================================
+ Hits 21321 21667 +346
+ Misses 9474 9395 -79
- Partials 37 40 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Add dynamic MITRE identity write configuration and protected identity safeguards. Expose identity allowed values and cover the new behavior in API tests.
Refactor identity create, update, and delete behavior into lifecycle hooks. Wire delete lifecycle hooks through BaseService so protected MITRE identity checks apply to DELETE requests.
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.
This PR includes two changes, both of which are complementary to mitre-attack/attack-workbench-frontend#876
(1) Adds CRUD endpoints for validation bypass rules
validation-bypasses-routes.jsThese make it possible to manage the ADM validation bypass rules. Currently they get loaded at runtime via a server-side JSON-based config file. Now, they can be dynamically managed by clients w/o having to restart the server.
Closes #480
(2) Overhaul the identity service
mitre_identity_writes_enabled: bool, in thesystemconfigurationscollection entities.mitre_identity_writes_enabledkey:{GET,POST} /api/config/mitre-identity-writesmitre_identity_writes_enabledkey acts as a guard for the MITRE identity object. The REST API will block POST, UPDATE, and DELETE requests for the MITRE identity object when writes are disabled (set tofalse). The server will return 400 Bad Request with messageCannot create, update, or delete protected MITRE identity identity--c78cb6e5-0c4b-4611-8297-d1b8b55e40b5. Enable MITRE identity writes to modify this identity.allowed-values.jsonto support new form fields for identity objects. These correspond to supported values in the official identitySchema