Skip to content

Commit 5418a01

Browse files
committed
Merge branch 'iam_rework'
2 parents 80e47b6 + bee4547 commit 5418a01

File tree

3 files changed

+63
-93
lines changed

3 files changed

+63
-93
lines changed

src/main/mal/coreLang.mal

Lines changed: 51 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,8 @@ category ComputeResources {
6565
| fullAccess {C,I,A}
6666
user info: "Full access on a system allows the compromise or legitimate access on everything/all the privillges of the system: identities, applications, data, etc."
6767
-> sysExecutedApps.fullAccess,
68-
highPrivSysIds.assume,
69-
lowPrivSysIds.assume,
70-
highPrivSysGroups.compromiseGroup,
71-
lowPrivSysGroups.compromiseGroup,
68+
highPrivSysIAMs.attemptAssume,
69+
lowPrivSysIAMs.attemptAssume,
7270
sysData.attemptAccess
7371

7472
& specificAccess
@@ -293,8 +291,7 @@ category ComputeResources {
293291
modify,
294292
deny,
295293
appExecutedApps.fullAccess, // Gain access on all applications executed by this (host) application
296-
executionPrivIds.assume, // Assume also the execution privilege identities of this application
297-
executionPrivGroups.compromiseGroup,
294+
executionPrivIAMs.attemptAssume, // Assume also the execution privilege identities of this application
298295
containedData.attemptAccess, // and access on all the contained data
299296
sentData.attemptRead, // Both Data sent and received can be read
300297
receivedData.attemptRead,
@@ -743,78 +740,70 @@ category DataResources {
743740

744741
category IAM {
745742

746-
asset Identity
747-
user info: "An identity models an IAM identity that should then be associated with privileges on other instances."
748-
developer info: "An identity can be visualised as a group of assumable roles that can be associated with many credentials."
743+
abstract asset IAMObject
744+
user info: "An IAM object represents the base logic shared by all assets used for Identity and Access Management roles(Identity, Group, Privileges)."
749745
{
750746
# disabled [Disabled]
751-
user info: "It should be used to model the probability that the identity is actually not existing."
747+
user info: "It should be used to model the probability that the IAM object does not actually exist."
752748
-> successfulAssume
753749

754750
| attemptAssume
755-
user info: "Attempt to assume the identity."
751+
user info: "Attempt to assume the privileges associated with the IAM object. If disabled this will not be possible."
756752
-> successfulAssume
757753

758754
& successfulAssume @hidden
759-
developer info: "Intermediate attack step to model the requirements for identity assume."
755+
developer info: "Intermediate attack step to model the requirements for the assume attack step."
760756
-> assume
761757

762-
| assume {C,I,A}
763-
user info: "After authentication or compromise of an account/identity, assume its privileges."
764-
developer info: "This is both legitimate and illegitimate access! Also assume all the privileges of the parent identities (on the above level/inherited by this identity) because those represent the group of (inherited) roles."
765-
-> parentId.assume,
766-
memberOf.compromiseGroup,
767-
identityPrivileges.attemptAssume,
768-
lowPrivManagedSystems.individualPrivilegeAuthenticate,
769-
highPrivManagedSystems.allPrivilegeAuthenticate,
770-
execPrivApps.authenticate,
758+
| assume
759+
user info: "When an attacker is able to assume an IAM asset the privileges associated with it can always be exploited, other behaviour is asset specific."
760+
-> execPrivApps.authenticate,
771761
highPrivApps.authenticate,
772762
lowPrivApps.specificAccessAuthenticate,
773763
readPrivData.identityAttemptRead,
774764
writePrivData.identityAttemptWrite,
775-
deletePrivData.identityAttemptDelete
765+
deletePrivData.identityAttemptDelete,
766+
lowPrivManagedSystems.individualPrivilegeAuthenticate,
767+
highPrivManagedSystems.allPrivilegeAuthenticate,
768+
managedIAMs.attemptAssume
776769
}
777770

778-
asset Privileges
779-
user info: "A privileges asset can be associated with an identity to group a set of given privileges on Applications and Data."
771+
asset Identity extends IAMObject
772+
user info: "An identity models an IAM identity that should then be associated with privileges on other instances."
773+
developer info: "An identity can be visualised as a group of assumable roles that can be associated with many credentials."
780774
{
781-
# disabled [Disabled]
782-
user info: "It should be used to model the probability that the set of privileges is actually not existing."
783-
-> assume
784-
785-
| attemptAssume
786-
user info: "Attempt to assume the privileges. If disabled this will not be possible."
787-
-> assume
775+
| assume @Override {C,I,A}
776+
user info: "After authentication or compromise of an account/identity, assume its privileges."
777+
developer info: "This is both legitimate and illegitimate access! Also assume all the privileges of the parent identities (on the above level/inherited by this identity) because those represent the group of (inherited) roles."
778+
+> parentId.attemptAssume,
779+
memberOf.attemptAssume,
780+
identityPrivileges.attemptAssume
781+
}
788782

789-
& assume
790-
-> execPrivApps.authenticate,
791-
highPrivApps.authenticate,
792-
lowPrivApps.specificAccessAuthenticate,
793-
readPrivData.identityAttemptRead,
794-
writePrivData.identityAttemptWrite,
795-
deletePrivData.identityAttemptDelete
783+
asset Privileges extends IAMObject
784+
user info: "A privileges asset can be associated with an identity to group a set of given privileges on Applications and Data."
785+
{
786+
| assume @Override {C,I,A}
787+
user info: "After authentication or compromise of an account/identity, assume its privileges."
788+
developer info: "Assume identity/group the privileges are associated with since the privileges are simply an extension of it."
789+
+> privilegeIdentities.attemptAssume,
790+
privilegeGroups.attemptAssume
796791
}
797792

798-
asset Group
793+
asset Group extends IAMObject
799794
user info: "A group is a way to group together identities and/or groups. This allows the expression of hierarchical IAM (structured inheritance)."
800795
modeler info: "Groups can be used instead of nested identities to make the model more intuitive and clearer to understand."
801796
{
802-
| compromiseGroup {C}
797+
| assume @Override {C,I,A}
803798
user info: "If an identity of a group is compromised then the whole group (i.e. all other privileges of the group) should be considered as compromised. Furthermore, the parent groups should also be considered compromised."
804799
developer info: "The parent groups should be compromised because all the privileges of the parent groups are inherited on the children groups but lower children groups should not be compromised because lower levels might have inherited plus additional privileges."
805-
-> parentGroup.compromiseGroup,
806-
lowPrivManagedSystems.individualPrivilegeAuthenticate,
807-
highPrivManagedSystems.allPrivilegeAuthenticate,
808-
execPrivApps.authenticate,
809-
highPrivApps.authenticate,
810-
lowPrivApps.specificAccessAuthenticate,
811-
readPrivData.identityAttemptRead,
812-
writePrivData.identityAttemptWrite,
813-
deletePrivData.identityAttemptDelete
800+
+> parentGroup.attemptAssume,
801+
groupPrivileges.attemptAssume
814802
}
815803

816804
asset Credentials extends Information
817-
user info: "A credential is used to get access as an Identity but it can also be used as an encryption key for Data."
805+
user info: "Credentials can be used to get access to an Identity, but they can also be used as an encryption/signing key for Data."
806+
modeler info: "Credentials represent a variety of access control mechanism(e.g. username and password pair, keycards, biometric data)."
818807
{
819808
# notDisclosed [Enabled]
820809
user info: "Describes the case where the password/credential is leaked to some location, it can then be available to the attacker."
@@ -1265,44 +1254,25 @@ associations {
12651254
Group [memberOf] * <-- MemberOf --> * [groupIds] Identity
12661255
Group [parentGroup] * <-- MemberOf --> * [childGroups] Group
12671256
// First on system level
1268-
Identity [highPrivSysIds] * <-- HighPrivilegeAccess --> * [highPrivManagedSystems] System
1257+
IAMObject [highPrivSysIAMs] * <-- HighPrivilegeAccess --> * [highPrivManagedSystems] System
12691258
user info: "High privilege access on a System results in the compromise of all the privileges assigned to that system."
1270-
Identity [lowPrivSysIds] * <-- LowPrivilegeAccess --> * [lowPrivManagedSystems] System
1271-
user info: "Low privilege access on a System provides individual identity access on the system."
1272-
// And the same for Groups
1273-
Group [highPrivSysGroups] * <-- HighPrivilegeAccess --> * [highPrivManagedSystems] System
1274-
user info: "High privilege access on a System results in the compromise of all the privileges assigned to that system."
1275-
Group [lowPrivSysGroups] * <-- LowPrivilegeAccess --> * [lowPrivManagedSystems] System
1259+
IAMObject [lowPrivSysIAMs] * <-- LowPrivilegeAccess --> * [lowPrivManagedSystems] System
12761260
user info: "Low privilege access on a System provides individual identity access on the system."
12771261
// Then, Access Control on application level
1278-
Identity [executionPrivIds] * <-- ExecutionPrivilegeAccess --> * [execPrivApps] Application
1262+
IAMObject [executionPrivIAMs] * <-- ExecutionPrivilegeAccess --> * [execPrivApps] Application
12791263
user info: "Every application executes on a system with privileges of a specified identity on the system. If the application is compromised then the privileges should be compromised."
1280-
Identity [highPrivAppIds] * <-- HighPrivilegeApplicationAccess --> * [highPrivApps] Application
1264+
IAMObject [highPrivAppIAMs] * <-- HighPrivilegeApplicationAccess --> * [highPrivApps] Application
12811265
user info: "High privilege application access on an Application results in the (full) access/compromise of the application and all the child applications."
1282-
Identity [lowPrivAppIds] * <-- LowPrivilegeApplicationAccess --> * [lowPrivApps] Application
1266+
IAMObject [lowPrivAppIAMs] * <-- LowPrivilegeApplicationAccess --> * [lowPrivApps] Application
12831267
user info: "Low privilege application access on an Application allows only the local interaction with the application and all the specified privileges."
1284-
// And the same for Groups
1285-
Group [executionPrivGroups] * <-- ExecutionPrivilegeAccess --> * [execPrivApps] Application
1286-
user info: "An application can execute on a system with privileges of a specified group. If the application is compromised then the group privileges should be compromised."
1287-
Group [highPrivAppGroups] * <-- HighPrivilegeApplicationAccess --> * [highPrivApps] Application
1288-
user info: "High privilege application access on an Application results in the compromise of all the child applications."
1289-
Group [lowPrivAppGroups] * <-- LowPrivilegeApplicationAccess --> * [lowPrivApps] Application
1290-
user info: "Low privilege application access on an Application allows only the local interaction with the application."
12911268
// Finally, Access control on data
1292-
Identity [readingIds] * <-- ReadPrivileges --> * [readPrivData] Data
1293-
Identity [writingIds] * <-- WritePrivileges --> * [writePrivData] Data
1294-
Identity [deletingIds] * <-- DeletePrivileges --> * [deletePrivData] Data
1295-
// And again for Groups
1296-
Group [readingGroups] * <-- ReadPrivileges --> * [readPrivData] Data
1297-
Group [writingGroups] * <-- WritePrivileges --> * [writePrivData] Data
1298-
Group [deletingGroups] * <-- DeletePrivileges --> * [deletePrivData] Data
1269+
IAMObject [readingIAMs] * <-- ReadPrivileges --> * [readPrivData] Data
1270+
IAMObject [writingIAMs] * <-- WritePrivileges --> * [writePrivData] Data
1271+
IAMObject [deletingIAMs] * <-- DeletePrivileges --> * [deletePrivData] Data
12991272
// Associations for the Privileges asset
13001273
Identity [privilegeIdentities] * <-- HasPrivileges --> * [identityPrivileges] Privileges
1301-
user info: "Any Identity can be associated with a Privileges asset that groups privileges for Applications and Data."
1302-
Privileges [executionPrivAppPriv] * <-- ExecutionPrivilegeAccess --> * [execPrivApps] Application
1303-
Privileges [highPrivAppPriv] * <-- HighPrivilegeApplicationAccess --> * [highPrivApps] Application
1304-
Privileges [lowPrivAppPriv] * <-- LowPrivilegeApplicationAccess --> * [lowPrivApps] Application
1305-
Privileges [readingPriv] * <-- ReadPrivileges --> * [readPrivData] Data
1306-
Privileges [writingPriv] * <-- WritePrivileges --> * [writePrivData] Data
1307-
Privileges [deletingPriv] * <-- DeletePrivileges --> * [deletePrivData] Data
1274+
Group [privilegeGroups] * <-- HasPrivileges --> * [groupPrivileges] Privileges
1275+
user info: "Identities, Groups, and Privileges may have account management roles for other Identities, Groups, and Privileges."
1276+
IAMObject [managers] * <-- AccountManagement --> * [managedIAMs] IAMObject
1277+
13081278
}

src/test/java/org/mal_lang/corelang/test/HierarchicalGroupTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public HierarchicalGroupTestModel() {
1818
}
1919

2020
public void addAttacker(Attacker attacker) {
21-
attacker.addAttackPoint(subGroupA.compromiseGroup);
21+
attacker.addAttackPoint(subGroupA.assume);
2222
}
2323
}
2424

@@ -31,9 +31,9 @@ public void testNestedGroups() {
3131
model.addAttacker(attacker);
3232
attacker.attack();
3333

34-
model.subsubGroupB.compromiseGroup.assertUncompromised();
35-
model.subGroupA.compromiseGroup.assertCompromisedInstantaneously();
36-
model.superGroup.compromiseGroup.assertCompromisedInstantaneously();
34+
model.subsubGroupB.assume.assertUncompromised();
35+
model.subGroupA.assume.assertCompromisedInstantaneously();
36+
model.superGroup.assume.assertCompromisedInstantaneously();
3737
}
3838

3939
}

src/test/java/org/mal_lang/corelang/test/IAMIntegrationTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ public class IAMIntegrationTestModel {
2323

2424
public IAMIntegrationTestModel() {
2525
// Create associations
26-
rhel.addLowPrivAppIds(rhel_luser);
27-
rhel.addHighPrivAppIds(rhel_oracle);
28-
rhel.addHighPrivAppIds(rhel_root);
29-
oracle.addExecutionPrivIds(rhel_oracle);
30-
oracle.addHighPrivAppIds(oracle_dba);
26+
rhel.addLowPrivAppIAMs(rhel_luser);
27+
rhel.addHighPrivAppIAMs(rhel_oracle);
28+
rhel.addHighPrivAppIAMs(rhel_root);
29+
oracle.addExecutionPrivIAMs(rhel_oracle);
30+
oracle.addHighPrivAppIAMs(oracle_dba);
3131
rhel_oracle.addUsers(dba_user);
3232
rhel_root.addUsers(root_user);
3333
server.addSysExecutedApps(rhel);
@@ -36,8 +36,8 @@ public IAMIntegrationTestModel() {
3636
oracle.addContainedData(db);
3737
db.addContainedData(table1);
3838
db.addContainedData(table2);
39-
table1.addReadingIds(oracle_analyst);
40-
table1.addWritingIds(oracle_analyst);
39+
table1.addReadingIAMs(oracle_analyst);
40+
table1.addWritingIAMs(oracle_analyst);
4141
oracle.addVulnerabilities(vuln);
4242
}
4343

@@ -90,7 +90,7 @@ public IdentityDataTestModel() {
9090
// Create associations
9191
network.addApplications(application);
9292
application.addContainedData(data);
93-
data.addReadingIds(identity);
93+
data.addReadingIAMs(identity);
9494
}
9595

9696
public void addAttacker(Attacker attacker) {

0 commit comments

Comments
 (0)