From 11b2100d64cab5ebb2258215e0a877442905186e Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Mon, 25 Feb 2019 13:46:07 +0100 Subject: [PATCH 01/11] new module forr mozilla ssh scanner --- scb-scanprocesses/mozilla-ssh-process/pom.xml | 73 ++++++ .../scanprocess/ProcessInitConfiguration.java | 34 +++ .../src/main/resources/META-INF/processes.xml | 19 ++ .../resources/bpmn/mozilla_ssh_process.bpmn | 197 +++++++++++++++ .../forms.mozilla_ssh/approve-results.html | 123 ++++++++++ .../forms.mozilla_ssh/configure-target.html | 128 ++++++++++ .../test/MozillaSshProcessTest.java | 231 ++++++++++++++++++ .../src/test/resources/camunda.cfg.xml | 14 ++ .../src/test/resources/logback-test.xml | 27 ++ scb-scanprocesses/pom.xml | 3 +- 10 files changed, 848 insertions(+), 1 deletion(-) create mode 100644 scb-scanprocesses/mozilla-ssh-process/pom.xml create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml create mode 100644 scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml diff --git a/scb-scanprocesses/mozilla-ssh-process/pom.xml b/scb-scanprocesses/mozilla-ssh-process/pom.xml new file mode 100644 index 00000000..5cb8d55a --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/pom.xml @@ -0,0 +1,73 @@ + + + + + 4.0.0 + + + io.securecodebox.scanprocesses + default-process-collection + 0.0.1-SNAPSHOT + + + io.securecpdebox.scanprocesses + mozilla-ssh-process + 1.0-SNAPSHOT + + + + io.securecodebox.core + sdk + ${project.parent.version} + + + + + com.h2database + h2 + + + org.camunda.bpm.springboot + camunda-bpm-spring-boot-starter-test + test + + + org.camunda.bpm.extension.mockito + camunda-bpm-mockito + test + + + org.camunda.bpm.extension + camunda-bpm-assert-scenario + test + + + org.camunda.bpm.extension + camunda-bpm-process-test-coverage + test + + + org.camunda.bpm.extension + camunda-bpm-assert + + + + diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java b/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java new file mode 100644 index 00000000..a726d102 --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java @@ -0,0 +1,34 @@ +/* + * + * SecureCodeBox (SCB) + * Copyright 2015-2018 iteratec GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package io.securecodebox.scanprocess; + +import org.springframework.context.annotation.Configuration; + +/** + * The secureCodeBox by default only scans for components in the package io.securecodebox.scanprocess. + *

+ * This configuration ensures that your defined package package also gets scanned, please don't move or remove this configuration. + * + * @author Rüdiger Heins - iteratec GmbH + * @since 09.05.18 + */ +@Configuration +public class ProcessInitConfiguration { +} diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml new file mode 100644 index 00000000..c7219e41 --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml @@ -0,0 +1,19 @@ + + diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn new file mode 100644 index 00000000..ffa06a98 --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + SequenceFlow_TargetConfigured + + + + SequenceFlow_SummaryCreated + + + + + + + + SequenceFlow_ManualFinish + SequenceFlow_ResultReviewed + + + SequenceFlow_ResultReviewed + SequenceFlow_ResultApproved + SequenceFlow_ResultRejected + + + + + + SequenceFlow_PortscanFinished + SequenceFlow_ManualFinish + SequenceFlow_AutomatedFinish + + + ${PROCESS_AUTOMATED == false} + + + ${PROCESS_AUTOMATED == true} + + + + SequenceFlow_TargetConfigured + SequenceFlow_PortscanFinished + + + + + SequenceFlow_ResultApproved + SequenceFlow_1i44eck + SequenceFlow_AutomatedFinish + SequenceFlow_SummaryCreated + + + + + + + + SequenceFlow_ResultRejected + SequenceFlow_1i44eck + + + + results in a generic format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html new file mode 100644 index 00000000..45d2b9ab --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html @@ -0,0 +1,123 @@ + + +

+ + +
+

SSH scan results for "{{ target.name }}"

+ +
+
+
{{ scannerId }}
+
+
+
+
{{ target.location }}
+
+
+
+
{{ context }}
+
+
+
+ +
+ + + + + + + + + + + + + + + +
Host:Name:Category:Severity:Reference:
{{ result.location }}{{ result.name }}{{ result.category }} +
+ + + {{ result.severity }} + + + + + {{ result.severity }} + + + + + {{ result.severity }} + + + + + {{ result.severity }} + + +
{{ result.reference.id }} +
+
+
+ +
+
+

Approve Result

+ +
+ +
+ + +
+
+
diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html new file mode 100644 index 00000000..0dd40bed --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html @@ -0,0 +1,128 @@ + + +

Please configure the SSH Scan

+ +
+ + + +
+ +
+

SSH scan Target

