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
bf28be98
Commit
bf28be98
authored
3 years ago
by
Odin K. Henriksen
Browse files
Options
Downloads
Patches
Plain Diff
Escalate to manual analysis
parent
d0a36747
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
main.go
+3
-4
3 additions, 4 deletions
main.go
threat-total/src/pages/result.js
+21
-3
21 additions, 3 deletions
threat-total/src/pages/result.js
with
24 additions
and
7 deletions
main.go
+
3
−
4
View file @
bf28be98
...
@@ -161,17 +161,16 @@ func main() {
...
@@ -161,17 +161,16 @@ func main() {
url
:=
c
.
Query
(
"url"
)
url
:=
c
.
Query
(
"url"
)
result
:=
c
.
Query
(
"result"
)
result
:=
c
.
Query
(
"result"
)
api
.
EscalateAnalysis
(
url
,
result
,
token
)
//
api.EscalateAnalysis(url, result, token)
/**
authenticated, _ := auth.Authenticate("", token)
authenticated
,
_
:=
auth
.
Authenticate
(
""
,
token
)
if
!
authenticated
{
if
!
authenticated
{
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
,
nil
)
}
}
*/
})
})
log
.
Fatal
(
r
.
Run
(
":8081"
))
log
.
Fatal
(
r
.
Run
(
":8081"
))
...
...
This diff is collapsed.
Click to expand it.
threat-total/src/pages/result.js
+
21
−
3
View file @
bf28be98
...
@@ -146,9 +146,7 @@ function Result() {
...
@@ -146,9 +146,7 @@ function Result() {
{
isLoading
?
<
Oval
height
=
"
100
"
width
=
"
100
"
color
=
"
grey
"
/>
:
renderResult
}
{
isLoading
?
<
Oval
height
=
"
100
"
width
=
"
100
"
color
=
"
grey
"
/>
:
renderResult
}
<
/div
>
<
/div
>
<
div
className
=
"
container w-full mb-3 sm:pl-36 sm:pr-36 flex justify-center overflow-hidden
"
>
<
div
className
=
"
container w-full mb-3 sm:pl-36 sm:pr-36 flex justify-center overflow-hidden
"
>
<
a
href
=
"
./investigate
"
>
<
button
onClick
=
{()
=>
EscalateAnalysis
(
url
,
userAuth
)}
className
=
"
bg-orange-500 p-2 rounded justify-center
"
>
{
t
(
"
manualAnalysisBtn
"
)}
<
/button
>
<
button
className
=
"
bg-orange-500 p-2 rounded justify-center
"
>
{
t
(
"
manualAnalysisBtn
"
)}
<
/button
>
<
/a
>
<
/div
>
<
/div
>
<
CookieDisclosure
/>
<
CookieDisclosure
/>
...
@@ -157,4 +155,24 @@ function Result() {
...
@@ -157,4 +155,24 @@ function Result() {
);
);
}
}
function
EscalateAnalysis
(
url
,
userAuth
){
fetch
(
process
.
env
.
REACT_APP_BACKEND_URL
+
'
/escalate?url=
'
+
url
+
"
&result=
"
+
window
.
location
.
href
+
"
&userAuth=
"
+
userAuth
,
{
method
:
'
GET
'
,
headers
:
{
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
}
}).
then
((
response
)
=>
response
.
json
())
.
then
((
json
)
=>
{
// If the authentication response is invalid remove the authentication
// locally and redirect to the login page.
if
(
json
.
authenticated
!==
undefined
){
localStorage
.
removeItem
(
'
userAuth
'
)
window
.
location
.
href
=
"
/login
"
}
})
window
.
alert
(
"
An email has been sent informing you about the escalation to manual analysis, futher contact will be made by email
"
)
}
export
default
Result
;
export
default
Result
;
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