From 9aefb21a0639a292b8b145d63c859f3073ffdbb7 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 9 Jun 2020 10:20:18 -0400 Subject: [PATCH 1/4] 6398 setName -> setPersonaName --- .../autopsy/centralrepository/persona/PersonaDetailsPanel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java index fe09684ff1..b9d2845e08 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java @@ -713,7 +713,7 @@ public final class PersonaDetailsPanel extends javax.swing.JPanel { initializeFields(); } - public void setName(String name) { + public void setPersonaName(String name) { nameField.setText(name); } From fb4005bed2162e8b861b3def535aadcdaad18e2c Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 9 Jun 2020 10:30:13 -0400 Subject: [PATCH 2/4] 6398 remove setPersonaName --- .../centralrepository/persona/PersonaDetailsPanel.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java index b9d2845e08..a7c76b7ad4 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/persona/PersonaDetailsPanel.java @@ -712,10 +712,6 @@ public final class PersonaDetailsPanel extends javax.swing.JPanel { } initializeFields(); } - - public void setPersonaName(String name) { - nameField.setText(name); - } @Messages({ "PersonaDetailsPanel_NotEnoughAccounts_msg=A persona needs at least one account", From 64630ef752aff5a0053b7b5ce43bd5c83164da36 Mon Sep 17 00:00:00 2001 From: Raman Arora Date: Tue, 9 Jun 2020 14:47:35 -0400 Subject: [PATCH 3/4] 6450: Remove auto-generation of personas --- .../eventlisteners/IngestEventsListener.java | 91 +------------------ 1 file changed, 1 insertion(+), 90 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java index 204aa502ac..d399fe4614 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/eventlisteners/IngestEventsListener.java @@ -342,94 +342,7 @@ public class IngestEventsListener { dbManager = db; event = evt; } - - /** - * Automatically creates personas from all the TSK_CONTACT artifacts - * found in a data source. - * - * @param dataSource Data source that was just analyzed. - * @throws TskCoreException If there is any error getting contact - * artifacts from case database. - * @throws CentralRepoException If there is an error in creating - * personas in the Central Repo. - */ - private void autoGenerateContactPersonas(Content dataSource) throws TskCoreException, CentralRepoException { - - Blackboard blackboard; - try { - blackboard = Case.getCurrentCaseThrows().getSleuthkitCase().getBlackboard(); - } catch (NoCurrentCaseException ex) { - LOGGER.log(Level.SEVERE, "Exception while getting open case.", ex); - return; - } - - // get all TSK_CONTACT artifacts in this data source. - List contactArtifacts = blackboard.getArtifacts(TSK_CONTACT.getTypeID(), dataSource.getId()); - for (BlackboardArtifact artifact : contactArtifacts) { - - BlackboardAttribute nameAttr = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_NAME)); - String personaName = (nameAttr != null) ? nameAttr.getValueString() : null; - - // Get phone number and email attributes. - BlackboardAttribute phoneAttr = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER)); - BlackboardAttribute homePhoneAttr = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_HOME)); - BlackboardAttribute mobilePhoneAttr = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_PHONE_NUMBER_MOBILE)); - BlackboardAttribute emailAttr = artifact.getAttribute(new BlackboardAttribute.Type(BlackboardAttribute.ATTRIBUTE_TYPE.TSK_EMAIL)); - - Persona persona = personaFromContactAttribute(null, Account.Type.PHONE, phoneAttr, personaName); - persona = personaFromContactAttribute(persona, Account.Type.PHONE, homePhoneAttr, personaName); - persona = personaFromContactAttribute(persona, Account.Type.PHONE, mobilePhoneAttr, personaName); - personaFromContactAttribute(persona, Account.Type.EMAIL, emailAttr, personaName); - } - } - - - - /** - * Gets central repo account for the given attribute for a TSK_CONTACT - * artifact. Associates the given persona with that account. Creates a - * Persona, if one isn't provided. - * - * @param persona Persona to associate with the account. May be null, in - * which case a persona is created first. - * @param accountType Account type of account to be associated. - * @param attribute Attribute form which get the account id. - * @param personaName Persona name, if a persona needs to be created. - * @return Persona created or associated with the account. - * - * @throws TskCoreException If there is an error in normalizing the - * account id. - * @throws CentralRepoException If there is an erorr is getting the - * account or associating the persona with it. - */ - private Persona personaFromContactAttribute(Persona persona, Account.Type accountType, BlackboardAttribute attribute, String personaName) throws CentralRepoException, TskCoreException { - - Persona personaToReturn = persona; - if (attribute != null) { - - String accountId = attribute.getValueString(); - if (CommunicationsUtils.isValidAccountId(accountType, accountId)) { - if (accountType == Account.Type.PHONE) { - accountId = CommunicationsUtils.normalizePhoneNum(accountId); - } else if (accountType == Account.Type.EMAIL) { - accountId = CommunicationsUtils.normalizeEmailAddress(accountId); - } - - CentralRepoAccount.CentralRepoAccountType crAccountType = CentralRepository.getInstance().getAccountTypeByName(accountType.getTypeName()); - CentralRepoAccount crAccount = CentralRepository.getInstance().getOrCreateAccount(crAccountType, accountId); - - PersonaAccount personaAccount; - // If persona doesnt exist, create one - if (persona == null) { - personaToReturn = Persona.createPersonaForAccount(personaName, "Auto generated contact persona", Persona.PersonaStatus.UNKNOWN, crAccount, "Found in contact book entry", Persona.Confidence.DERIVED); - } else { - persona.addAccount(crAccount, "Found in contact book entry", Persona.Confidence.DERIVED); - } - } - } - return personaToReturn; - } - + @Override public void run() { // clear the tracker to reduce memory usage @@ -504,8 +417,6 @@ public class IngestEventsListener { correlationDataSource.setSha256(imageSha256Hash); } } - // automatically generate persona from contact artifacts. - autoGenerateContactPersonas(dataSource); } } catch (CentralRepoException ex) { LOGGER.log(Level.SEVERE, String.format( From a7f4c657b5fbb2b6049a91cfda7bd10944c555b8 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Tue, 9 Jun 2020 15:14:21 -0400 Subject: [PATCH 4/4] 6398 Fixing merge --- .../autopsy/centralrepository/datamodel/PersonaAccount.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java index d652708b18..d0322ddbca 100644 --- a/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java +++ b/Core/src/org/sleuthkit/autopsy/centralrepository/datamodel/PersonaAccount.java @@ -282,9 +282,6 @@ public class PersonaAccount { CentralRepository cr = CentralRepository.getInstance(); if (cr != null) { - String queryClause = PERSONA_ACCOUNTS_QUERY_CALUSE - + " WHERE persona_accounts.account_id = " + accountId; - PersonaAccountsQueryCallback queryCallback = new PersonaAccountsQueryCallback(); cr.executeSelectSQL(queryClause, queryCallback);