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
11d909d9
Commit
11d909d9
authored
11 months ago
by
Gioacchino Vino
Browse files
Options
Downloads
Patches
Plain Diff
Reviewed code
parent
027caa77
No related branches found
No related tags found
1 merge request
!142
Reviewed code
Pipeline
#167994
failed
11 months ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
files/gvm_library.py
+4
-2
4 additions, 2 deletions
files/gvm_library.py
files/scan.py
+5
-7
5 additions, 7 deletions
files/scan.py
with
9 additions
and
9 deletions
files/gvm_library.py
+
4
−
2
View file @
11d909d9
...
...
@@ -89,7 +89,6 @@ class PortList:
# Search port_lists by id/name
def
__get_info
(
self
,
filter
:
str
=
"
rows=-1
"
)
->
List
[
Dict
[
str
,
str
]]:
res
=
[]
logging
.
info
(
f
"
gvm_client
\n
{
dir
(
self
.
client
)
}
"
)
pls
=
self
.
client
.
get_port_lists
(
filter_string
=
filter
)
\
.
xpath
(
'
port_list
'
)
...
...
@@ -513,7 +512,10 @@ class GVMClient():
self
.
client
.
authenticate
(
self
.
auth_name
,
self
.
auth_passwd
)
logging
.
debug
(
'
GMP Client Authenticated
'
)
def
get_client
(
self
):
return
self
.
client
def
get_version
(
self
)
->
str
:
res
=
self
.
client
.
get_version
()
return
str
(
res
.
xpath
(
'
version/text()
'
)[
0
])
...
...
This diff is collapsed.
Click to expand it.
files/scan.py
+
5
−
7
View file @
11d909d9
...
...
@@ -73,10 +73,10 @@ endpoints = import_dep_info(dep_json, args.endpoint_keys)
logging
.
info
(
f
"
endpoints:
{
endpoints
}
"
)
# Create GVM client
gvm
_client
=
GVMClient
(
auth_n
=
auth_name
,
auth_p
=
auth_passwd
)
gvm
=
GVMClient
(
auth_n
=
auth_name
,
auth_p
=
auth_passwd
)
# Print GVM library version
logging
.
info
(
f
"
gvm version:
{
gvm
_client
.
get_version
()
}
"
)
logging
.
info
(
f
"
gvm version:
{
gvm
.
get_version
()
}
"
)
# Retrieve issues irrelevant for INFN
issues_to_drop
=
read_not_relevant_issues
()
...
...
@@ -95,22 +95,20 @@ for host,ports in endpoints.items():
report_filename
=
f
"
{
output_dir
}
/
{
host
}
-report
"
summary_filename
=
f
"
{
output_dir
}
/summary-report.json
"
logging
.
info
(
f
"
gvm_client
\n
{
gvm_client
}
"
)
# Create PortList obj related to endpoint
port_list
=
PortList
(
client
=
gvm_client
,
port_list
=
PortList
(
client
=
gvm
.
get
_client
()
,
name
=
port_list_name
,
ports
=
ports
)
logging
.
info
(
f
"
Port list:
\n
{
port_list
}
"
)
# Create Target obj related to endpoint
target
=
Target
(
client
=
gvm_client
,
target
=
Target
(
client
=
gvm
.
get
_client
()
,
name
=
target_name
,
host
=
host
,
port_list
=
port_list
)
logging
.
info
(
f
"
Target:
\n
{
target
}
"
)
task
=
Task
(
client
=
gvm_client
,
task
=
Task
(
client
=
gvm
.
get
_client
()
,
name
=
task_name
,
target
=
target
)
logging
.
info
(
f
"
Task:
\n
{
task
}
"
)
...
...
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