+ + +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+ + +
+ +
+ +
+
+ +
+
+
diff --git a/scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java b/scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java new file mode 100644 index 00000000..b95f3145 --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java @@ -0,0 +1,231 @@ +/* + * + * SecureCodeBox (SCB) + * Copyright 2015-2018 iteratec GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package io.securecodebox.scanprocess.test; + +import io.securecodebox.constants.DefaultFields; +import io.securecodebox.scanprocess.delegate.SummaryGeneratorDelegate; +import org.camunda.bpm.engine.ExternalTaskService; +import org.camunda.bpm.engine.delegate.DelegateTask; +import org.camunda.bpm.engine.delegate.Expression; +import org.camunda.bpm.engine.delegate.TaskListener; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.test.Deployment; +import org.camunda.bpm.engine.test.ProcessEngineRule; +import org.camunda.bpm.engine.test.mock.Mocks; +import org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRuleBuilder; +import org.camunda.bpm.scenario.ProcessScenario; +import org.camunda.bpm.scenario.Scenario; +import org.camunda.bpm.scenario.delegate.ExternalTaskDelegate; +import org.camunda.bpm.scenario.delegate.TaskDelegate; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; +import static org.camunda.bpm.extension.mockito.CamundaMockito.autoMock; +import static org.mockito.Mockito.when; + +/** + * This class tests the process execution of the Default-Process BPMN Model + * It verifies that each process task is called when it's supposed to be and + * delegation code is executed at the right time + *

+ * The tests run in an own Camunda engine which is defined by the camunda.cfg.xml in the resources directory + *

+ * The test cases use Camunda BPM's standard framework as well as the + * Camunda BPM Assert extension (), + * camunda-bpm-mockito () + * and the Camunda BPM Assert Scenario extension () + *

+ * Furthermore this class also uses the Camunda BPM Process Test Coverage extension + * (). + * After the test is run we can examine the test coverage in the directory target/process-test-coverage + */ + +@RunWith(SpringJUnit4ClassRunner.class) +@Deployment(resources = "bpmn/mozilla_ssh_process.bpmn") + +@Ignore("Ignored until problems with camunda testing frameworks are handled. Introduces via update to camunda 7.10") +public class MozillaSshProcessTest { + + //Define the Process Activity IDs + private static final String PROCESS_ID = "ssh-process"; + private static final String DO_SCAN_TASK_ID = "ServiceTask_DoScan"; + private static final String CREATE_REPORT_TASK_ID = "ServiceTask_CreateSummary"; + private static final String APPROVE_RESULTS_TASK_ID = "UserTask_ApproveResults"; + + private final Map defaultVariables = new HashMap<>(); + + @Rule + @ClassRule + public static ProcessEngineRule processEngineRule = TestCoverageProcessEngineRuleBuilder.create().build(); + + @Mock + private ProcessScenario process; + + @Mock + SummaryGeneratorDelegate delegate; + + /** + * Executed before every test-case + * In this method default variables for the process and a default behaviour for the mocks + * in the process are defined+ + */ + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + + //Creating a map of default variables for the process + defaultVariables.put(DefaultFields.PROCESS_AUTOMATED.name(), true); + defaultVariables.put(DefaultFields.PROCESS_CONTEXT.name(), "BodgeIT"); + + /* + Mocking everything in the BPMN Model + This includes ExecutionListeners, TaskListeners, JavaDelegates, etc. + Simply stated: Everything, that's executable code + + If you need to define custom behaviour for the Mocks you can do so by + registering Mocks with Camunda's method "Mocks.register(String key, Object value)". + Here the key describes a delegateExpression (as defined in BPMN model) and the value + describes the implementation of the code which should be executed + (Hint: You can put the real implementation as well as a fake one in there) + + Note: Most of the mocking methods seem to work only in combination with delegateExpressions + but not with class definitions as delegate implementation. + + If you have the path to your executable code (the class for delegate) as delegate implementation + then this guide is helpful: + https://blog.akquinet.de/2016/11/04/camunda-bpm-test-your-processes-based-on-plain-old-java-delegates/ + */ + autoMock("bpmn/mozilla_ssh_process.bpmn"); + + /* + Here we define a default behaviour for all the tasks in the BPMN model. + This behaviour can easily be overridden in test cases. + + The code inside the "thenReturn(...)" method specifies what should happen when process execution + waits at the given task + As a default behaviour we just complete the task and move on to the next one without changing anything + + Note that we have our own mock implementation in the last two when(...) statements. + This is because these tasks are external tasks which cannot be as easily completed as + ServiceTasks. They need an external worker to do so. + */ + when(process.waitsAtUserTask(Mockito.anyString())).thenReturn(TaskDelegate::complete); + when(process.waitsAtServiceTask(Mockito.anyString())).thenReturn(ExternalTaskDelegate::complete); + when(process.waitsAtServiceTask(DO_SCAN_TASK_ID)).thenReturn(task -> startExternalMockProcess("ssh-process")); + } + + @Test + public void testAutomatedStart_shouldPass() { + + ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_ID, defaultVariables); + + assertThat(processInstance).isStarted(); + } + + @Test + public void testManualStartWithDefaultConfiguration_shouldPass() { + ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_ID, defaultVariables); + + assertThat(processInstance).isStarted(); + assertThat(processInstance).isWaitingAt(DO_SCAN_TASK_ID); + } + + @Test + public void testManualRunWithApprovedTestResults() { + + Map variables = new HashMap<>(defaultVariables); + changeVariable(variables, DefaultFields.PROCESS_AUTOMATED.name(), false); + + when(process.waitsAtUserTask(APPROVE_RESULTS_TASK_ID)).thenReturn(task -> { + variables.put(DefaultFields.PROCESS_RESULT_APPROVED.name(), "approved"); + task.complete(variables); + }); + + /* + Here we register a custom mock. + The BPMN model TaskListener takes an injected field variable which cannot be mocked. + Therefore we create our own TaskListener with a dummy implementation and which also + holds the variable, that should be injected. + Then we register our TaskListener with "Mocks.register(...)" and it gets executed when the delegateExpression + is called. + */ + Mocks.register("setFormUrlListener", new TaskListener() { + + @Autowired + private Expression scanner_type; + + @Override + public void notify(DelegateTask delegateTask) { + } + }); + + Scenario scenario = Scenario.run(process).startByKey(PROCESS_ID, variables).execute(); + + assertThat(scenario.instance(process)).isEnded(); + assertThat(scenario.instance(process)).hasPassed(APPROVE_RESULTS_TASK_ID); + assertThat(scenario.instance(process)).variables() + .containsEntry(DefaultFields.PROCESS_RESULT_APPROVED.name(), "approved"); + } + + /** + * Executes an external process without doing anything in the task. + * In the first step the job is executed on the Camunda engine. Therefore the token for the + * provided topic gets pushed. Then an external service is called to pull the token and execute the task + * + * @param topic the topic for the external task + */ + private void startExternalMockProcess(String topic) { + + ExternalTaskService externalTaskService = processEngine().getExternalTaskService(); + List lockedExternalTasks = externalTaskService.fetchAndLock(1, "worker") + .topic(topic, 5000L) + .execute(); + + assertThat(lockedExternalTasks.size()).isEqualTo(1); + + LockedExternalTask task = lockedExternalTasks.get(0); + externalTaskService.complete(task.getId(), "worker"); + } + + private void changeVariable(Map variables, String key, Object value) { + + if (variables.containsKey(key)) { + variables.remove(key); + } + variables.put(key, value); + } + +} diff --git a/scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml b/scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml new file mode 100644 index 00000000..d5e7d6f9 --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml b/scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml new file mode 100644 index 00000000..81dcdbcd --- /dev/null +++ b/scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml @@ -0,0 +1,27 @@ + + + + + + + + + + diff --git a/scb-scanprocesses/pom.xml b/scb-scanprocesses/pom.xml index 7c4d11c7..ec015bf0 100644 --- a/scb-scanprocesses/pom.xml +++ b/scb-scanprocesses/pom.xml @@ -23,6 +23,7 @@ combined-amass-nmap-process arachni-process subdomain-scanner-process + mozilla-ssh-process - + \ No newline at end of file From f2bd230b3fd9311725fc7c4bccc1011ab67c6d4b Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Mon, 4 Mar 2019 15:31:24 +0100 Subject: [PATCH 02/11] Runable --- scb-scanprocesses/mozilla-ssh-process/pom.xml | 22 +------------------ .../scanprocess/ProcessInitConfiguration.java | 2 ++ .../src/main/resources/META-INF/processes.xml | 19 ---------------- .../resources/bpmn/mozilla_ssh_process.bpmn | 4 ++-- .../forms.mozilla_ssh/approve-results.html | 3 ++- 5 files changed, 7 insertions(+), 43 deletions(-) diff --git a/scb-scanprocesses/mozilla-ssh-process/pom.xml b/scb-scanprocesses/mozilla-ssh-process/pom.xml index 5cb8d55a..bbeee5c0 100644 --- a/scb-scanprocesses/mozilla-ssh-process/pom.xml +++ b/scb-scanprocesses/mozilla-ssh-process/pom.xml @@ -1,23 +1,3 @@ - - - 4.0.0 @@ -28,7 +8,7 @@ 0.0.1-SNAPSHOT - io.securecpdebox.scanprocesses + mozilla-ssh-process 1.0-SNAPSHOT diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java b/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java index a726d102..6912cde3 100644 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java @@ -19,6 +19,7 @@ package io.securecodebox.scanprocess; +import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; /** @@ -29,6 +30,7 @@ * @author Rüdiger Heins - iteratec GmbH * @since 09.05.18 */ +@ComponentScan("io.securecodebox.scanprocesses") @Configuration public class ProcessInitConfiguration { } diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml index c7219e41..e69de29b 100644 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml @@ -1,19 +0,0 @@ - - diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn index ffa06a98..678e7e15 100644 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn @@ -1,6 +1,6 @@ - + @@ -45,7 +45,7 @@ ${PROCESS_AUTOMATED == true} - + SequenceFlow_TargetConfigured SequenceFlow_PortscanFinished diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html index 45d2b9ab..b864accb 100644 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html +++ b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html @@ -54,6 +54,7 @@

SSH scan results for "{{ target.name }}"

+
@@ -93,7 +94,7 @@

SSH scan results for "{{ target.name }}"

class="glyphicon glyphicon-education"> {{ result.severity }} - + From 8b14e090acafc4390a76b10fb22fa7b60a43ff71 Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Mon, 11 Mar 2019 12:38:35 +0100 Subject: [PATCH 03/11] minor changes --- Dockerfile | 1 + scb-engine/pom.xml | 6 ++++++ .../src/main/resources/forms/arachni/approve-results.html | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 4eeb0550..a7737952 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ COPY --from=builder ./scb-scanprocesses/combined-nmap-nikto-scanprocess/target/c COPY --from=builder ./scb-scanprocesses/sslyze-process/target/sslyze-process-0.0.1-SNAPSHOT.jar /scb-engine/lib/ COPY --from=builder ./scb-scanprocesses/arachni-process/target/arachni-process-1.0-SNAPSHOT.jar /scb-engine/lib/ COPY --from=builder ./scb-scanprocesses/subdomain-scanner-process/target/subdomain-scanner-process-1.0-SNAPSHOT.jar /scb-engine/lib/ +COPY --from=builder ./scb-scanprocesses/mozilla-ssh-process/target/mozilla-ssh-process-1.0-SNAPSHOT.jar /scb-engine/lib/ COPY --from=builder ./scb-persistenceproviders/elasticsearch-persistenceprovider/target/elasticsearch-persistenceprovider-0.0.1-SNAPSHOT-jar-with-dependencies.jar /scb-engine/lib/ COPY --from=builder ./scb-persistenceproviders/s3-persistenceprovider/target/s3-persistenceprovider-0.0.1-SNAPSHOT-jar-with-dependencies.jar /scb-engine/lib/ diff --git a/scb-engine/pom.xml b/scb-engine/pom.xml index ca4e7ac8..47a3d83a 100644 --- a/scb-engine/pom.xml +++ b/scb-engine/pom.xml @@ -189,6 +189,12 @@ 0.0.1-SNAPSHOT runtime + + io.securecodebox.scanprocesses + mozilla-ssh-process + 1.0-SNAPSHOT + runtime + io.securecodebox.persistenceproviders elasticsearch-persistenceprovider diff --git a/scb-scanprocesses/arachni-process/src/main/resources/forms/arachni/approve-results.html b/scb-scanprocesses/arachni-process/src/main/resources/forms/arachni/approve-results.html index b982553f..38311f4c 100644 --- a/scb-scanprocesses/arachni-process/src/main/resources/forms/arachni/approve-results.html +++ b/scb-scanprocesses/arachni-process/src/main/resources/forms/arachni/approve-results.html @@ -91,7 +91,7 @@

Portscan results for "{{ target.name }}"

class="glyphicon glyphicon-education"> {{ result.severity }} - +
From f7fd7c051753352655de7078782194ed2daa550f Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Mon, 18 Mar 2019 14:14:56 +0100 Subject: [PATCH 04/11] bpmn changes --- scb-scanprocesses/ssh-process/pom.xml | 53 ++++ .../scanprocess/ProcessInitConfiguration.java | 36 +++ .../src/main/resources/META-INF/processes.xml | 0 .../resources/bpmn/mozilla_ssh_process.bpmn | 197 +++++++++++++++ .../forms.mozilla_ssh/approve-results.html | 122 +++++++++ .../forms.mozilla_ssh/configure-target.html | 128 ++++++++++ .../test/MozillaSshProcessTest.java | 231 ++++++++++++++++++ .../src/test/resources/camunda.cfg.xml | 14 ++ .../src/test/resources/logback-test.xml | 27 ++ 9 files changed, 808 insertions(+) create mode 100644 scb-scanprocesses/ssh-process/pom.xml create mode 100644 scb-scanprocesses/ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java create mode 100644 scb-scanprocesses/ssh-process/src/main/resources/META-INF/processes.xml create mode 100644 scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn create mode 100644 scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html create mode 100644 scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html create mode 100644 scb-scanprocesses/ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java create mode 100644 scb-scanprocesses/ssh-process/src/test/resources/camunda.cfg.xml create mode 100644 scb-scanprocesses/ssh-process/src/test/resources/logback-test.xml diff --git a/scb-scanprocesses/ssh-process/pom.xml b/scb-scanprocesses/ssh-process/pom.xml new file mode 100644 index 00000000..f8bc97da --- /dev/null +++ b/scb-scanprocesses/ssh-process/pom.xml @@ -0,0 +1,53 @@ + + 4.0.0 + + + io.securecodebox.scanprocesses + default-process-collection + 0.0.1-SNAPSHOT + + + + ssh-process + 1.0-SNAPSHOT + + + + io.securecodebox.core + sdk + ${project.parent.version} + + + + + com.h2database + h2 + + + org.camunda.bpm.springboot + camunda-bpm-spring-boot-starter-test + test + + + org.camunda.bpm.extension.mockito + camunda-bpm-mockito + test + + + org.camunda.bpm.extension + camunda-bpm-assert-scenario + test + + + org.camunda.bpm.extension + camunda-bpm-process-test-coverage + test + + + org.camunda.bpm.extension + camunda-bpm-assert + + + + diff --git a/scb-scanprocesses/ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java b/scb-scanprocesses/ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java new file mode 100644 index 00000000..6912cde3 --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java @@ -0,0 +1,36 @@ +/* + * + * SecureCodeBox (SCB) + * Copyright 2015-2018 iteratec GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package io.securecodebox.scanprocess; + +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; + +/** + * The secureCodeBox by default only scans for components in the package io.securecodebox.scanprocess. + *

+ * This configuration ensures that your defined package package also gets scanned, please don't move or remove this configuration. + * + * @author Rüdiger Heins - iteratec GmbH + * @since 09.05.18 + */ +@ComponentScan("io.securecodebox.scanprocesses") +@Configuration +public class ProcessInitConfiguration { +} diff --git a/scb-scanprocesses/ssh-process/src/main/resources/META-INF/processes.xml b/scb-scanprocesses/ssh-process/src/main/resources/META-INF/processes.xml new file mode 100644 index 00000000..e69de29b diff --git a/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn b/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn new file mode 100644 index 00000000..da2b67e8 --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + SequenceFlow_TargetConfigured + + + + SequenceFlow_SummaryCreated + + + + + + + + SequenceFlow_ManualFinish + SequenceFlow_ResultReviewed + + + SequenceFlow_ResultReviewed + SequenceFlow_ResultApproved + SequenceFlow_ResultRejected + + + + + + SequenceFlow_PortscanFinished + SequenceFlow_ManualFinish + SequenceFlow_AutomatedFinish + + + ${PROCESS_AUTOMATED == false} + + + ${PROCESS_AUTOMATED == true} + + + + SequenceFlow_TargetConfigured + SequenceFlow_PortscanFinished + + + + + SequenceFlow_ResultApproved + SequenceFlow_1i44eck + SequenceFlow_AutomatedFinish + SequenceFlow_SummaryCreated + + + + + + + + SequenceFlow_ResultRejected + SequenceFlow_1i44eck + + + + results in a generic format + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html b/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html new file mode 100644 index 00000000..c58e7ed2 --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html @@ -0,0 +1,122 @@ + + +
+ + +

+

SSH scan results for "{{ target.name }}"

+ +
+
+
{{ scannerId }}
+
+
+
+
{{ target.location }}
+
+
+
+
{{ context }}
+
+
Scanner Results "{{ $scope.scannerResult }}"
+
+
+
+
{{ result.reference.id }} {{ result.reference.id }}
+ + + + + + + + + + + + + + +
Host:Name:Category:Severity:Reference:
{{ result.location }}{{ result.name }}{{ result.category }} +
+ + + {{ result.severity }} + + + + + {{ result.severity }} + + + + + {{ result.severity }} + + + + + {{ result.severity }} + +
+
{{ result.reference.id }} +
+
+
+
+ +

Approve Result

+ +
+ +
+ + +
+
+ diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html b/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html new file mode 100644 index 00000000..0dd40bed --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html @@ -0,0 +1,128 @@ + + +

Please configure the SSH Scan

+ +
+ + + +
+ +
+

SSH scan Target

+ + +
+
+
+ + +
+
+ + +
+
+ +
+
+ + +
+ + +
+ +
+ +
+
+ +
+
+
diff --git a/scb-scanprocesses/ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java b/scb-scanprocesses/ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java new file mode 100644 index 00000000..b95f3145 --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java @@ -0,0 +1,231 @@ +/* + * + * SecureCodeBox (SCB) + * Copyright 2015-2018 iteratec GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * / + */ + +package io.securecodebox.scanprocess.test; + +import io.securecodebox.constants.DefaultFields; +import io.securecodebox.scanprocess.delegate.SummaryGeneratorDelegate; +import org.camunda.bpm.engine.ExternalTaskService; +import org.camunda.bpm.engine.delegate.DelegateTask; +import org.camunda.bpm.engine.delegate.Expression; +import org.camunda.bpm.engine.delegate.TaskListener; +import org.camunda.bpm.engine.externaltask.LockedExternalTask; +import org.camunda.bpm.engine.runtime.ProcessInstance; +import org.camunda.bpm.engine.test.Deployment; +import org.camunda.bpm.engine.test.ProcessEngineRule; +import org.camunda.bpm.engine.test.mock.Mocks; +import org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRuleBuilder; +import org.camunda.bpm.scenario.ProcessScenario; +import org.camunda.bpm.scenario.Scenario; +import org.camunda.bpm.scenario.delegate.ExternalTaskDelegate; +import org.camunda.bpm.scenario.delegate.TaskDelegate; +import org.junit.Before; +import org.junit.ClassRule; +import org.junit.Ignore; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mock; +import org.mockito.Mockito; +import org.mockito.MockitoAnnotations; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; +import static org.camunda.bpm.extension.mockito.CamundaMockito.autoMock; +import static org.mockito.Mockito.when; + +/** + * This class tests the process execution of the Default-Process BPMN Model + * It verifies that each process task is called when it's supposed to be and + * delegation code is executed at the right time + *

+ * The tests run in an own Camunda engine which is defined by the camunda.cfg.xml in the resources directory + *

+ * The test cases use Camunda BPM's standard framework as well as the + * Camunda BPM Assert extension (), + * camunda-bpm-mockito () + * and the Camunda BPM Assert Scenario extension () + *

+ * Furthermore this class also uses the Camunda BPM Process Test Coverage extension + * (). + * After the test is run we can examine the test coverage in the directory target/process-test-coverage + */ + +@RunWith(SpringJUnit4ClassRunner.class) +@Deployment(resources = "bpmn/mozilla_ssh_process.bpmn") + +@Ignore("Ignored until problems with camunda testing frameworks are handled. Introduces via update to camunda 7.10") +public class MozillaSshProcessTest { + + //Define the Process Activity IDs + private static final String PROCESS_ID = "ssh-process"; + private static final String DO_SCAN_TASK_ID = "ServiceTask_DoScan"; + private static final String CREATE_REPORT_TASK_ID = "ServiceTask_CreateSummary"; + private static final String APPROVE_RESULTS_TASK_ID = "UserTask_ApproveResults"; + + private final Map defaultVariables = new HashMap<>(); + + @Rule + @ClassRule + public static ProcessEngineRule processEngineRule = TestCoverageProcessEngineRuleBuilder.create().build(); + + @Mock + private ProcessScenario process; + + @Mock + SummaryGeneratorDelegate delegate; + + /** + * Executed before every test-case + * In this method default variables for the process and a default behaviour for the mocks + * in the process are defined+ + */ + @Before + public void init() { + + MockitoAnnotations.initMocks(this); + + //Creating a map of default variables for the process + defaultVariables.put(DefaultFields.PROCESS_AUTOMATED.name(), true); + defaultVariables.put(DefaultFields.PROCESS_CONTEXT.name(), "BodgeIT"); + + /* + Mocking everything in the BPMN Model + This includes ExecutionListeners, TaskListeners, JavaDelegates, etc. + Simply stated: Everything, that's executable code + + If you need to define custom behaviour for the Mocks you can do so by + registering Mocks with Camunda's method "Mocks.register(String key, Object value)". + Here the key describes a delegateExpression (as defined in BPMN model) and the value + describes the implementation of the code which should be executed + (Hint: You can put the real implementation as well as a fake one in there) + + Note: Most of the mocking methods seem to work only in combination with delegateExpressions + but not with class definitions as delegate implementation. + + If you have the path to your executable code (the class for delegate) as delegate implementation + then this guide is helpful: + https://blog.akquinet.de/2016/11/04/camunda-bpm-test-your-processes-based-on-plain-old-java-delegates/ + */ + autoMock("bpmn/mozilla_ssh_process.bpmn"); + + /* + Here we define a default behaviour for all the tasks in the BPMN model. + This behaviour can easily be overridden in test cases. + + The code inside the "thenReturn(...)" method specifies what should happen when process execution + waits at the given task + As a default behaviour we just complete the task and move on to the next one without changing anything + + Note that we have our own mock implementation in the last two when(...) statements. + This is because these tasks are external tasks which cannot be as easily completed as + ServiceTasks. They need an external worker to do so. + */ + when(process.waitsAtUserTask(Mockito.anyString())).thenReturn(TaskDelegate::complete); + when(process.waitsAtServiceTask(Mockito.anyString())).thenReturn(ExternalTaskDelegate::complete); + when(process.waitsAtServiceTask(DO_SCAN_TASK_ID)).thenReturn(task -> startExternalMockProcess("ssh-process")); + } + + @Test + public void testAutomatedStart_shouldPass() { + + ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_ID, defaultVariables); + + assertThat(processInstance).isStarted(); + } + + @Test + public void testManualStartWithDefaultConfiguration_shouldPass() { + ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_ID, defaultVariables); + + assertThat(processInstance).isStarted(); + assertThat(processInstance).isWaitingAt(DO_SCAN_TASK_ID); + } + + @Test + public void testManualRunWithApprovedTestResults() { + + Map variables = new HashMap<>(defaultVariables); + changeVariable(variables, DefaultFields.PROCESS_AUTOMATED.name(), false); + + when(process.waitsAtUserTask(APPROVE_RESULTS_TASK_ID)).thenReturn(task -> { + variables.put(DefaultFields.PROCESS_RESULT_APPROVED.name(), "approved"); + task.complete(variables); + }); + + /* + Here we register a custom mock. + The BPMN model TaskListener takes an injected field variable which cannot be mocked. + Therefore we create our own TaskListener with a dummy implementation and which also + holds the variable, that should be injected. + Then we register our TaskListener with "Mocks.register(...)" and it gets executed when the delegateExpression + is called. + */ + Mocks.register("setFormUrlListener", new TaskListener() { + + @Autowired + private Expression scanner_type; + + @Override + public void notify(DelegateTask delegateTask) { + } + }); + + Scenario scenario = Scenario.run(process).startByKey(PROCESS_ID, variables).execute(); + + assertThat(scenario.instance(process)).isEnded(); + assertThat(scenario.instance(process)).hasPassed(APPROVE_RESULTS_TASK_ID); + assertThat(scenario.instance(process)).variables() + .containsEntry(DefaultFields.PROCESS_RESULT_APPROVED.name(), "approved"); + } + + /** + * Executes an external process without doing anything in the task. + * In the first step the job is executed on the Camunda engine. Therefore the token for the + * provided topic gets pushed. Then an external service is called to pull the token and execute the task + * + * @param topic the topic for the external task + */ + private void startExternalMockProcess(String topic) { + + ExternalTaskService externalTaskService = processEngine().getExternalTaskService(); + List lockedExternalTasks = externalTaskService.fetchAndLock(1, "worker") + .topic(topic, 5000L) + .execute(); + + assertThat(lockedExternalTasks.size()).isEqualTo(1); + + LockedExternalTask task = lockedExternalTasks.get(0); + externalTaskService.complete(task.getId(), "worker"); + } + + private void changeVariable(Map variables, String key, Object value) { + + if (variables.containsKey(key)) { + variables.remove(key); + } + variables.put(key, value); + } + +} diff --git a/scb-scanprocesses/ssh-process/src/test/resources/camunda.cfg.xml b/scb-scanprocesses/ssh-process/src/test/resources/camunda.cfg.xml new file mode 100644 index 00000000..d5e7d6f9 --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/test/resources/camunda.cfg.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/scb-scanprocesses/ssh-process/src/test/resources/logback-test.xml b/scb-scanprocesses/ssh-process/src/test/resources/logback-test.xml new file mode 100644 index 00000000..81dcdbcd --- /dev/null +++ b/scb-scanprocesses/ssh-process/src/test/resources/logback-test.xml @@ -0,0 +1,27 @@ + + + + + + + + + + From ae5fd6138f5405e5d74b0276225b385ad6c94257 Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Wed, 20 Mar 2019 12:57:42 +0100 Subject: [PATCH 05/11] Test commit --- Dockerfile | 2 +- scb-engine/pom.xml | 2 +- .../src/main/resources/application-dev.yaml | 2 + .../main/resources/bpmn/default_process.bpmn | 2 +- scb-scanprocesses/mozilla-ssh-process/pom.xml | 53 ---- .../scanprocess/ProcessInitConfiguration.java | 36 --- .../src/main/resources/META-INF/processes.xml | 0 .../resources/bpmn/mozilla_ssh_process.bpmn | 197 --------------- .../forms.mozilla_ssh/approve-results.html | 124 ---------- .../test/MozillaSshProcessTest.java | 231 ------------------ .../src/test/resources/camunda.cfg.xml | 14 -- .../src/test/resources/logback-test.xml | 27 -- scb-scanprocesses/pom.xml | 2 +- scb-scanprocesses/ssh-process/pom.xml | 2 +- .../resources/bpmn/mozilla_ssh_process.bpmn | 4 +- .../forms.mozilla_ssh/configure-target.html | 128 ---------- .../approve-results.html | 0 .../forms.ssh}/configure-target.html | 0 .../delegate/SummaryGeneratorDelegate.java | 1 - 19 files changed, 9 insertions(+), 818 deletions(-) delete mode 100644 scb-scanprocesses/mozilla-ssh-process/pom.xml delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml delete mode 100644 scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml delete mode 100644 scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html rename scb-scanprocesses/ssh-process/src/main/resources/{forms.mozilla_ssh => forms.ssh}/approve-results.html (100%) rename scb-scanprocesses/{mozilla-ssh-process/src/main/resources/forms.mozilla_ssh => ssh-process/src/main/resources/forms.ssh}/configure-target.html (100%) diff --git a/Dockerfile b/Dockerfile index a7737952..23ac0f3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ COPY --from=builder ./scb-scanprocesses/combined-nmap-nikto-scanprocess/target/c COPY --from=builder ./scb-scanprocesses/sslyze-process/target/sslyze-process-0.0.1-SNAPSHOT.jar /scb-engine/lib/ COPY --from=builder ./scb-scanprocesses/arachni-process/target/arachni-process-1.0-SNAPSHOT.jar /scb-engine/lib/ COPY --from=builder ./scb-scanprocesses/subdomain-scanner-process/target/subdomain-scanner-process-1.0-SNAPSHOT.jar /scb-engine/lib/ -COPY --from=builder ./scb-scanprocesses/mozilla-ssh-process/target/mozilla-ssh-process-1.0-SNAPSHOT.jar /scb-engine/lib/ +COPY --from=builder ./scb-scanprocesses/ssh-process/target/ssh-process-1.0-SNAPSHOT.jar /scb-engine/lib/ COPY --from=builder ./scb-persistenceproviders/elasticsearch-persistenceprovider/target/elasticsearch-persistenceprovider-0.0.1-SNAPSHOT-jar-with-dependencies.jar /scb-engine/lib/ COPY --from=builder ./scb-persistenceproviders/s3-persistenceprovider/target/s3-persistenceprovider-0.0.1-SNAPSHOT-jar-with-dependencies.jar /scb-engine/lib/ diff --git a/scb-engine/pom.xml b/scb-engine/pom.xml index 7205d6e9..546dd88a 100644 --- a/scb-engine/pom.xml +++ b/scb-engine/pom.xml @@ -191,7 +191,7 @@ io.securecodebox.scanprocesses - mozilla-ssh-process + ssh-process 1.0-SNAPSHOT runtime diff --git a/scb-engine/src/main/resources/application-dev.yaml b/scb-engine/src/main/resources/application-dev.yaml index ee8d05b0..f8651eb1 100644 --- a/scb-engine/src/main/resources/application-dev.yaml +++ b/scb-engine/src/main/resources/application-dev.yaml @@ -12,3 +12,5 @@ logging.level.io.securecodebox: DEBUG securecodebox.rest.user.scanner-default: user-id: defaultScanner password: scan + +securecodebox.persistence.elasticsearch.enabled: "true" \ No newline at end of file diff --git a/scb-scanprocesses/archetype-process/src/main/resources/archetype-resources/src/main/resources/bpmn/default_process.bpmn b/scb-scanprocesses/archetype-process/src/main/resources/archetype-resources/src/main/resources/bpmn/default_process.bpmn index 6d2bc2e5..ca93f4aa 100644 --- a/scb-scanprocesses/archetype-process/src/main/resources/archetype-resources/src/main/resources/bpmn/default_process.bpmn +++ b/scb-scanprocesses/archetype-process/src/main/resources/archetype-resources/src/main/resources/bpmn/default_process.bpmn @@ -51,7 +51,7 @@ SequenceFlow_PortscanFinished - + SequenceFlow_ResultApproved SequenceFlow_1i44eck diff --git a/scb-scanprocesses/mozilla-ssh-process/pom.xml b/scb-scanprocesses/mozilla-ssh-process/pom.xml deleted file mode 100644 index bbeee5c0..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/pom.xml +++ /dev/null @@ -1,53 +0,0 @@ - - 4.0.0 - - - io.securecodebox.scanprocesses - default-process-collection - 0.0.1-SNAPSHOT - - - - mozilla-ssh-process - 1.0-SNAPSHOT - - - - io.securecodebox.core - sdk - ${project.parent.version} - - - - - com.h2database - h2 - - - org.camunda.bpm.springboot - camunda-bpm-spring-boot-starter-test - test - - - org.camunda.bpm.extension.mockito - camunda-bpm-mockito - test - - - org.camunda.bpm.extension - camunda-bpm-assert-scenario - test - - - org.camunda.bpm.extension - camunda-bpm-process-test-coverage - test - - - org.camunda.bpm.extension - camunda-bpm-assert - - - - diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java b/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java deleted file mode 100644 index 6912cde3..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/java/io/securecodebox/scanprocess/ProcessInitConfiguration.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * SecureCodeBox (SCB) - * Copyright 2015-2018 iteratec GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package io.securecodebox.scanprocess; - -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.Configuration; - -/** - * The secureCodeBox by default only scans for components in the package io.securecodebox.scanprocess. - *

- * This configuration ensures that your defined package package also gets scanned, please don't move or remove this configuration. - * - * @author Rüdiger Heins - iteratec GmbH - * @since 09.05.18 - */ -@ComponentScan("io.securecodebox.scanprocesses") -@Configuration -public class ProcessInitConfiguration { -} diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/META-INF/processes.xml deleted file mode 100644 index e69de29b..00000000 diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn deleted file mode 100644 index 678e7e15..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn +++ /dev/null @@ -1,197 +0,0 @@ - - - - - - - - - - - - - - SequenceFlow_TargetConfigured - - - - SequenceFlow_SummaryCreated - - - - - - - - SequenceFlow_ManualFinish - SequenceFlow_ResultReviewed - - - SequenceFlow_ResultReviewed - SequenceFlow_ResultApproved - SequenceFlow_ResultRejected - - - - - - SequenceFlow_PortscanFinished - SequenceFlow_ManualFinish - SequenceFlow_AutomatedFinish - - - ${PROCESS_AUTOMATED == false} - - - ${PROCESS_AUTOMATED == true} - - - - SequenceFlow_TargetConfigured - SequenceFlow_PortscanFinished - - - - - SequenceFlow_ResultApproved - SequenceFlow_1i44eck - SequenceFlow_AutomatedFinish - SequenceFlow_SummaryCreated - - - - - - - - SequenceFlow_ResultRejected - SequenceFlow_1i44eck - - - - results in a generic format - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html b/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html deleted file mode 100644 index b864accb..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html +++ /dev/null @@ -1,124 +0,0 @@ - - -

- - -
-

SSH scan results for "{{ target.name }}"

- -
-
-
{{ scannerId }}
-
-
-
-
{{ target.location }}
-
-
-
-
{{ context }}
-
-
-
- -
- - - - - - - - - - - - - - - -
Host:Name:Category:Severity:Reference:
{{ result.location }}{{ result.name }}{{ result.category }} -
- - - {{ result.severity }} - - - - - {{ result.severity }} - - - - - {{ result.severity }} - - - - - {{ result.severity }} - -
-
{{ result.reference.id }} -
-
-
- -
-
-

Approve Result

- -
- -
- - -
-
- diff --git a/scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java b/scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java deleted file mode 100644 index b95f3145..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/src/test/java/io/securecodebox/scanprocess/test/MozillaSshProcessTest.java +++ /dev/null @@ -1,231 +0,0 @@ -/* - * - * SecureCodeBox (SCB) - * Copyright 2015-2018 iteratec GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * / - */ - -package io.securecodebox.scanprocess.test; - -import io.securecodebox.constants.DefaultFields; -import io.securecodebox.scanprocess.delegate.SummaryGeneratorDelegate; -import org.camunda.bpm.engine.ExternalTaskService; -import org.camunda.bpm.engine.delegate.DelegateTask; -import org.camunda.bpm.engine.delegate.Expression; -import org.camunda.bpm.engine.delegate.TaskListener; -import org.camunda.bpm.engine.externaltask.LockedExternalTask; -import org.camunda.bpm.engine.runtime.ProcessInstance; -import org.camunda.bpm.engine.test.Deployment; -import org.camunda.bpm.engine.test.ProcessEngineRule; -import org.camunda.bpm.engine.test.mock.Mocks; -import org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRuleBuilder; -import org.camunda.bpm.scenario.ProcessScenario; -import org.camunda.bpm.scenario.Scenario; -import org.camunda.bpm.scenario.delegate.ExternalTaskDelegate; -import org.camunda.bpm.scenario.delegate.TaskDelegate; -import org.junit.Before; -import org.junit.ClassRule; -import org.junit.Ignore; -import org.junit.Rule; -import org.junit.Test; -import org.junit.runner.RunWith; -import org.mockito.Mock; -import org.mockito.Mockito; -import org.mockito.MockitoAnnotations; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import static org.camunda.bpm.engine.test.assertions.ProcessEngineTests.*; -import static org.camunda.bpm.extension.mockito.CamundaMockito.autoMock; -import static org.mockito.Mockito.when; - -/** - * This class tests the process execution of the Default-Process BPMN Model - * It verifies that each process task is called when it's supposed to be and - * delegation code is executed at the right time - *

- * The tests run in an own Camunda engine which is defined by the camunda.cfg.xml in the resources directory - *

- * The test cases use Camunda BPM's standard framework as well as the - * Camunda BPM Assert extension (), - * camunda-bpm-mockito () - * and the Camunda BPM Assert Scenario extension () - *

- * Furthermore this class also uses the Camunda BPM Process Test Coverage extension - * (). - * After the test is run we can examine the test coverage in the directory target/process-test-coverage - */ - -@RunWith(SpringJUnit4ClassRunner.class) -@Deployment(resources = "bpmn/mozilla_ssh_process.bpmn") - -@Ignore("Ignored until problems with camunda testing frameworks are handled. Introduces via update to camunda 7.10") -public class MozillaSshProcessTest { - - //Define the Process Activity IDs - private static final String PROCESS_ID = "ssh-process"; - private static final String DO_SCAN_TASK_ID = "ServiceTask_DoScan"; - private static final String CREATE_REPORT_TASK_ID = "ServiceTask_CreateSummary"; - private static final String APPROVE_RESULTS_TASK_ID = "UserTask_ApproveResults"; - - private final Map defaultVariables = new HashMap<>(); - - @Rule - @ClassRule - public static ProcessEngineRule processEngineRule = TestCoverageProcessEngineRuleBuilder.create().build(); - - @Mock - private ProcessScenario process; - - @Mock - SummaryGeneratorDelegate delegate; - - /** - * Executed before every test-case - * In this method default variables for the process and a default behaviour for the mocks - * in the process are defined+ - */ - @Before - public void init() { - - MockitoAnnotations.initMocks(this); - - //Creating a map of default variables for the process - defaultVariables.put(DefaultFields.PROCESS_AUTOMATED.name(), true); - defaultVariables.put(DefaultFields.PROCESS_CONTEXT.name(), "BodgeIT"); - - /* - Mocking everything in the BPMN Model - This includes ExecutionListeners, TaskListeners, JavaDelegates, etc. - Simply stated: Everything, that's executable code - - If you need to define custom behaviour for the Mocks you can do so by - registering Mocks with Camunda's method "Mocks.register(String key, Object value)". - Here the key describes a delegateExpression (as defined in BPMN model) and the value - describes the implementation of the code which should be executed - (Hint: You can put the real implementation as well as a fake one in there) - - Note: Most of the mocking methods seem to work only in combination with delegateExpressions - but not with class definitions as delegate implementation. - - If you have the path to your executable code (the class for delegate) as delegate implementation - then this guide is helpful: - https://blog.akquinet.de/2016/11/04/camunda-bpm-test-your-processes-based-on-plain-old-java-delegates/ - */ - autoMock("bpmn/mozilla_ssh_process.bpmn"); - - /* - Here we define a default behaviour for all the tasks in the BPMN model. - This behaviour can easily be overridden in test cases. - - The code inside the "thenReturn(...)" method specifies what should happen when process execution - waits at the given task - As a default behaviour we just complete the task and move on to the next one without changing anything - - Note that we have our own mock implementation in the last two when(...) statements. - This is because these tasks are external tasks which cannot be as easily completed as - ServiceTasks. They need an external worker to do so. - */ - when(process.waitsAtUserTask(Mockito.anyString())).thenReturn(TaskDelegate::complete); - when(process.waitsAtServiceTask(Mockito.anyString())).thenReturn(ExternalTaskDelegate::complete); - when(process.waitsAtServiceTask(DO_SCAN_TASK_ID)).thenReturn(task -> startExternalMockProcess("ssh-process")); - } - - @Test - public void testAutomatedStart_shouldPass() { - - ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_ID, defaultVariables); - - assertThat(processInstance).isStarted(); - } - - @Test - public void testManualStartWithDefaultConfiguration_shouldPass() { - ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(PROCESS_ID, defaultVariables); - - assertThat(processInstance).isStarted(); - assertThat(processInstance).isWaitingAt(DO_SCAN_TASK_ID); - } - - @Test - public void testManualRunWithApprovedTestResults() { - - Map variables = new HashMap<>(defaultVariables); - changeVariable(variables, DefaultFields.PROCESS_AUTOMATED.name(), false); - - when(process.waitsAtUserTask(APPROVE_RESULTS_TASK_ID)).thenReturn(task -> { - variables.put(DefaultFields.PROCESS_RESULT_APPROVED.name(), "approved"); - task.complete(variables); - }); - - /* - Here we register a custom mock. - The BPMN model TaskListener takes an injected field variable which cannot be mocked. - Therefore we create our own TaskListener with a dummy implementation and which also - holds the variable, that should be injected. - Then we register our TaskListener with "Mocks.register(...)" and it gets executed when the delegateExpression - is called. - */ - Mocks.register("setFormUrlListener", new TaskListener() { - - @Autowired - private Expression scanner_type; - - @Override - public void notify(DelegateTask delegateTask) { - } - }); - - Scenario scenario = Scenario.run(process).startByKey(PROCESS_ID, variables).execute(); - - assertThat(scenario.instance(process)).isEnded(); - assertThat(scenario.instance(process)).hasPassed(APPROVE_RESULTS_TASK_ID); - assertThat(scenario.instance(process)).variables() - .containsEntry(DefaultFields.PROCESS_RESULT_APPROVED.name(), "approved"); - } - - /** - * Executes an external process without doing anything in the task. - * In the first step the job is executed on the Camunda engine. Therefore the token for the - * provided topic gets pushed. Then an external service is called to pull the token and execute the task - * - * @param topic the topic for the external task - */ - private void startExternalMockProcess(String topic) { - - ExternalTaskService externalTaskService = processEngine().getExternalTaskService(); - List lockedExternalTasks = externalTaskService.fetchAndLock(1, "worker") - .topic(topic, 5000L) - .execute(); - - assertThat(lockedExternalTasks.size()).isEqualTo(1); - - LockedExternalTask task = lockedExternalTasks.get(0); - externalTaskService.complete(task.getId(), "worker"); - } - - private void changeVariable(Map variables, String key, Object value) { - - if (variables.containsKey(key)) { - variables.remove(key); - } - variables.put(key, value); - } - -} diff --git a/scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml b/scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml deleted file mode 100644 index d5e7d6f9..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/src/test/resources/camunda.cfg.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml b/scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml deleted file mode 100644 index 81dcdbcd..00000000 --- a/scb-scanprocesses/mozilla-ssh-process/src/test/resources/logback-test.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - diff --git a/scb-scanprocesses/pom.xml b/scb-scanprocesses/pom.xml index ec015bf0..4052be07 100644 --- a/scb-scanprocesses/pom.xml +++ b/scb-scanprocesses/pom.xml @@ -23,7 +23,7 @@ combined-amass-nmap-process arachni-process subdomain-scanner-process - mozilla-ssh-process + ssh-process \ No newline at end of file diff --git a/scb-scanprocesses/ssh-process/pom.xml b/scb-scanprocesses/ssh-process/pom.xml index f8bc97da..9b1d9897 100644 --- a/scb-scanprocesses/ssh-process/pom.xml +++ b/scb-scanprocesses/ssh-process/pom.xml @@ -8,7 +8,7 @@ 0.0.1-SNAPSHOT - + io.securecodebox.scanprocesses ssh-process 1.0-SNAPSHOT diff --git a/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn b/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn index da2b67e8..ef222bab 100644 --- a/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn +++ b/scb-scanprocesses/ssh-process/src/main/resources/bpmn/mozilla_ssh_process.bpmn @@ -1,7 +1,7 @@ - + @@ -19,7 +19,7 @@ - + diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html b/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html deleted file mode 100644 index 0dd40bed..00000000 --- a/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html +++ /dev/null @@ -1,128 +0,0 @@ - - -

Please configure the SSH Scan

- -
- - - -
- -
-

SSH scan Target

- - -
-
-
- - -
-
- - -
-
- -
-
- - -
- - -
- -
- -
-
- -
-
-
diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html b/scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/approve-results.html similarity index 100% rename from scb-scanprocesses/ssh-process/src/main/resources/forms.mozilla_ssh/approve-results.html rename to scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/approve-results.html diff --git a/scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html b/scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/configure-target.html similarity index 100% rename from scb-scanprocesses/mozilla-ssh-process/src/main/resources/forms.mozilla_ssh/configure-target.html rename to scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/configure-target.html diff --git a/scb-sdk/src/main/java/io/securecodebox/scanprocess/delegate/SummaryGeneratorDelegate.java b/scb-sdk/src/main/java/io/securecodebox/scanprocess/delegate/SummaryGeneratorDelegate.java index 2ebbecc8..a460b1b7 100644 --- a/scb-sdk/src/main/java/io/securecodebox/scanprocess/delegate/SummaryGeneratorDelegate.java +++ b/scb-sdk/src/main/java/io/securecodebox/scanprocess/delegate/SummaryGeneratorDelegate.java @@ -54,7 +54,6 @@ public class SummaryGeneratorDelegate implements JavaDelegate { @Override public void execute(DelegateExecution delegateExecution) { - List findings = new LinkedList<>(ProcessVariableHelper.readListFromValue( (String) delegateExecution.getVariable(DefaultFields.PROCESS_FINDINGS.name()), Finding.class)); removeDuplicates(findings); From bd7080db2815a1164c1c1e89e84a4a8e7b5f138c Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Wed, 20 Mar 2019 13:24:43 +0100 Subject: [PATCH 06/11] fixed forms directory --- .../main/resources/{forms.ssh => forms/ssh}/approve-results.html | 0 .../main/resources/{forms.ssh => forms/ssh}/configure-target.html | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename scb-scanprocesses/ssh-process/src/main/resources/{forms.ssh => forms/ssh}/approve-results.html (100%) rename scb-scanprocesses/ssh-process/src/main/resources/{forms.ssh => forms/ssh}/configure-target.html (100%) diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/approve-results.html b/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html similarity index 100% rename from scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/approve-results.html rename to scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/configure-target.html b/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/configure-target.html similarity index 100% rename from scb-scanprocesses/ssh-process/src/main/resources/forms.ssh/configure-target.html rename to scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/configure-target.html From ab5b6ef0db0cb2679e9fd95ebfbe759fdd7e9259 Mon Sep 17 00:00:00 2001 From: Daniel Patanin Date: Mon, 25 Mar 2019 09:59:54 +0100 Subject: [PATCH 07/11] Fix forms naming issue --- .../src/main/resources/forms/ssh/approve-results.html | 1 - .../src/main/resources/forms/ssh/configure-target.html | 1 - 2 files changed, 2 deletions(-) diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html b/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html index c58e7ed2..8e18ecae 100644 --- a/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html +++ b/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html @@ -51,7 +51,6 @@

SSH scan results for "{{ target.name }}"

{{ context }}
-
Scanner Results "{{ $scope.scannerResult }}"
Please configure the SSH Scan }); camForm.on('submit', function () { - camForm.variableManager.destroyVariable('PROCESS_TARGETS'); camForm.variableManager.createVariable({ name: 'PROCESS_TARGETS', type: 'Object', From 707537079fd9f85a3ee3b72ee7b6292db42677f4 Mon Sep 17 00:00:00 2001 From: Jannik Hollenbach Date: Wed, 10 Apr 2019 14:58:22 +0200 Subject: [PATCH 08/11] Added description to result display --- .../src/main/resources/forms/ssh/approve-results.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html b/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html index 8e18ecae..051bdfd0 100644 --- a/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html +++ b/scb-scanprocesses/ssh-process/src/main/resources/forms/ssh/approve-results.html @@ -59,6 +59,7 @@

SSH scan results for "{{ target.name }}"

Host: Name: + Description: Category: Severity: Reference: @@ -66,6 +67,7 @@

SSH scan results for "{{ target.name }}"

{{ result.location }} {{ result.name }} + {{ result.description }} {{ result.category }}
@@ -94,8 +96,7 @@

SSH scan results for "{{ target.name }}"

- {{ result.reference.id }} - + {{ result.reference.id }}
From e57015a97c20b5f2d48df375ab95eca8c474cfe1 Mon Sep 17 00:00:00 2001 From: Jannik Hollenbach Date: Wed, 17 Apr 2019 09:37:13 +0200 Subject: [PATCH 09/11] Accept "/" in nmap target locations to support slash ranges --- .../resources/forms/nmap/configure-port-scanner-target.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scb-scanprocesses/nmap-process/src/main/resources/forms/nmap/configure-port-scanner-target.html b/scb-scanprocesses/nmap-process/src/main/resources/forms/nmap/configure-port-scanner-target.html index c5e1ddd2..65812953 100644 --- a/scb-scanprocesses/nmap-process/src/main/resources/forms/nmap/configure-port-scanner-target.html +++ b/scb-scanprocesses/nmap-process/src/main/resources/forms/nmap/configure-port-scanner-target.html @@ -97,7 +97,7 @@

Portscan Target

ng-minlength="2" ng-maxlength="256" ng-model="target.location" - ng-pattern="/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$/" + ng-pattern="/^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-\/]*[A-Za-z0-9])$/" ng-keydown="checkForEnter($event)" />
From fb03bf7d70e93a40859111a05f4daa347d177e16 Mon Sep 17 00:00:00 2001 From: snyk-bot Date: Wed, 24 Apr 2019 07:11:04 +0000 Subject: [PATCH 10/11] fix: pom.xml to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JAVA-ORGSPRINGFRAMEWORKSECURITY-174111 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6970ff7b..cb8ef41b 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 3.2.0 - 2.1.2.RELEASE + 2.1.4.RELEASE 2.9.0 UTF-8 From 3d9f1ba075f53a69148ed4aa32d159c887442ff1 Mon Sep 17 00:00:00 2001 From: Jannik Hollenbach Date: Wed, 24 Apr 2019 14:51:35 +0200 Subject: [PATCH 11/11] Suppresses CVE-2019-0232, only relevant for windows systems --- dependency-check-suppression.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dependency-check-suppression.xml b/dependency-check-suppression.xml index 26b693ba..55143e31 100644 --- a/dependency-check-suppression.xml +++ b/dependency-check-suppression.xml @@ -38,5 +38,12 @@ CVE-2016-5425 + + + CVE-2019-0232 + +