Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix/remove unused deps #1026

Merged
merged 9 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"commands": [
"export AKTO_MONGO_CONN=\"mongodb://localhost:27017\"",
"export DASHBOARD_MODE=\"local_deploy\"",
"export NUCLEI_EXECUTABLE_PATH=apps/testing/src/main/resources/nuclei_linux",
"java -jar apps/testing/target/testing-1.0-SNAPSHOT-jar-with-dependencies.jar"
]
}
Expand Down Expand Up @@ -106,7 +105,6 @@
"commands": [
"export AKTO_MONGO_CONN=\"mongodb://localhost:27017\"",
"export DASHBOARD_MODE=\"local_deploy\"",
"export NUCLEI_EXECUTABLE_PATH=apps/testing/src/main/resources/nuclei_linux",
"java -jar apps/testing/target/testing-1.0-SNAPSHOT-jar-with-dependencies.jar"
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,6 @@ public String fetchIssueFromTestRunResultDetails() {
// name = category
String category = result.getTestSubType();
TestSourceConfig config = null;
// string comparison (nuclei test)
if (category.startsWith("http")) {
config = TestSourceConfigsDao.instance.getTestSourceConfig(result.getTestSubType());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ public String fetchAllIssues() {
issues = TestingRunIssuesDao.instance.findAll(filters, skip,limit, sort);

for (TestingRunIssues runIssue : issues) {
// string comparison (nuclei test)
if (runIssue.getId().getTestSubCategory().startsWith("http")) {//TestSourceConfig case
TestSourceConfig config = TestSourceConfigsDao.instance.getTestSourceConfig(runIssue.getId().getTestCategoryFromSourceConfig());
runIssue.getId().setTestSourceConfig(config);
Expand Down Expand Up @@ -172,7 +171,6 @@ public String fetchTestingRunResult() {
String testSubType = null;
// ?? enum stored in db
String subCategory = issue.getId().getTestSubCategory();
// string comparison (nuclei test)
if (subCategory.startsWith("http")) {
testSubType = issue.getId().getTestCategoryFromSourceConfig();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@
</template>
<template slot="Attempt" v-if="jsonAdvance && jsonAdvance['message']">
<div >
<div v-if="getNucleiFileName(testingRunResult.testSubType)" style="margin-left: 24px" class="description-title mt-4" >
<span> Nuclei template:</span>
<a target="_blank" :href="testingRunResult.testSubType"> <span style="color: var(--rgbaColor7)" >{{getNucleiFileName(testingRunResult.testSubType)}}</span> </a>
</div>

<div v-if="jsonBasic['errors']" class="test-errors-class">
{{ this.jsonBasic["errors"] }}
</div>
Expand Down Expand Up @@ -166,9 +163,6 @@ export default {
}
},
methods: {
getNucleiFileName(path) {
return path.startsWith("http") ? path.substring(path.lastIndexOf('/')+1) : null
},
getTabsContent() {
if (this.messagesBasic.length > 1) {
return { 'Attempt': this.messagesBasic.length }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ private void writeUpdateQueryIntoWriteModel(List<WriteModel<TestingRunIssues>> w

// name = cateogry
String subCategory = runResult.getTestSubType();
// string comparison (nuclei test)

if (subCategory.startsWith("http")) {//TestSourceConfig case
TestSourceConfig config = TestSourceConfigsDao.instance.getTestSourceConfig(runResult.getTestSubType());
Expand Down Expand Up @@ -113,7 +112,6 @@ private void insertVulnerableTestsIntoIssuesCollection(List<WriteModel<TestingRu
if (!doesExists && runResult.isVulnerable()) {
// name = category
String subCategory = runResult.getTestSubType();
// string comparison (nuclei test)
if (subCategory.startsWith("http")) {
TestSourceConfig config = TestSourceConfigsDao.instance.getTestSourceConfig(runResult.getTestSubType());
writeModelList.add(new InsertOneModel<>(new TestingRunIssues(testingIssuesId,
Expand Down
4 changes: 1 addition & 3 deletions libs/dao/src/main/java/com/akto/DaoInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.akto.dto.test_run_findings.TestingRunIssues;
import com.akto.dto.testing.*;
import com.akto.dto.testing.info.BFLATestInfo;
import com.akto.dto.testing.info.NucleiTestInfo;
import com.akto.dto.testing.info.TestInfo;
import com.akto.dto.testing.sources.TestSourceConfig;
import com.akto.dto.third_party_access.Credential;
Expand Down Expand Up @@ -204,7 +203,6 @@ public static CodecRegistry createCodecRegistry(){
ClassModel<AktoDataType> AktoDataTypeClassModel = ClassModel.builder(AktoDataType.class).enableDiscriminator(true).build();
ClassModel<TestInfo> testInfoClassModel = ClassModel.builder(TestInfo.class).enableDiscriminator(true).build();
ClassModel<BFLATestInfo> bflaTestInfoClassModel = ClassModel.builder(BFLATestInfo.class).enableDiscriminator(true).build();
ClassModel<NucleiTestInfo> nucleiTestInfoClassModel = ClassModel.builder(NucleiTestInfo.class).enableDiscriminator(true).build();
ClassModel<AccessMatrixUrlToRole> accessMatrixUrlToRoleClassModel = ClassModel.builder(AccessMatrixUrlToRole.class).enableDiscriminator(true).build();
ClassModel<AccessMatrixTaskInfo> accessMatrixTaskInfoClassModel = ClassModel.builder(AccessMatrixTaskInfo.class).enableDiscriminator(true).build();
ClassModel<Loader> loaderClassModel = ClassModel.builder(Loader.class).enableDiscriminator(true).build();
Expand Down Expand Up @@ -255,7 +253,7 @@ public static CodecRegistry createCodecRegistry(){
cappedSetClassModel, CustomWebhookClassModel, WorkflowNodeDetailsClassModel, CustomWebhookResultClassModel,
nodeResultClassModel, awsResourcesModel, AktoDataTypeClassModel, testingRunIssuesClassModel,
testingIssuesIdClassModel, testSourceConfigClassModel, endpointLogicalGroupClassModel, testRolesClassModel,
logicalGroupTestingEndpointClassModel, testInfoClassModel, bflaTestInfoClassModel, nucleiTestInfoClassModel, customAuthTypeModel,
logicalGroupTestingEndpointClassModel, testInfoClassModel, bflaTestInfoClassModel, customAuthTypeModel,
containsPredicateClassModel, notBelongsToPredicateClassModel, belongsToPredicateClassModel, loginFlowStepsData,
accessMatrixUrlToRoleClassModel, accessMatrixTaskInfoClassModel,
loaderClassModel, normalLoaderClassModel, postmanUploadLoaderClassModel, aktoGptConfigClassModel,
Expand Down
2 changes: 0 additions & 2 deletions libs/dao/src/main/java/com/akto/dto/testing/TestResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ public enum TestError {
FAILED_TO_CONVERT_TEST_REQUEST_TO_STRING("Failed to store test", false),
INSUFFICIENT_MESSAGES("Insufficient messages", false),
NO_AUTH_TOKEN_FOUND("No authentication token found", false),
FAILED_DOWNLOADING_NUCLEI_TEMPLATE("Failed downloading nuclei template", false),
FAILED_DOWNLOADING_PAYLOAD_FILES("Failed downloading payload files", false),
FAILED_BUILDING_URL_WITH_DOMAIN("Failed building URL with domain", false),
FAILED_REPLACING_VARIABLES_IN_NUCLEI_TEMPLATE("Failed replacing variables in nuclei template", false),
EXECUTION_FAILED("Test execution failed", false),
INVALID_EXECUTION_BLOCK("Invalid test execution block in template", true),
NO_API_REQUEST("No test requests created", false),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,43 +1 @@
package com.akto.dto.testing.info;

public class NucleiTestInfo extends TestInfo {

private String subcategory;
private String templatePath;

public NucleiTestInfo() {
super();
}

public NucleiTestInfo(String subcategory, String templatePath) {
super();
this.subcategory = subcategory;
this.templatePath = templatePath;
}

public String getSubcategory() {
return this.subcategory;
}

public void setSubcategory(String subcategory) {
this.subcategory = subcategory;
}

public String getTemplatePath() {
return this.templatePath;
}

public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

@Override
public String toString() {
return "{" +
" subcategory='" + getSubcategory() + "'" +
", templatePath='" + getTemplatePath() + "'" +
"}";
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ public static Map<TestingIssuesId, TestingRunResult> listOfIssuesIdsFromTestingR
TestSourceConfig config = null;
// name = subtype
String subCategory = subType;
// string comparison (nuclei test)
if (subCategory.startsWith("http")) {//Issue came from custom template
config = TestSourceConfigsDao.instance.getTestSourceConfig(subType);
}
Expand Down
Loading