Skip to content
Snippets Groups Projects
Unverified Commit 45bcd637 authored by Richard Cordovano's avatar Richard Cordovano Committed by GitHub
Browse files

Merge pull request #2220 from raman-bt/4189-account-instance-types

4189: update account instance types.
parents 0a684f3c 4889861f
Branches
Tags
No related merge requests found
......@@ -385,8 +385,12 @@ OsAccountStatus.Deleted.text=Deleted
OsAccountType.Unknown.text=Unknown
OsAccountType.Service.text=Service
OsAccountType.Interactive.text=Interactive
OsAccountInstanceType.PerformedActionOn.text=Account owner performed action on the host.
OsAccountInstanceType.ReferencedOn.text=Account was referenced on on the host.
OsAccountInstanceType.Launched.text=Launched
OsAccountInstanceType.Accessed.text=Accessed
OsAccountInstanceType.Referenced.text=Referenced
OsAccountInstanceType.Launched.descr.text=Account owner launched a program action on the host.
OsAccountInstanceType.Accessed.descr.text=Account owner accessed resources on the host for read/write via some service.
OsAccountInstanceType.Referenced.descr.text=Account owner was referenced in a log file on the host.
OsAccountRealm.Known.text=Known
OsAccountRealm.Inferred.text=Inferred
OsAccountRealm.Unknown.text=Unknown
......
......@@ -385,8 +385,12 @@ OsAccountStatus.Deleted.text=Deleted
OsAccountType.Unknown.text=Unknown
OsAccountType.Service.text=Service
OsAccountType.Interactive.text=Interactive
OsAccountInstanceType.PerformedActionOn.text=Account owner performed action on the host.
OsAccountInstanceType.ReferencedOn.text=Account was referenced on on the host.
OsAccountInstanceType.Launched.text=Launched
OsAccountInstanceType.Accessed.text=Accessed
OsAccountInstanceType.Referenced.text=Referenced
OsAccountInstanceType.Launched.descr.text=Account owner launched a program action on the host.
OsAccountInstanceType.Accessed.descr.text=Account owner accessed resources on the host for read/write via some service.
OsAccountInstanceType.Referenced.descr.text=Account owner was referenced in a log file on the host.
OsAccountRealm.Known.text=Known
OsAccountRealm.Inferred.text=Inferred
OsAccountRealm.Unknown.text=Unknown
......
......@@ -213,15 +213,18 @@ public static OsAccountType fromID(int typeId) {
* just a reference to it was found on the host (such as in a log file)
*/
public enum OsAccountInstanceType {
PERFORMED_ACTION_ON(0, bundle.getString("OsAccountInstanceType.PerformedActionOn.text")), // the user performed actions on a host
REFERENCED_ON(1, bundle.getString("OsAccountInstanceType.ReferencedOn.text") ); // user was simply referenced on a host
LAUNCHED(0, bundle.getString("OsAccountInstanceType.Launched.text"), bundle.getString("OsAccountInstanceType.Launched.descr.text")), // the user launched a program on the host
ACCESSED(1, bundle.getString("OsAccountInstanceType.Accessed.text"), bundle.getString("OsAccountInstanceType.Accessed.descr.text")), // user accesed a resource for read/write
REFERENCED(2, bundle.getString("OsAccountInstanceType.Referenced.text"), bundle.getString("OsAccountInstanceType.Referenced.descr.text") ); // user was referenced, e.g. in a event log.
private final int id;
private final String name;
private final String description;
OsAccountInstanceType(int id, String name) {
OsAccountInstanceType(int id, String name, String description) {
this.id = id;
this.name = name;
this.description = description ;
}
/**
......@@ -242,6 +245,15 @@ public String getName() {
return name;
}
/**
* Get account instance type description.
*
* @return Account instance type description.
*/
public String getDescription() {
return description;
}
/**
* Gets account instance type enum from id.
*
......
......@@ -567,15 +567,15 @@ public void osAccountInstanceTests() throws TskCoreException {
OsAccount osAccount1 = caseDB.getOsAccountManager().createWindowsAccount(ownerUid1, null, realmName1, host1, OsAccountRealm.RealmScope.LOCAL);
// Test: add an instance
caseDB.getOsAccountManager().createOsAccountInstance(osAccount1, host1, image, OsAccount.OsAccountInstanceType.PERFORMED_ACTION_ON);
caseDB.getOsAccountManager().createOsAccountInstance(osAccount1, host1, image, OsAccount.OsAccountInstanceType.LAUNCHED);
// Test: add an existing instance - should be a no-op.
caseDB.getOsAccountManager().createOsAccountInstance(osAccount1, host1, image, OsAccount.OsAccountInstanceType.PERFORMED_ACTION_ON);
caseDB.getOsAccountManager().createOsAccountInstance(osAccount1, host1, image, OsAccount.OsAccountInstanceType.LAUNCHED);
// Test: create account instance on a new host
String hostname2 = "host2222";
Host host2 = caseDB.getHostManager().createHost(hostname2);
caseDB.getOsAccountManager().createOsAccountInstance(osAccount1, host2, image, OsAccount.OsAccountInstanceType.REFERENCED_ON);
caseDB.getOsAccountManager().createOsAccountInstance(osAccount1, host2, image, OsAccount.OsAccountInstanceType.REFERENCED);
List<OsAccountAttribute> accountAttributes = new ArrayList<>();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment