Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Paas CI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
INFN Cloud
Paas CI
Commits
3f164b24
Commit
3f164b24
authored
10 months ago
by
Gioacchino Vino
Browse files
Options
Downloads
Patches
Plain Diff
Added logic accepted/know issues during oid validation
parent
9490708a
No related branches found
No related tags found
1 merge request
!147
Debug paas ci
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
files/gvm_library.py
+5
-2
5 additions, 2 deletions
files/gvm_library.py
files/scan.py
+9
-1
9 additions, 1 deletion
files/scan.py
with
14 additions
and
3 deletions
files/gvm_library.py
+
5
−
2
View file @
3f164b24
...
@@ -449,7 +449,7 @@ class Task:
...
@@ -449,7 +449,7 @@ class Task:
def
get_report_info
(
self
,
def
get_report_info
(
self
,
accepted_issues
:
List
[
str
],
accepted_issues
:
List
[
str
],
known_issues
:
List
[
str
])
->
Tuple
[
Dict
,
List
[
str
]]:
known_issues
:
List
[
str
])
->
Tuple
[
Dict
,
List
[
str
]
,
List
[
str
]
]:
report
=
dict
()
report
=
dict
()
accepted_oids
=
[]
accepted_oids
=
[]
new_oids
=
[]
new_oids
=
[]
...
@@ -489,7 +489,10 @@ class Task:
...
@@ -489,7 +489,10 @@ class Task:
glob_severity
=
s
glob_severity
=
s
glob_threat
=
t
glob_threat
=
t
report
[
'
global
'
]
=
{
'
threat
'
:
glob_threat
,
'
severity
'
:
glob_severity
}
report
[
'
global
'
]
=
{
'
threat
'
:
glob_threat
,
'
severity
'
:
glob_severity
}
logging
.
debug
(
"
accepted
"
)
logging
.
debug
(
accepted_oids
)
logging
.
debug
(
"
new
"
)
logging
.
debug
(
new_oids
)
return
report
,
accepted_oids
,
new_oids
return
report
,
accepted_oids
,
new_oids
class
GVMClient
():
class
GVMClient
():
...
...
This diff is collapsed.
Click to expand it.
files/scan.py
+
9
−
1
View file @
3f164b24
...
@@ -132,6 +132,14 @@ for host,ports in endpoints.items():
...
@@ -132,6 +132,14 @@ for host,ports in endpoints.items():
task
.
get_report_info
(
accepted_issues
,
known_issues
)
task
.
get_report_info
(
accepted_issues
,
known_issues
)
accepted_oids
+=
task_accepted_oids
accepted_oids
+=
task_accepted_oids
new_oids
+=
task_new_oids
new_oids
+=
task_new_oids
logging
.
debug
(
"
task_accepted_oids
"
)
logging
.
debug
(
task_accepted_oids
)
logging
.
debug
(
"
task_new_oids
"
)
logging
.
debug
(
task_new_oids
)
logging
.
debug
(
"
accepted_oids
"
)
logging
.
debug
(
accepted_oids
)
logging
.
debug
(
"
new_oids
"
)
logging
.
debug
(
new_oids
)
else
:
else
:
reports
[
host
]
=
{
'
global
'
:
{
"
severity
"
:
-
1
,
"
threat
"
:
f
"
Scan Error. task.id:
{
task
.
id
}
"
}
}
reports
[
host
]
=
{
'
global
'
:
{
"
severity
"
:
-
1
,
"
threat
"
:
f
"
Scan Error. task.id:
{
task
.
id
}
"
}
}
...
@@ -153,7 +161,7 @@ if len(accepted_oids) > 1:
...
@@ -153,7 +161,7 @@ if len(accepted_oids) > 1:
f
.
writelines
([
msg
+
"
\n
"
for
msg
in
accepted_oids
])
f
.
writelines
([
msg
+
"
\n
"
for
msg
in
accepted_oids
])
f
.
write
(
"
\n
"
)
f
.
write
(
"
\n
"
)
if
len
(
accepted
_oids
)
>
1
:
if
len
(
new
_oids
)
>
1
:
with
open
(
oids_filename
,
"
a
"
)
as
f
:
with
open
(
oids_filename
,
"
a
"
)
as
f
:
f
.
write
(
"
NEW OIDs
\n
"
)
f
.
write
(
"
NEW OIDs
\n
"
)
f
.
writelines
([
msg
+
"
\n
"
for
msg
in
new_oids
])
f
.
writelines
([
msg
+
"
\n
"
for
msg
in
new_oids
])
\ No newline at end of file
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