abs2gal type inheritance bugs
Issues with the handling of inheritance:
Error with the typing in expressions
In a system with typesItemLoc{} AssetType Attacker extends ItemLoc{} AssetType Zone extends ItemLoc{} AssetType Item {}
with Aspect AssetTypeAspect Item { reference loc : ItemLoc }
and assets
Asset z1 : Zone {} Asset att1 : Attacker {} Asset item : Item {}
item.loc == z1 is translated the same way as item.loc == att1 in a goal's precondition
Fix: value2expr conversion should properly handle the type of assets
Actions on collections does not work properly with inheritance
In a system with typesAssetType Attacker{ } AssetType OS { reference runsOn : Machine[1] } AssetType Machine { reference exploitedBy : OS[1] } AssetType Server extends (Machine) { } AssetType PC extends (Machine) { } AssetType Account { reference validFor : OS[0..1] }
and aspect
AssetTypeAspect Attacker { reference compromizedMachine : Machine[*] default [] }
the action attacker.compromizedMachine.add(account.validFor.runsOn); does not work if the runtime type of account.validFor.runsOn is Server or OS.
abs2gal even throws a NPE if there are no assets of proper type Machine (i.e. only PCs and Servers)
Fix: add (and other actions on collections) should handle subtypes correctly