From 8aca817145748b35be52c9cda77e562e99541041 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 28 Feb 2024 12:03:47 -0600 Subject: [PATCH 01/13] added features --- .settings/org.eclipse.wst.common.component | 11 ++- pom.xml.releaseBackup | 2 +- release.properties | 10 +-- .../java/com/faction/elements/Assessment.java | 84 ++++++++----------- .../faction/extender/AssessmentManager.java | 2 +- .../faction/unittests/ExtenderTestCase.java | 1 + 6 files changed, 52 insertions(+), 58 deletions(-) diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component index b73fb2e..c582eea 100644 --- a/.settings/org.eclipse.wst.common.component +++ b/.settings/org.eclipse.wst.common.component @@ -1,9 +1,12 @@ - + + + - - - + + + + diff --git a/pom.xml.releaseBackup b/pom.xml.releaseBackup index 4595f07..642f026 100644 --- a/pom.xml.releaseBackup +++ b/pom.xml.releaseBackup @@ -2,7 +2,7 @@ 4.0.0 FactionSecurity faction-extender - 2.2-SNAPSHOT + 2.3-SNAPSHOT jar Faction Extender API API to interfaces for building extensions for Faction. diff --git a/release.properties b/release.properties index 56abbfa..42b52f7 100644 --- a/release.properties +++ b/release.properties @@ -1,11 +1,11 @@ #release configuration -#Sun Jan 14 16:37:39 CST 2024 -completedPhase=run-preparation-goals +#Sun Jan 14 16:44:12 CST 2024 +completedPhase=end-release exec.additionalArguments=-Dmaven.javadoc.skip\=true -Dmaven.test.skipTests\=true -Dmaven.test.skip\=true -P github exec.snapshotReleasePluginAllowed=false preparationGoals=clean verify -project.dev.FactionSecurity\:faction-extender=2.3-SNAPSHOT -project.rel.FactionSecurity\:faction-extender=2.2 +project.dev.FactionSecurity\:faction-extender=2.4-SNAPSHOT +project.rel.FactionSecurity\:faction-extender=2.3 project.scm.FactionSecurity\:faction-extender.connection=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git project.scm.FactionSecurity\:faction-extender.developerConnection=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git project.scm.FactionSecurity\:faction-extender.id=github @@ -16,7 +16,7 @@ pushChanges=true remoteTagging=true scm.commentPrefix=[maven-release-plugin] scm.id=github -scm.tag=2.2 +scm.tag=2.3 scm.tagNameFormat=@{project.version} scm.url=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git scm.username=summitt diff --git a/src/main/java/com/faction/elements/Assessment.java b/src/main/java/com/faction/elements/Assessment.java index fe4de73..3283d7e 100644 --- a/src/main/java/com/faction/elements/Assessment.java +++ b/src/main/java/com/faction/elements/Assessment.java @@ -7,14 +7,14 @@ import java.util.UUID; import com.faction.elements.User; -public class Assessment{ - +public class Assessment { + private String summary; private String riskAnalysis; private String name; private User engagementContact; - private Listassessors; + private List assessors; private User remediationContact; private String appId; private Date start; @@ -24,110 +24,127 @@ public class Assessment{ private String DistributionList; private String AccessNotes; private String type; - private byte [] finalReport; + private byte[] finalReport; private String campaign; private String pr_sum_notes; private String pr_risk_notes; private String status; private Integer workflow; - private List customFields; - - - + private List customFields; public String getSummary() { return summary; } - + public String getRiskAnalysis() { return this.riskAnalysis; } - + public String getName() { return name; } + public void setName(String name) { this.name = name; } - - + public String getAppId() { return appId; } + public void setAppId(String appId) { this.appId = appId; } + public Date getStart() { return start; } + public void setStart(Date start) { this.start = start; } + public Date getEnd() { return end; } + public void setEnd(Date end) { this.end = end; } + public Date getCompleted() { return completed; } + public void setCompleted(Date completed) { this.completed = completed; } + public String getNotes() { return Notes; } - + public String getDistributionList() { return DistributionList; } + public void setDistributionList(String distributionList) { DistributionList = distributionList; } + public String getAccessNotes() { return AccessNotes; } - + public String getPr_sum_notes() { return pr_sum_notes; } - + public String getPr_risk_notes() { return pr_risk_notes; } - + public String getType() { return type; } + public byte[] getFinalReport() { return finalReport; } + public String getCampaign() { return campaign; } + public User getEngagementContact() { return engagementContact; } + public User getRemediationContact() { return remediationContact; } + public void setEngagementContact(User engagementContact) { this.engagementContact = engagementContact; } + public void setRemediationContact(User remediationContact) { this.remediationContact = remediationContact; } + public List getAssessors() { return assessors; } + public void setAssessors(List assessors) { this.assessors = assessors; } + public String getStatus() { return status; } + public Integer getWorkflow() { return workflow; } @@ -175,41 +192,14 @@ public void setStatus(String status) { public void setWorkflow(Integer workflow) { this.workflow = workflow; } - public void setCustomFields( List fields) { + + public void setCustomFields(List fields) { this.customFields = fields; } - - public List getCustomFields(){ + + public List getCustomFields() { return this.customFields; } - - - - - - - - - - - - - - - - - - - - - - - - - - - - } diff --git a/src/main/java/com/faction/extender/AssessmentManager.java b/src/main/java/com/faction/extender/AssessmentManager.java index 27751fe..bb6793e 100644 --- a/src/main/java/com/faction/extender/AssessmentManager.java +++ b/src/main/java/com/faction/extender/AssessmentManager.java @@ -12,7 +12,7 @@ public interface AssessmentManager extends BaseInterface{ static public enum Operation { Create, Update, Delete, - Finalize, PeerReviewCreated, PeerReviewCompleted, + Finalize, ReportCreate, PeerReviewCreated, PeerReviewCompleted, PeerReviewAccepted}; diff --git a/src/test/java/com/faction/unittests/ExtenderTestCase.java b/src/test/java/com/faction/unittests/ExtenderTestCase.java index c905015..a08662a 100644 --- a/src/test/java/com/faction/unittests/ExtenderTestCase.java +++ b/src/test/java/com/faction/unittests/ExtenderTestCase.java @@ -77,6 +77,7 @@ public AssessmentManagerResult assessmentChange(Assessment asmt, List Date: Sat, 2 Mar 2024 17:09:59 -0600 Subject: [PATCH 02/13] fixes for deployment to maven central --- .classpath | 28 +++++- pom.xml | 89 ++++++++++++++++--- .../java/com/faction/elements/Assessment.java | 3 + .../com/faction/elements/BaseExtension.java | 3 + .../java/com/faction/elements/Campaign.java | 6 +- .../com/faction/elements/CustomField.java | 4 +- .../java/com/faction/elements/CustomType.java | 4 +- src/main/java/com/faction/elements/User.java | 4 +- .../com/faction/elements/Verification.java | 4 +- .../com/faction/elements/Vulnerability.java | 4 +- .../results/AssessmentManagerResult.java | 32 +++++-- .../elements/results/InventoryResult.java | 57 ++++++++---- .../java/com/faction/elements/utils/Log.java | 57 ++++++++++-- .../com/faction/elements/utils/Logger.java | 31 +++++-- .../extender/ApplicationInventory.java | 19 ++-- .../faction/extender/AssessmentManager.java | 15 ++-- .../com/faction/extender/BaseInterface.java | 6 +- .../com/faction/extender/ReportManager.java | 22 +++++ .../faction/extender/VerificationManager.java | 10 ++- .../extender/VulnerabilityManager.java | 15 ++-- .../com/faction/interfaces/_Assessment.java | 52 ----------- .../faction/interfaces/_AssessmentType.java | 9 -- .../com/faction/interfaces/_Campaign.java | 8 -- .../com/faction/interfaces/_Category.java | 8 -- .../com/faction/interfaces/_CustomField.java | 11 --- .../com/faction/interfaces/_CustomType.java | 10 --- .../com/faction/interfaces/_FinalReport.java | 12 --- .../java/com/faction/interfaces/_Teams.java | 6 -- .../java/com/faction/interfaces/_User.java | 29 ------ .../com/faction/interfaces/_Verification.java | 30 ------- .../faction/interfaces/_Vulnerability.java | 47 ---------- .../faction/unittests/ExtenderTestCase.java | 1 + 32 files changed, 331 insertions(+), 305 deletions(-) create mode 100644 src/main/java/com/faction/extender/ReportManager.java delete mode 100644 src/main/java/com/faction/interfaces/_Assessment.java delete mode 100644 src/main/java/com/faction/interfaces/_AssessmentType.java delete mode 100644 src/main/java/com/faction/interfaces/_Campaign.java delete mode 100644 src/main/java/com/faction/interfaces/_Category.java delete mode 100644 src/main/java/com/faction/interfaces/_CustomField.java delete mode 100644 src/main/java/com/faction/interfaces/_CustomType.java delete mode 100644 src/main/java/com/faction/interfaces/_FinalReport.java delete mode 100644 src/main/java/com/faction/interfaces/_Teams.java delete mode 100644 src/main/java/com/faction/interfaces/_User.java delete mode 100644 src/main/java/com/faction/interfaces/_Verification.java delete mode 100644 src/main/java/com/faction/interfaces/_Vulnerability.java diff --git a/.classpath b/.classpath index 1c0f9e7..dc90ac9 100644 --- a/.classpath +++ b/.classpath @@ -1,7 +1,18 @@ - - + + + + + + + + + + + + + @@ -14,5 +25,18 @@ + + + + + + + + + + + + + diff --git a/pom.xml b/pom.xml index 427c513..b9975d4 100644 --- a/pom.xml +++ b/pom.xml @@ -1,8 +1,10 @@ - + 4.0.0 - FactionSecurity + com.factionsecurity faction-extender - 2.4-SNAPSHOT + 2.5 jar Faction Extender API API to interfaces for building extensions for Faction. @@ -14,9 +16,18 @@ repo + + + Josh Summitt + develop@factionsecurity.com + Faction Security + https://www.factionsecurity.com + + https://github.com/factionsecurity/FactionExtender.git - scm:git:https://github.com/factionsecurity/FactionExtender.git + + scm:git:https://github.com/factionsecurity/FactionExtender.git scm:git:https://github.com/factionsecurity/FactionExtender.git 2.2 @@ -26,17 +37,71 @@ github github - - - github - Faction Extender - https://maven.pkg.github.com/factionsecurity/FactionExtender - - src/main/java - src/test/java + src/test/java + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + net.ju-n.maven.plugins + checksum-maven-plugin + 1.2 + + + + artifacts + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.3.0 + true + + sonatype + true + + org.apache.maven.plugins maven-release-plugin diff --git a/src/main/java/com/faction/elements/Assessment.java b/src/main/java/com/faction/elements/Assessment.java index 3283d7e..fd018e9 100644 --- a/src/main/java/com/faction/elements/Assessment.java +++ b/src/main/java/com/faction/elements/Assessment.java @@ -8,6 +8,9 @@ import com.faction.elements.User; +/** + * The Assessment Class is used to store all elements of a Faction Assessment + */ public class Assessment { private String summary; diff --git a/src/main/java/com/faction/elements/BaseExtension.java b/src/main/java/com/faction/elements/BaseExtension.java index 8cf1d97..01d9aed 100644 --- a/src/main/java/com/faction/elements/BaseExtension.java +++ b/src/main/java/com/faction/elements/BaseExtension.java @@ -7,6 +7,9 @@ import java.util.List; +/** + * The Base Class is used to get logs and configs + */ public class BaseExtension { private Logger logger; diff --git a/src/main/java/com/faction/elements/Campaign.java b/src/main/java/com/faction/elements/Campaign.java index 0e0b55a..c91b0f2 100644 --- a/src/main/java/com/faction/elements/Campaign.java +++ b/src/main/java/com/faction/elements/Campaign.java @@ -1,8 +1,10 @@ package com.faction.elements; - -public class Campaign extends com.faction.interfaces._Campaign{ +/** + * Campaign Class used to get the assessment campaign + */ +public class Campaign{ private Long id; diff --git a/src/main/java/com/faction/elements/CustomField.java b/src/main/java/com/faction/elements/CustomField.java index e424034..96088af 100644 --- a/src/main/java/com/faction/elements/CustomField.java +++ b/src/main/java/com/faction/elements/CustomField.java @@ -1,7 +1,9 @@ package com.faction.elements; - +/** + * Class to represent faction custom fields + */ public class CustomField { diff --git a/src/main/java/com/faction/elements/CustomType.java b/src/main/java/com/faction/elements/CustomType.java index 0762026..76e28d9 100644 --- a/src/main/java/com/faction/elements/CustomType.java +++ b/src/main/java/com/faction/elements/CustomType.java @@ -1,6 +1,8 @@ package com.faction.elements; - +/** + * Class to represent faction custom field types + */ public class CustomType { diff --git a/src/main/java/com/faction/elements/User.java b/src/main/java/com/faction/elements/User.java index bcf012e..98a97fd 100644 --- a/src/main/java/com/faction/elements/User.java +++ b/src/main/java/com/faction/elements/User.java @@ -3,7 +3,9 @@ import java.util.Date; - +/** + * Class to represent a faction user + */ public class User { private String fname; diff --git a/src/main/java/com/faction/elements/Verification.java b/src/main/java/com/faction/elements/Verification.java index e233fe3..daa5b24 100644 --- a/src/main/java/com/faction/elements/Verification.java +++ b/src/main/java/com/faction/elements/Verification.java @@ -9,7 +9,9 @@ import com.faction.elements.Assessment; import com.faction.elements.CustomField; - +/** + * Class to represent a Faction verification/retest event + */ public class Verification { private Long id; diff --git a/src/main/java/com/faction/elements/Vulnerability.java b/src/main/java/com/faction/elements/Vulnerability.java index 51e2f11..269d0a8 100644 --- a/src/main/java/com/faction/elements/Vulnerability.java +++ b/src/main/java/com/faction/elements/Vulnerability.java @@ -9,7 +9,9 @@ - +/** + * Class to represent a Faction vulnerability + */ public class Vulnerability{ diff --git a/src/main/java/com/faction/elements/results/AssessmentManagerResult.java b/src/main/java/com/faction/elements/results/AssessmentManagerResult.java index f0f4691..4d7bf30 100644 --- a/src/main/java/com/faction/elements/results/AssessmentManagerResult.java +++ b/src/main/java/com/faction/elements/results/AssessmentManagerResult.java @@ -8,22 +8,42 @@ import java.util.ArrayList; public class AssessmentManagerResult { - + private Assessment assessment; private List vulnerabilities; - + + /** + * Gets the current assessment + * + * @return assessment + */ public Assessment getAssessment() { return this.assessment; } - + + /** + * Sets the updated assessment + * + * @param assessment + */ public void setAssessment(Assessment assessment) { this.assessment = assessment; } - - public List getVulnerabilities(){ + + /** + * Get a list of Vulnerabilities for the assessment + * + * @return List of vulnerabilities + */ + public List getVulnerabilities() { return this.vulnerabilities; } - + + /** + * Set and updated list of vulnerabilities + * + * @param vulnerabilities + */ public void setVulnerabilities(List vulnerabilities) { this.vulnerabilities = vulnerabilities; } diff --git a/src/main/java/com/faction/elements/results/InventoryResult.java b/src/main/java/com/faction/elements/results/InventoryResult.java index 5b9dc35..230c29c 100644 --- a/src/main/java/com/faction/elements/results/InventoryResult.java +++ b/src/main/java/com/faction/elements/results/InventoryResult.java @@ -5,62 +5,83 @@ public class InventoryResult { private String ApplicationId; private String ApplicationName; - private String DistrobutionList; - private HashMap CustomFields = new HashMap(); - + private String DistributionList; + private HashMap CustomFields = new HashMap(); + /** + * Gets the current application id + * * @return Returns the Application Id */ public String getApplicationId() { return ApplicationId; } + /** + * Gets the current application name + * * @return Returns the Application Name */ public String getApplicationName() { return ApplicationName; } + /** - * @return Returns the a key value pair of custom fields. - * The key must be an exact match to the variable name in Faction + * Get all custom fields assigned to this assessment + * + * @return Returns the a key value pair of custom fields. The key must be an + * exact match to the variable name in Faction */ public HashMap getCustomFields() { return CustomFields; } /** - * @param applicationId is the ID of the application. This is not the Faction Database ID + * Update the Application Id + * + * @param applicationId is the ID of the application. This is not the Faction + * Database ID */ public void setApplicationId(String applicationId) { ApplicationId = applicationId; } + /** - * @param applicationName Is the Name of the Application + * Update the applicaiton name + * + * @param applicationName Is the Name of the Application */ public void setApplicationName(String applicationName) { ApplicationName = applicationName; } + /** - * @param customFields key value pairs where the key must match to a custom variable name in Faction + * Update custom fields + * + * @param customFields key value pairs where the key must match to a custom + * variable name in Faction */ public void setCustomFields(HashMap customFields) { CustomFields = customFields; } + /** - * return a distribution list the is a string of email addresses separated by a ';' + * Get the email distribution list + * + * @return a distribution list the is a string of email addresses separated by a + * ';' */ - public String getDistrobutionList() { - return DistrobutionList; + public String getDistributionList() { + return DistributionList; } + /** - * @param distrobutionList is a string of email addresses separated by a ';' + * Set an updated distribution list + * + * @param distributionList is a string of email addresses separated by a ';' */ - public void setDistrobutionList(String distrobutionList) { - DistrobutionList = distrobutionList; + public void setDistributionList(String distributionList) { + DistributionList = distributionList; } - - - - } diff --git a/src/main/java/com/faction/elements/utils/Log.java b/src/main/java/com/faction/elements/utils/Log.java index 3fe111c..ef4c0b9 100644 --- a/src/main/java/com/faction/elements/utils/Log.java +++ b/src/main/java/com/faction/elements/utils/Log.java @@ -5,13 +5,23 @@ import java.util.Date; public class Log { - - public enum LEVEL { INFO, WARNING, ERROR, DEBUG }; + + public enum LEVEL { + INFO, WARNING, ERROR, DEBUG + }; + private LEVEL level; private String message; private String stackTrace; private Date timestamp; - + + /** + * This class is mostly used by Faction to get logs and is therefore not + * intended to be used by extension developers + * + * @param level + * @param exception + */ public Log(LEVEL level, Exception exception) { this.timestamp = new Date(); this.level = level; @@ -20,25 +30,60 @@ public Log(LEVEL level, Exception exception) { PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw); this.stackTrace = sw.toString(); - + } + + /** + * This class is mostly used by Faction to get logs and is therefore not + * intended to be used by extension developers + * + * @param level + * @param message + */ public Log(LEVEL level, String message) { this.timestamp = new Date(); this.level = level; this.message = message; this.stackTrace = ""; - + } + + /** + * This method is mostly used by Faction to get logs and is therefore not + * intended to be used by extension developers + * + * @return + */ public LEVEL getLevel() { return level; } + + /** + * This method is mostly used by Faction to get logs and is therefore not + * intended to be used by extension developers + * + * @return + */ public String getMessage() { return message; } + + /** + * This method is mostly used by Faction to get logs and is therefore not + * intended to be used by extension developers + * + * @return + */ public String getStackTrace() { return this.stackTrace; } - + + /** + * This method is mostly used by Faction to get logs and is therefore not + * intended to be used by extension developers + * + * @return + */ public Date getTimeStamp() { return this.timestamp; } diff --git a/src/main/java/com/faction/elements/utils/Logger.java b/src/main/java/com/faction/elements/utils/Logger.java index 1ea665b..0560c48 100644 --- a/src/main/java/com/faction/elements/utils/Logger.java +++ b/src/main/java/com/faction/elements/utils/Logger.java @@ -6,21 +6,38 @@ import com.faction.elements.utils.Log.LEVEL; public class Logger { - - List logs = new ArrayList(); - + + private List logs = new ArrayList(); + + /** + * Add a log to the queue using the Java Exception + * + * @param level Enum that is INFO, WARNING, ERROR, DEBUG + * @param exception The Java Exception + */ public void addLog(LEVEL level, Exception exception) { logs.add(new Log(level, exception)); } + + /** + * Add a log to the queue using a String + * + * @param level Enum that is INFO, WARNING, ERROR, DEBUG + * @param message String of the message to be logged + */ public void addLog(LEVEL level, String message) { logs.add(new Log(level, message)); } + + /** + * Get a list of the current logs. + * + * @return List of logs + */ public List getLogs() { - logs.sort((l1,l2) -> l1.getTimeStamp().compareTo(l2.getTimeStamp())); + logs.sort((l1, l2) -> l1.getTimeStamp().compareTo(l2.getTimeStamp())); return logs; - + } - - } diff --git a/src/main/java/com/faction/extender/ApplicationInventory.java b/src/main/java/com/faction/extender/ApplicationInventory.java index cbc06b6..1b8294d 100644 --- a/src/main/java/com/faction/extender/ApplicationInventory.java +++ b/src/main/java/com/faction/extender/ApplicationInventory.java @@ -1,16 +1,15 @@ package com.faction.extender; -import java.util.HashMap; - import com.faction.elements.results.InventoryResult; - +/** + * This is an interface for the Faction API that allows + * Developers to create their own integrations with other + * systems. + * + */ public interface ApplicationInventory extends BaseInterface { - + /** - * This is an interface for the Faction API that allows - * Developers to create their own integrations with other - * systems. - * * The search feature allow developers to query other sources * of data to obtain a listing of applications. This method is * called any time an application is searched in the Faction @@ -18,9 +17,9 @@ public interface ApplicationInventory extends BaseInterface { * assessments. * * @param id is a unique identifier for the application - * @param Name is the name of the application + * @param name is the name of the application * @return InvetoryResult[] is an array of Applications */ - public InventoryResult[] search(String id, String Name); + public InventoryResult[] search(String id, String name); } diff --git a/src/main/java/com/faction/extender/AssessmentManager.java b/src/main/java/com/faction/extender/AssessmentManager.java index bb6793e..14212ce 100644 --- a/src/main/java/com/faction/extender/AssessmentManager.java +++ b/src/main/java/com/faction/extender/AssessmentManager.java @@ -11,21 +11,26 @@ public interface AssessmentManager extends BaseInterface{ + /** + * Operation This is a static list of events that can be used to control what happens when the event fires. + */ static public enum Operation { Create, Update, Delete, - Finalize, ReportCreate, PeerReviewCreated, PeerReviewCompleted, + Finalize, PeerReviewCreated, PeerReviewCompleted, PeerReviewAccepted}; /** - * This function allows you to update other interfaces when the command is run. This can also up + * assessmentChange is fired when any of the Operation events are fired. * * - * @param asmt is the Current assessment + * @param assessment is the Current assessment * @param vulns is the list of vulnerabilities that is related to this assessment. Will be * null if the Operation is Create. - * @param Operation is Create Update or Delete as defined by the Operation Static variable + * @param operation Enum that is Create Update or Delete as defined by the Operation Static variable + * + * @return AssessmentManagerResult that contains the updated assessment and updated vulnerabilities. */ - public AssessmentManagerResult assessmentChange(Assessment asmt, List vulns, Operation Operation); + public AssessmentManagerResult assessmentChange(Assessment assessment, List vulns, Operation operation); diff --git a/src/main/java/com/faction/extender/BaseInterface.java b/src/main/java/com/faction/extender/BaseInterface.java index 32d456d..7abd419 100644 --- a/src/main/java/com/faction/extender/BaseInterface.java +++ b/src/main/java/com/faction/extender/BaseInterface.java @@ -10,16 +10,16 @@ public interface BaseInterface { * This function is used by Faction to set the configurations for the extension. This should not be called * locally in your classes * - * @param configs + * @param configs This is a a key-value pair of user supplied configs to be used by the extension. */ public void setConfigs(HashMapconfigs); /** * This function is used by Faction to get all logs for the extension. This should not be called locally in - * your classes + * your classes to report errors back to the faction UI * - * @return List logs : Returns a list of logs that can be displayed in the Faction UI + * @return Returns a list of logs that can be displayed in the Faction UI */ public List getLogs(); diff --git a/src/main/java/com/faction/extender/ReportManager.java b/src/main/java/com/faction/extender/ReportManager.java new file mode 100644 index 0000000..2a8fb8c --- /dev/null +++ b/src/main/java/com/faction/extender/ReportManager.java @@ -0,0 +1,22 @@ +package com.faction.extender; + +import java.util.List; + +import com.faction.elements.Assessment; +import com.faction.elements.Vulnerability; + +public interface ReportManager extends BaseInterface { + + /** + * reportCreate is fired when ever an assessment report is created. + * + * + * @param assessment is the Current assessment + * @param vulns is the list of vulnerabilities that is related to this assessment. Will be + * null if the Operation is Create. + * @param reportText text from the report before it is converted to a docx file. + * + * @return updated reportText. If the repsonse is null then the report is not updated. + */ + public String reportCreate(Assessment assessment, List vulns, String reportText); +} diff --git a/src/main/java/com/faction/extender/VerificationManager.java b/src/main/java/com/faction/extender/VerificationManager.java index 3336df3..bc5445a 100644 --- a/src/main/java/com/faction/extender/VerificationManager.java +++ b/src/main/java/com/faction/extender/VerificationManager.java @@ -7,17 +7,23 @@ import com.faction.elements.Vulnerability; public interface VerificationManager extends BaseInterface { + + /** + * Operation This is a static list of events that can be used to control what happens when the event fires. + */ static public enum Operation { Cancel, PASS,FAIL,Assigned}; /** - * @param changer This is the user that changed the vulnerability + * This method fires when there is a change to a verification/retest event. + * + * @param changeUser This is the user that changed the vulnerability * @param vulnerability This the vulnerability that is being modified * @param verification This is the verification object * @param operation An Enum operation. Values are Cancel, PASS, FAIL, or Assigned * @return All Operations return the updated vulnerability. If return value is null then * Faction will not update the internal database. */ - public Vulnerability verificationChange(User changer, Vulnerability vulnerability, Verification verification, Operation Operation); + public Vulnerability verificationChange(User changeUser, Vulnerability vulnerability, Verification verification, Operation operation); } diff --git a/src/main/java/com/faction/extender/VulnerabilityManager.java b/src/main/java/com/faction/extender/VulnerabilityManager.java index fec1a5a..c7cb2cb 100644 --- a/src/main/java/com/faction/extender/VulnerabilityManager.java +++ b/src/main/java/com/faction/extender/VulnerabilityManager.java @@ -7,16 +7,21 @@ import com.faction.extender.AssessmentManager.Operation; public interface VulnerabilityManager extends BaseInterface { + + /** + * Operation This is a static list of events that can be used to control what happens when the event fires. + */ static public enum Operation { Create, Update, Delete } /** - * @param asmt The Current assessment - * @param vuln The vulnerability that is being modified - * @param Operation The is Create Update or Delete as defined by the Operation Enum - * @return All Operations return the updated vulnerability. + * This method fires when there are changes to vulnerabilities. * + * @param assessment The Current assessment + * @param vulnerability The vulnerability that is being modified + * @param operation The is Create Update or Delete as defined by the Operation Enum + * @return All Operations return the updated vulnerability. */ - public Vulnerability vulnChange(Assessment asmt, Vulnerability vuln, Operation Operation); + public Vulnerability vulnChange(Assessment assessment, Vulnerability vulnerability, Operation operation); } diff --git a/src/main/java/com/faction/interfaces/_Assessment.java b/src/main/java/com/faction/interfaces/_Assessment.java deleted file mode 100644 index 6dd7258..0000000 --- a/src/main/java/com/faction/interfaces/_Assessment.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.faction.interfaces; - -import java.util.Date; -import java.util.List; - -public abstract class _Assessment { - - - - public abstract Long getId(); - public abstract String getSummary(); - public abstract void setSummary(String summary); - public abstract String getRiskAnalysis(); - public abstract void setRiskAnalysis(String riskAnalysis); - public abstract String getName(); - public abstract void setName(String name); - public abstract _User getEngagement(); - public abstract void setEngagement(_User engagement); - public abstract List<_User> getAssessor(); - public abstract void setAssessor(List<_User> assessor); - public abstract List<_Vulnerability> getVulns(); - public abstract void setVulns(List<_Vulnerability> vulns); - public abstract String getAppId(); - public abstract void setAppId(String appId); - public abstract Date getStart(); - public abstract void setStart(Date start); - public abstract Date getEnd(); - public abstract void setEnd(Date end); - public abstract Date getCompleted(); - public abstract void setCompleted(Date completed); - public abstract List<_CustomField> getCustomFields(); - public abstract void setCustomFields(List<_CustomField> customFields); - public abstract String getNotes(); - public abstract void setNotes(String notes); - public abstract String getDistributionList(); - public abstract void setDistributionList(String distributionList); - public abstract String getAccessNotes(); - public abstract void setAccessNotes(String accessNotes); - public abstract _User getRemediation(); - public abstract void setRemediation(_User remediation); - - public abstract _AssessmentType getType(); - public abstract Object getFinalReport(); - public abstract _Campaign getCampaign(); - public abstract String getPr_sum_notes(); - public abstract String getPr_risk_notes(); - public abstract String getGuid(); - public abstract _FinalReport getRetestReport(); - - - -} diff --git a/src/main/java/com/faction/interfaces/_AssessmentType.java b/src/main/java/com/faction/interfaces/_AssessmentType.java deleted file mode 100644 index d8b3ad0..0000000 --- a/src/main/java/com/faction/interfaces/_AssessmentType.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.faction.interfaces; - -public abstract class _AssessmentType { - - public abstract Long getId(); - public abstract String getType(); - - -} diff --git a/src/main/java/com/faction/interfaces/_Campaign.java b/src/main/java/com/faction/interfaces/_Campaign.java deleted file mode 100644 index 559c99d..0000000 --- a/src/main/java/com/faction/interfaces/_Campaign.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.faction.interfaces; - -public abstract class _Campaign { - - public abstract Long getId(); - public abstract String getName(); - -} diff --git a/src/main/java/com/faction/interfaces/_Category.java b/src/main/java/com/faction/interfaces/_Category.java deleted file mode 100644 index 4343f3b..0000000 --- a/src/main/java/com/faction/interfaces/_Category.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.faction.interfaces; - -public abstract class _Category { - - public abstract long getId(); - public abstract String getName(); - -} diff --git a/src/main/java/com/faction/interfaces/_CustomField.java b/src/main/java/com/faction/interfaces/_CustomField.java deleted file mode 100644 index b967da1..0000000 --- a/src/main/java/com/faction/interfaces/_CustomField.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.faction.interfaces; - - -public abstract class _CustomField { - - public abstract Long getId(); - public abstract _CustomType getType(); - public abstract String getValue(); - public abstract void setType(_CustomType type); - public abstract void setValue(String value); -} diff --git a/src/main/java/com/faction/interfaces/_CustomType.java b/src/main/java/com/faction/interfaces/_CustomType.java deleted file mode 100644 index 5518813..0000000 --- a/src/main/java/com/faction/interfaces/_CustomType.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.faction.interfaces; - -public abstract class _CustomType { - - public abstract Long getId(); - public abstract String getKey(); - public abstract String getVariable(); - public abstract int getType(); - -} diff --git a/src/main/java/com/faction/interfaces/_FinalReport.java b/src/main/java/com/faction/interfaces/_FinalReport.java deleted file mode 100644 index 49f1314..0000000 --- a/src/main/java/com/faction/interfaces/_FinalReport.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.faction.interfaces; - -import java.util.Date; - -public abstract class _FinalReport { - public abstract Long getId(); - public abstract String getBase64EncodedPdf(); - public abstract void setBase64EncodedPdf(String base64EncodedPdf); - public abstract Date getGentime(); - public abstract void setGentime(Date gentime); - -} diff --git a/src/main/java/com/faction/interfaces/_Teams.java b/src/main/java/com/faction/interfaces/_Teams.java deleted file mode 100644 index f89735f..0000000 --- a/src/main/java/com/faction/interfaces/_Teams.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.faction.interfaces; - -public abstract class _Teams { - public abstract Long getId(); - public abstract String getTeamName(); -} diff --git a/src/main/java/com/faction/interfaces/_User.java b/src/main/java/com/faction/interfaces/_User.java deleted file mode 100644 index 53467e2..0000000 --- a/src/main/java/com/faction/interfaces/_User.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.faction.interfaces; - -import java.util.Date; - - -public abstract class _User { - - public abstract long getId(); - public abstract String getFname(); - public abstract void setFname(String fname); - public abstract String getLname(); - public abstract void setLname(String lname); - public abstract String getEmail(); - public abstract void setEmail(String email); - public abstract String getUsername(); - public abstract void setUsername(String username); - public abstract _Teams getTeam(); - public abstract void setTeam(_Teams team); - public abstract boolean isInActive(); - public abstract void setInActive(boolean inActive); - public abstract int getVerificationCount(); - public abstract void setVerificationCount(int count); - public abstract Date getLastLogin(); - public abstract void setLastLogin(Date lastLogin); - public abstract Date getLoginTime(); - public abstract void setLoginTime(Date loginTime); - public abstract void setAvatarGuid(String avatarGuid); - -} diff --git a/src/main/java/com/faction/interfaces/_Verification.java b/src/main/java/com/faction/interfaces/_Verification.java deleted file mode 100644 index d914325..0000000 --- a/src/main/java/com/faction/interfaces/_Verification.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.faction.interfaces; - -import java.util.Date; -import java.util.List; - -public abstract class _Verification { - public abstract _User getAssessor(); - public abstract void setAssessor(_User assessor); - public abstract _User getAssignedRemediation(); - public abstract void setAssignedRemediation(_User assignedRemediation); - public abstract Long getId(); - public abstract void setId(Long id); - public abstract _Assessment getAssessment(); - public abstract void setAssessment(_Assessment assessment); - public abstract Date getStart(); - public abstract void setStart(Date start); - public abstract Date getEnd(); - public abstract void setEnd(Date end); - public abstract Date getCompleted(); - public abstract void setCompleted(Date completed); - public abstract List<_CustomField> getCustomFields() ; - public abstract void setCustomFields(List<_CustomField> customFields) ; - public abstract String getNotes() ; - public abstract void setNotes(String notes) ; - public abstract Date getRemediationCompleted() ; - public abstract void setRemediationCompleted(Date remediationCompleted) ; - public abstract String getWorkflowStatus() ; - public abstract void setWorkflowStatus(String workflowStatus) ; - -} diff --git a/src/main/java/com/faction/interfaces/_Vulnerability.java b/src/main/java/com/faction/interfaces/_Vulnerability.java deleted file mode 100644 index 89c26f9..0000000 --- a/src/main/java/com/faction/interfaces/_Vulnerability.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.faction.interfaces; - -import java.util.Date; -import java.util.List; - - -public abstract class _Vulnerability { - - public abstract long getId(); - public abstract String getName(); - public abstract void setName(String name); - public abstract String getDescription(); - public abstract void setDescription(String description); - public abstract String getDetails(); - public abstract void setDetails(String details); - public abstract String getRecommendation(); - public abstract void setRecommendation(String recommendation); - public abstract long getAssessmentId(); - public abstract void setAssessmentId(long assessmentId); - public abstract _Category getCategory(); - public abstract void setCategory(_Category category); - public abstract Long getLikelyhood(); - public abstract void setLikelyhood(Long likelyhood); - public abstract Date getClosed(); - public abstract void setClosed(Date closed); - public abstract Date getOpened(); - public abstract void setOpened(Date opened); - public abstract Long getImpact(); - public abstract void setImpact(Long impact); - public abstract Long getOverall(); - public abstract void setOverall(Long overall); - public abstract Date getDevClosed(); - public abstract void setDevClosed(Date devClosed); - public abstract String getTracking(); - public abstract void setTracking(String tracking); - public abstract void setId(Long id); - public abstract void setAssessmentId(Long assessmentId); - public abstract String getDesc_notes(); - public abstract void setDesc_notes(String desc_notes); - public abstract String getRec_notes(); - public abstract void setRec_notes(String rec_notes); - public abstract Long getAssessorId(); - public abstract void setAssessorId(Long assessorId); - public abstract List<_CustomField> getCustomFields(); - public abstract void setCustomFields(List<_CustomField> customFields); - -} diff --git a/src/test/java/com/faction/unittests/ExtenderTestCase.java b/src/test/java/com/faction/unittests/ExtenderTestCase.java index a08662a..d5c6df8 100644 --- a/src/test/java/com/faction/unittests/ExtenderTestCase.java +++ b/src/test/java/com/faction/unittests/ExtenderTestCase.java @@ -76,6 +76,7 @@ public AssessmentManagerResult assessmentChange(Assessment asmt, List Date: Sat, 2 Mar 2024 17:14:45 -0600 Subject: [PATCH 03/13] update readme --- README.md | 42 +++++------------------------------------- 1 file changed, 5 insertions(+), 37 deletions(-) diff --git a/README.md b/README.md index 722dcde..a1582eb 100644 --- a/README.md +++ b/README.md @@ -1,46 +1,14 @@ # FactionExtender -This Java Library allows you to write extensions for FuseSoft Faction. Once a module is created it only needs to be placed in /opt/faction/modules/ directory along with any library dependencies. +This Java Library allows you to write extensions for Faction. To create an extension you need to add this to your pom but ensure you are using the latest version. -Tutorial can be found here: +[Click here to see the latest published versions](https://central.sonatype.com/artifact/com.factionsecurity/faction-extender) -https://docs.factionsecurity.com -### To Build a Faction extension you need to follow these steps: -1. Update your `~/.m2/settings.xml` file to include the following: - _this will allow `maven` to have access to this git bug repo_ -``` - - - github - - - - github - - - central - https://repo1.maven.org/maven2 - - - github - https://maven.pkg.github.com/factionsecurity/FactionExtender - - true - - - - - - -``` -2. Add the folowing lines to your project dependencies pom.xml. ``` - FactionSecurity - faction-extender - 1.9 + com.factionsecurity + faction-extender + 2.5 ``` -Thanks it! You can now start developing your own plugins. More information about writing a Faction Plugin Can be found here: https://www.fusesoftsecurity.com/manual/faction-extension-api/ - From 9c08c6b389826d86199147f340ff45ef0e4a519e Mon Sep 17 00:00:00 2001 From: Josh Date: Fri, 20 Dec 2024 12:56:29 -0600 Subject: [PATCH 04/13] adding additional options to vulnerability elements --- .../com/faction/elements/Vulnerability.java | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/src/main/java/com/faction/elements/Vulnerability.java b/src/main/java/com/faction/elements/Vulnerability.java index 269d0a8..3ec035f 100644 --- a/src/main/java/com/faction/elements/Vulnerability.java +++ b/src/main/java/com/faction/elements/Vulnerability.java @@ -28,6 +28,9 @@ public class Vulnerability{ private Date opened; private Date devClosed; private String tracking; + private String cvssScore; + private String cvssString; + private String section; private List customFields; @@ -126,6 +129,40 @@ public void setCustomFields( List fields) { public List getCustomFields(){ return this.customFields; } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getCvssScore() { + return cvssScore; + } + + public void setCvssScore(String cvssScore) { + this.cvssScore = cvssScore; + } + + public String getCvssString() { + return cvssString; + } + + public void setCvssString(String cvssString) { + this.cvssString = cvssString; + } + + public String getSection() { + return section; + } + + public void setSection(String section) { + this.section = section; + } + + From 2bca4143570010a86857d1868479f0e5acf0c5c9 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 14 May 2025 23:33:59 -0500 Subject: [PATCH 05/13] adding checklists to assessments --- pom.xml | 14 +- pom.xml.releaseBackup | 87 +++++++-- release.properties | 20 +- .../java/com/faction/elements/Assessment.java | 174 +----------------- .../java/com/faction/elements/CheckList.java | 12 ++ .../com/faction/elements/CheckListItem.java | 37 ++++ .../faction/unittests/ExtenderTestCase.java | 28 ++- 7 files changed, 174 insertions(+), 198 deletions(-) create mode 100644 src/main/java/com/faction/elements/CheckList.java create mode 100644 src/main/java/com/faction/elements/CheckListItem.java diff --git a/pom.xml b/pom.xml index b9975d4..9717c5b 100644 --- a/pom.xml +++ b/pom.xml @@ -1,10 +1,8 @@ - + 4.0.0 com.factionsecurity faction-extender - 2.5 + 2.7 jar Faction Extender API API to interfaces for building extensions for Faction. @@ -30,7 +28,7 @@ scm:git:https://github.com/factionsecurity/FactionExtender.git scm:git:https://github.com/factionsecurity/FactionExtender.git - 2.2 + 2.6 2.18.16 @@ -124,6 +122,12 @@ + + org.projectlombok + lombok + 1.18.36 + provided + org.junit.jupiter junit-jupiter-api diff --git a/pom.xml.releaseBackup b/pom.xml.releaseBackup index 642f026..3c1c9db 100644 --- a/pom.xml.releaseBackup +++ b/pom.xml.releaseBackup @@ -1,8 +1,8 @@ 4.0.0 - FactionSecurity + com.factionsecurity faction-extender - 2.3-SNAPSHOT + 2.6-SNAPSHOT jar Faction Extender API API to interfaces for building extensions for Faction. @@ -14,29 +14,92 @@ repo + + + Josh Summitt + develop@factionsecurity.com + Faction Security + https://www.factionsecurity.com + + https://github.com/factionsecurity/FactionExtender.git - scm:git:https://github.com/factionsecurity/FactionExtender.git + + scm:git:https://github.com/factionsecurity/FactionExtender.git scm:git:https://github.com/factionsecurity/FactionExtender.git - 2.2 + 2.6 2.18.16 github github - - - github - Faction Extender - https://maven.pkg.github.com/factionsecurity/FactionExtender - - src/main/java - src/test/java + src/test/java + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + attach-javadocs + + jar + + + + + + net.ju-n.maven.plugins + checksum-maven-plugin + 1.2 + + + + artifacts + + + + + + org.apache.maven.plugins + maven-gpg-plugin + 3.1.0 + + + sign-artifacts + verify + + sign + + + + + + org.sonatype.central + central-publishing-maven-plugin + 0.3.0 + true + + sonatype + true + + org.apache.maven.plugins maven-release-plugin diff --git a/release.properties b/release.properties index 42b52f7..0fe11f1 100644 --- a/release.properties +++ b/release.properties @@ -1,22 +1,22 @@ #release configuration -#Sun Jan 14 16:44:12 CST 2024 -completedPhase=end-release +#Fri Dec 20 14:11:30 CST 2024 +completedPhase=generate-release-poms exec.additionalArguments=-Dmaven.javadoc.skip\=true -Dmaven.test.skipTests\=true -Dmaven.test.skip\=true -P github exec.snapshotReleasePluginAllowed=false preparationGoals=clean verify -project.dev.FactionSecurity\:faction-extender=2.4-SNAPSHOT -project.rel.FactionSecurity\:faction-extender=2.3 -project.scm.FactionSecurity\:faction-extender.connection=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git -project.scm.FactionSecurity\:faction-extender.developerConnection=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git -project.scm.FactionSecurity\:faction-extender.id=github -project.scm.FactionSecurity\:faction-extender.tag=2.2 -project.scm.FactionSecurity\:faction-extender.url=https\://github.com/factionsecurity/FactionExtender.git +project.dev.com.factionsecurity\:faction-extender=2.7-SNAPSHOT +project.rel.com.factionsecurity\:faction-extender=2.6 +project.scm.com.factionsecurity\:faction-extender.connection=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git +project.scm.com.factionsecurity\:faction-extender.developerConnection=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git +project.scm.com.factionsecurity\:faction-extender.id=github +project.scm.com.factionsecurity\:faction-extender.tag=2.6 +project.scm.com.factionsecurity\:faction-extender.url=https\://github.com/factionsecurity/FactionExtender.git projectVersionPolicyId=default pushChanges=true remoteTagging=true scm.commentPrefix=[maven-release-plugin] scm.id=github -scm.tag=2.3 +scm.tag=2.6 scm.tagNameFormat=@{project.version} scm.url=scm\:git\:https\://github.com/factionsecurity/FactionExtender.git scm.username=summitt diff --git a/src/main/java/com/faction/elements/Assessment.java b/src/main/java/com/faction/elements/Assessment.java index fd018e9..50aa51d 100644 --- a/src/main/java/com/faction/elements/Assessment.java +++ b/src/main/java/com/faction/elements/Assessment.java @@ -8,9 +8,12 @@ import com.faction.elements.User; +import lombok.Data; + /** * The Assessment Class is used to store all elements of a Faction Assessment */ +@Data public class Assessment { private String summary; @@ -34,175 +37,6 @@ public class Assessment { private String status; private Integer workflow; private List customFields; - - public String getSummary() { - return summary; - } - - public String getRiskAnalysis() { - - return this.riskAnalysis; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getAppId() { - return appId; - } - - public void setAppId(String appId) { - this.appId = appId; - } - - public Date getStart() { - return start; - } - - public void setStart(Date start) { - this.start = start; - } - - public Date getEnd() { - return end; - } - - public void setEnd(Date end) { - this.end = end; - } - - public Date getCompleted() { - return completed; - } - - public void setCompleted(Date completed) { - this.completed = completed; - } - - public String getNotes() { - return Notes; - } - - public String getDistributionList() { - return DistributionList; - } - - public void setDistributionList(String distributionList) { - DistributionList = distributionList; - } - - public String getAccessNotes() { - return AccessNotes; - } - - public String getPr_sum_notes() { - return pr_sum_notes; - } - - public String getPr_risk_notes() { - return pr_risk_notes; - } - - public String getType() { - return type; - } - - public byte[] getFinalReport() { - return finalReport; - } - - public String getCampaign() { - return campaign; - } - - public User getEngagementContact() { - return engagementContact; - } - - public User getRemediationContact() { - return remediationContact; - } - - public void setEngagementContact(User engagementContact) { - this.engagementContact = engagementContact; - } - - public void setRemediationContact(User remediationContact) { - this.remediationContact = remediationContact; - } - - public List getAssessors() { - return assessors; - } - - public void setAssessors(List assessors) { - this.assessors = assessors; - } - - public String getStatus() { - return status; - } - - public Integer getWorkflow() { - return workflow; - } - - public void setSummary(String summary) { - this.summary = summary; - } - - public void setRiskAnalysis(String riskAnalysis) { - this.riskAnalysis = riskAnalysis; - } - - public void setNotes(String notes) { - Notes = notes; - } - - public void setAccessNotes(String accessNotes) { - AccessNotes = accessNotes; - } - - public void setType(String type) { - this.type = type; - } - - public void setFinalReport(byte[] finalReport) { - this.finalReport = finalReport; - } - - public void setCampaign(String campaign) { - this.campaign = campaign; - } - - public void setPr_sum_notes(String pr_sum_notes) { - this.pr_sum_notes = pr_sum_notes; - } - - public void setPr_risk_notes(String pr_risk_notes) { - this.pr_risk_notes = pr_risk_notes; - } - - public void setStatus(String status) { - this.status = status; - } - - public void setWorkflow(Integer workflow) { - this.workflow = workflow; - } - - public void setCustomFields(List fields) { - this.customFields = fields; - } - - public List getCustomFields() { - return this.customFields; - } - + private List checklists; } diff --git a/src/main/java/com/faction/elements/CheckList.java b/src/main/java/com/faction/elements/CheckList.java new file mode 100644 index 0000000..4244c3e --- /dev/null +++ b/src/main/java/com/faction/elements/CheckList.java @@ -0,0 +1,12 @@ +package com.faction.elements; + +import java.util.List; + +import lombok.Data; + +@Data +public class CheckList { + private String name; + private List checkListItems; + +} diff --git a/src/main/java/com/faction/elements/CheckListItem.java b/src/main/java/com/faction/elements/CheckListItem.java new file mode 100644 index 0000000..245aa40 --- /dev/null +++ b/src/main/java/com/faction/elements/CheckListItem.java @@ -0,0 +1,37 @@ +package com.faction.elements; + +import lombok.Data; + +@Data +public class CheckListItem { + + private String notes; + private String question; + private Answer answer; + + public static enum Answer { + Pass(3), Fail(2), NA(1), Incomplete(0); + + private final int value; + private Answer(int value) { + this.value = value; + } + + public int getValue() { + return value; + } + public static Answer getAnswer(int value){ + switch(value){ + case 0 : return Incomplete; + case 1 : return NA; + case 2 : return Fail; + case 3 : return Pass; + default: + return Incomplete; + } + } + + } + + +} diff --git a/src/test/java/com/faction/unittests/ExtenderTestCase.java b/src/test/java/com/faction/unittests/ExtenderTestCase.java index d5c6df8..73dc6b3 100644 --- a/src/test/java/com/faction/unittests/ExtenderTestCase.java +++ b/src/test/java/com/faction/unittests/ExtenderTestCase.java @@ -15,6 +15,8 @@ import com.faction.elements.Assessment; import com.faction.elements.BaseExtension; +import com.faction.elements.CheckList; +import com.faction.elements.CheckListItem; import com.faction.elements.Vulnerability; import com.faction.elements.results.AssessmentManagerResult; import com.faction.elements.utils.Log; @@ -42,15 +44,37 @@ void test() { List vulns = new ArrayList<>(); vulns.add(vuln); + CheckList checklist = new CheckList(); + CheckListItem item1 = new CheckListItem(); + item1.setNotes("note1"); + item1.setQuestion("question1"); + item1.setAnswer(CheckListItem.Answer.Fail); + CheckListItem item2 = new CheckListItem(); + item2.setNotes("note2"); + item2.setQuestion("question2"); + item2.setAnswer(CheckListItem.Answer.Pass); + + checklist.setName("checklist1"); + checklist.setCheckListItems(new ArrayList<>()); + checklist.getCheckListItems().add(item1); + checklist.getCheckListItems().add(item2); + + asmt.setChecklists(new ArrayList<>()); + asmt.getChecklists().add(checklist); + + + + AssessmentManagerResult result = asmtMgr.assessmentChange(asmt, vulns, Operation.Create); assertTrue(result.getAssessment().getSummary().equals("This is a test")); - assertTrue(asmtMgr.getLogs().size() == 2); + assertTrue(asmtMgr.getLogs().size() == 3); List logs = asmtMgr.getLogs(); assertTrue(logs.stream().anyMatch( log -> log.getMessage().equals("Got Config1: Test Config 1"))); assertTrue(logs.stream().anyMatch( log -> log.getMessage().equals("Got Config2: Test Config 2"))); + assertTrue(logs.stream().anyMatch( log -> log.getMessage().equals("Got Checklist: checklist1"))); @@ -71,6 +95,8 @@ public AssessmentManagerResult assessmentChange(Assessment asmt, List Date: Wed, 14 May 2025 23:36:57 -0500 Subject: [PATCH 06/13] update ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0d1798c..484a4b5 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ .DS_Store target/ +.classpath From c3616ebc2787bec08a07ceb2a731c17c4bd9472a Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 14 May 2025 23:41:33 -0500 Subject: [PATCH 07/13] cleanup --- .classpath | 42 ------------------- .gitignore | 3 ++ .settings/org.eclipse.jdt.core.prefs | 11 ----- .settings/org.eclipse.m2e.core.prefs | 4 -- .settings/org.eclipse.wst.common.component | 12 ------ ....eclipse.wst.common.project.facet.core.xml | 5 --- .settings/org.eclipse.wst.validation.prefs | 2 - 7 files changed, 3 insertions(+), 76 deletions(-) delete mode 100644 .classpath delete mode 100644 .settings/org.eclipse.jdt.core.prefs delete mode 100644 .settings/org.eclipse.m2e.core.prefs delete mode 100644 .settings/org.eclipse.wst.common.component delete mode 100644 .settings/org.eclipse.wst.common.project.facet.core.xml delete mode 100644 .settings/org.eclipse.wst.validation.prefs diff --git a/.classpath b/.classpath deleted file mode 100644 index dc90ac9..0000000 --- a/.classpath +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitignore b/.gitignore index 484a4b5..f7eaab8 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,6 @@ target/ .classpath +.project +.DS_Store +.settings/ diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index cac0df4..0000000 --- a/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,11 +0,0 @@ -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 diff --git a/.settings/org.eclipse.m2e.core.prefs b/.settings/org.eclipse.m2e.core.prefs deleted file mode 100644 index f897a7f..0000000 --- a/.settings/org.eclipse.m2e.core.prefs +++ /dev/null @@ -1,4 +0,0 @@ -activeProfiles= -eclipse.preferences.version=1 -resolveWorkspaceProjects=true -version=1 diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component deleted file mode 100644 index c582eea..0000000 --- a/.settings/org.eclipse.wst.common.component +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - - - - diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml deleted file mode 100644 index fb95c45..0000000 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs deleted file mode 100644 index 04cad8c..0000000 --- a/.settings/org.eclipse.wst.validation.prefs +++ /dev/null @@ -1,2 +0,0 @@ -disabled=06target -eclipse.preferences.version=1 From ac3f1cf6d956d8efcf3f3bdb2db1cb24780f6d3d Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 2 Mar 2024 17:15:15 -0600 Subject: [PATCH 08/13] Release2.4 (#3) * added features * fixes for deployment to maven central * update readme --- pom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9717c5b..8746082 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,6 @@ - + 4.0.0 com.factionsecurity faction-extender From 2f99bd77bf8ad0d8a4a5429a2a60d0f36ece3ed6 Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 25 Mar 2024 09:10:06 -0500 Subject: [PATCH 09/13] Release 2.5 (#4) * added features * fixes for deployment to maven central * update readme From eca702daea82afd8a0f6640c3711bee82d2777a9 Mon Sep 17 00:00:00 2001 From: Josh Date: Wed, 28 Feb 2024 12:03:47 -0600 Subject: [PATCH 10/13] Rebased --- src/main/java/com/faction/extender/AssessmentManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/faction/extender/AssessmentManager.java b/src/main/java/com/faction/extender/AssessmentManager.java index 14212ce..56dede0 100644 --- a/src/main/java/com/faction/extender/AssessmentManager.java +++ b/src/main/java/com/faction/extender/AssessmentManager.java @@ -15,7 +15,7 @@ public interface AssessmentManager extends BaseInterface{ * Operation This is a static list of events that can be used to control what happens when the event fires. */ static public enum Operation { Create, Update, Delete, - Finalize, PeerReviewCreated, PeerReviewCompleted, + Finalize, ReportCreate, PeerReviewCreated, PeerReviewCompleted, PeerReviewAccepted}; From 525cc033d219e4c096dea6f1736cb1a3db4c6455 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 2 Mar 2024 17:09:59 -0600 Subject: [PATCH 11/13] fixes for deployment to maven central --- src/main/java/com/faction/extender/AssessmentManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/faction/extender/AssessmentManager.java b/src/main/java/com/faction/extender/AssessmentManager.java index 56dede0..14212ce 100644 --- a/src/main/java/com/faction/extender/AssessmentManager.java +++ b/src/main/java/com/faction/extender/AssessmentManager.java @@ -15,7 +15,7 @@ public interface AssessmentManager extends BaseInterface{ * Operation This is a static list of events that can be used to control what happens when the event fires. */ static public enum Operation { Create, Update, Delete, - Finalize, ReportCreate, PeerReviewCreated, PeerReviewCompleted, + Finalize, PeerReviewCreated, PeerReviewCompleted, PeerReviewAccepted}; From cb89e3ee151e066c7ea50cf006b4b1f8e8b0b15d Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 25 Mar 2024 09:10:06 -0500 Subject: [PATCH 12/13] Release 2.5 (#4) * added features * fixes for deployment to maven central * update readme From e104271cfd45d776a710b36586bfe85b95a708fd Mon Sep 17 00:00:00 2001 From: Josh Date: Mon, 25 Mar 2024 09:10:06 -0500 Subject: [PATCH 13/13] Release 2.5 (#4) * added features * fixes for deployment to maven central * update readme