Skip to content
Snippets Groups Projects
Commit 7131cd4e authored by Odin K. Henriksen's avatar Odin K. Henriksen
Browse files

Merge branch 'React-Branch' of git.gvk.idi.ntnu.no:Johannesb/dcsg2900-threattotal into React-Branch

parents 3efb7a27 049de71b
No related branches found
No related tags found
1 merge request!2Merge react-branch into main.
...@@ -101,15 +101,13 @@ func CallVirusTotal(id string) (response utils.ResultFrontendResponse, err error ...@@ -101,15 +101,13 @@ func CallVirusTotal(id string) (response utils.ResultFrontendResponse, err error
totalDanger := vtResponse.Data.Attributes.LastAnalysisStats.Malicious + vtResponse.Data.Attributes.LastAnalysisStats.Suspicious totalDanger := vtResponse.Data.Attributes.LastAnalysisStats.Malicious + vtResponse.Data.Attributes.LastAnalysisStats.Suspicious
response.FrontendResponse = sortDanger(testStruct2, totalDanger, i-totalDanger) response.FrontendResponse = sortDanger(testStruct2, totalDanger, i-totalDanger)
// IMPORTANT TODO, FIGURE ROUTING
// Possible to add more cases in the future, for more accurate assessements // Possible to add more cases in the future, for more accurate assessements
// very realisitc that we need more cases, too narrow for accurate results per now.
if vtResponse.Data.Attributes.LastAnalysisStats.Malicious == 0 && vtResponse.Data.Attributes.LastAnalysisStats.Suspicious == 0 { if vtResponse.Data.Attributes.LastAnalysisStats.Malicious == 0 && vtResponse.Data.Attributes.LastAnalysisStats.Suspicious == 0 {
response.EN.Result = "File is safe." response.EN.Result = "File is safe."
response.NO.Result = "Filen er trygg" response.NO.Result = "Filen er trygg"
// osv response.EN.Result = fmt.Sprintf("File is considered safe", x av y) // osv response.EN.Result = fmt.Sprintf("File is considered safe", x av y)
} else if vtResponse.Data.Attributes.TotalVotes.Malicious > 0 && vtResponse.Data.Attributes.LastAnalysisStats.Suspicious >= 0 { } else if vtResponse.Data.Attributes.LastAnalysisStats.Malicious > 0 && vtResponse.Data.Attributes.LastAnalysisStats.Suspicious >= 0 {
response.EN.Result = "File has malicious indicators, consider escalating to the NTNU SOC. " response.EN.Result = "File has malicious indicators, consider escalating to the NTNU SOC. "
response.NO.Result = "Filen har ondsinnede indikatorer, vennligst vurder å eskalere videre til NTNU SOC" response.NO.Result = "Filen har ondsinnede indikatorer, vennligst vurder å eskalere videre til NTNU SOC"
} else if vtResponse.Data.Attributes.LastAnalysisStats.Harmless > 0 && vtResponse.Data.Attributes.LastAnalysisStats.Malicious == 0 { } else if vtResponse.Data.Attributes.LastAnalysisStats.Harmless > 0 && vtResponse.Data.Attributes.LastAnalysisStats.Malicious == 0 {
......
...@@ -168,7 +168,7 @@ func main() { ...@@ -168,7 +168,7 @@ func main() {
c.JSON(http.StatusUnauthorized, gin.H{"authenticated": "You are not authenticated. User login is invalid."}) c.JSON(http.StatusUnauthorized, gin.H{"authenticated": "You are not authenticated. User login is invalid."})
} else { } else {
api.EscalateAnalysis(url, result, token) api.EscalateAnalysis(url, result, token)
c.JSON(http.StatusOK, nil) c.JSON(http.StatusOK, gin.H{"Successfull": "yes"})
} }
}) })
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment