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
bab03a33
Commit
bab03a33
authored
1 year ago
by
Gioacchino Vino
Browse files
Options
Downloads
Patches
Plain Diff
show scans logs
parent
c64fa482
No related branches found
No related tags found
1 merge request
!57
show scans logs
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
files/script.py
+2
-1
2 additions, 1 deletion
files/script.py
tasks/2-scan.yml
+8
-0
8 additions, 0 deletions
tasks/2-scan.yml
with
10 additions
and
1 deletion
files/script.py
+
2
−
1
View file @
bab03a33
...
@@ -43,6 +43,7 @@ def create_port_list(port_list_name, ports):
...
@@ -43,6 +43,7 @@ def create_port_list(port_list_name, ports):
status_text
=
res
.
xpath
(
'
@status_text
'
)[
0
]
status_text
=
res
.
xpath
(
'
@status_text
'
)[
0
]
if
status
==
"
201
"
:
if
status
==
"
201
"
:
id
=
res
.
xpath
(
'
@id
'
)[
0
]
id
=
res
.
xpath
(
'
@id
'
)[
0
]
logging
.
debug
(
f
'
Created port list obj. Name:
{
port_list_name
}
, id:
{
id
}
, ports:
{
ports
}
'
)
return
{
'
name
'
:
port_list_name
,
'
id
'
:
id
}
return
{
'
name
'
:
port_list_name
,
'
id
'
:
id
}
else
:
else
:
logging
.
error
(
f
"
ERROR during Port list creation. Status code:
{
status
}
, msg:
{
status_text
}
"
)
logging
.
error
(
f
"
ERROR during Port list creation. Status code:
{
status
}
, msg:
{
status_text
}
"
)
...
@@ -423,7 +424,7 @@ def import_dep_info(file_path, endpoints_to_scan):
...
@@ -423,7 +424,7 @@ def import_dep_info(file_path, endpoints_to_scan):
################ MAIN #######################################
################ MAIN #######################################
logging
.
basicConfig
(
logging
.
basicConfig
(
filename
=
'
debug
.log
'
,
filename
=
'
scans
.log
'
,
level
=
logging
.
DEBUG
,
level
=
logging
.
DEBUG
,
format
=
'
%(asctime)s %(levelname)-8s %(message)s
'
,
format
=
'
%(asctime)s %(levelname)-8s %(message)s
'
,
datefmt
=
'
%Y-%m-%d %H:%M:%S
'
,
datefmt
=
'
%Y-%m-%d %H:%M:%S
'
,
...
...
This diff is collapsed.
Click to expand it.
tasks/2-scan.yml
+
8
−
0
View file @
bab03a33
...
@@ -35,6 +35,14 @@
...
@@ -35,6 +35,14 @@
with_items
:
"
{{report_files.files}}"
with_items
:
"
{{report_files.files}}"
when
:
summary_report_json.global == 'NOK'
when
:
summary_report_json.global == 'NOK'
-
name
:
Load scans log
command
:
cat "{{ paas_ci_workdir + '/scans.log'}}"
register
:
scans_log
-
name
:
Show scans log
debug
:
msg
:
"
{{
scans_log.output
}}"
-
name
:
Detailed report summary
-
name
:
Detailed report summary
debug
:
debug
:
var
:
summary_report_json
var
:
summary_report_json
...
...
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