Injector contract expectation field format change
- Introduced in:
OpenAEV [MigrationVersion]
Description of changes
Starting with OpenAEV [MigrationVersion], the expectation field structure inside injector_contract_content has changed.
Removed: predefinedExpectations list
The separate predefinedExpectations list on the expectation contract field has been removed. All expectations — predefined or not — are now unified under a single availableExpectations list.
Each expectation item now carries an expectation_is_predefined flag indicating whether it was previously in the predefinedExpectations list.
Before
{
"key": "expectations",
"predefinedExpectations": [
{ "expectation_type": "DETECTION", "expectation_name": "Detection", "..." : "..." },
{ "expectation_type": "PREVENTION", "expectation_name": "Prevention", "..." : "..." }
],
"availableExpectations": [
{ "expectation_type": "MANUAL", "expectation_name": "Manual", "..." : "..." }
]
}
After
{
"key": "expectations",
"availableExpectations": [
{ "expectation_type": "DETECTION", "expectation_name": "Detection", "expectation_is_predefined": true, "..." : "..." },
{ "expectation_type": "PREVENTION", "expectation_name": "Prevention", "expectation_is_predefined": true, "..." : "..." },
{ "expectation_type": "MANUAL", "expectation_name": "Manual", "expectation_is_predefined": false, "..." : "..." }
]
}
Impact
- Import/export: JSON exports from older versions containing
predefinedExpectationsare handled transparently by a backward-compatible import (sanity check inThreatArsenalImportService). - Custom integrations: Any external tool or script that reads or writes
predefinedExpectationsininjector_contract_contentmust migrate toavailableExpectationswith theexpectation_is_predefinedflag. - Database: A Flyway migration automatically merges existing
predefinedExpectationsintoavailableExpectations— no manual action required.
Migration guide
- Upgrade OpenAEV to the target version. The Flyway migration will:
- Merge items from
predefinedExpectationsintoavailableExpectationswithexpectation_is_predefined: true. - Remove the
predefinedExpectationsfield from all stored contracts.
- Merge items from
- If you have external scripts or integrations that read or write
predefinedExpectations, update them to useavailableExpectationsand check theexpectation_is_predefinedflag.
Warning
The predefinedExpectations field is no longer written. Re-importing old exports works (backward compatible), but re-exporting will use the new format only.
Validation checklist after upgrade
- Verify existing injector contracts display their expectations correctly in the UI.
- Create a new Threat Arsenal action and confirm the stored
injector_contract_contenthas nopredefinedExpectationsfield and all expectations are underavailableExpectations. - Import an old Threat Arsenal export and verify expectations are correctly migrated (formerly predefined expectations appear with
expectation_is_predefined: true).