Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DCSG2900-ThreatTotal
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johannes Barstad
DCSG2900-ThreatTotal
Commits
7131cd4e
Commit
7131cd4e
authored
May 14, 2022
by
Odin K. Henriksen
Browse files
Options
Downloads
Plain Diff
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
!2
Merge react-branch into main.
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/virustotal.go
+1
-3
1 addition, 3 deletions
api/virustotal.go
main.go
+5
-5
5 additions, 5 deletions
main.go
with
6 additions
and
8 deletions
api/virustotal.go
+
1
−
3
View file @
7131cd4e
...
@@ -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
.
TotalVote
s
.
Malicious
>
0
&&
vtResponse
.
Data
.
Attributes
.
LastAnalysisStats
.
Suspicious
>=
0
{
}
else
if
vtResponse
.
Data
.
Attributes
.
LastAnalysisStat
s
.
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
{
...
...
This diff is collapsed.
Click to expand it.
main.go
+
5
−
5
View file @
7131cd4e
...
@@ -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"
}
)
}
}
})
})
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment