Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pwndocImportAutomator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
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
CYBERSEC
TNS
pwndocImportAutomator
Commits
396c67e2
There was an error fetching the commit references. Please try again later.
Commit
396c67e2
authored
2 years ago
by
Ondřej Borýsek
Browse files
Options
Downloads
Patches
Plain Diff
Pass args as Scan2ReportConfig
parent
cc753d9f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api_process_findings.py
+10
-9
10 additions, 9 deletions
api_process_findings.py
with
10 additions
and
9 deletions
api_process_findings.py
+
10
−
9
View file @
396c67e2
...
...
@@ -403,22 +403,23 @@ def process_scanner_result_using_scan2report(folder_name: str) -> bool:
ps
.
add_msg
(
'
error
'
,
"
Don
'
t specify --output as a parameter, use selector of audit ID instead.
"
)
return
False
output_path
=
ps
.
get_result_path
()
combined_args
=
[
'
--output
'
,
output_path
]
if
not
(
"
-l
"
in
args
or
"
--lang
"
in
args
):
combined_args
+=
[
'
--lang
'
,
ps
.
locale
]
if
"
-l
"
in
args
or
"
--lang
"
in
args
:
ps
.
add_msg
(
'
error
'
,
"
Don
'
t specify --lang as a parameter, use selector instead.
"
)
return
False
combined_args
+=
args
+
files
s2r_config
=
scan2report
.
Scan2ReportConfig
()
s2r_config
.
lang
=
ps
.
locale
s2r_config
.
outfile
=
ps
.
get_result_path
()
logger
.
debug
(
f
"
Running scan2report with:
{
combined_args
}
"
)
combined_args
=
args
+
files
logger
.
debug
(
f
"
Running scan2report with:
{
combined_args
}
and passing additional options as part of config struct
"
)
# todo: the http connection might time out - do as async?
count_of_known_templates_before
=
len
(
TemplateScan2Report
.
list_files_in_locale_folder
(
ps
.
locale
,
original
=
False
))
ps
.
set_step_status
(
ProcessingSteps
.
PREPARATIONS_FOR_SCAN2REPORT
,
ProcessingStatus
.
DONE
)
ps
.
set_step_status
(
ProcessingSteps
.
SCAN2REPORT_FIRST_PASS
,
ProcessingStatus
.
RUNNING
)
scan2report
.
main
(
combined_args
,
reinit_global_vars
=
True
)
# First run to generates OG templates
scan2report
.
main
(
combined_args
,
s2r
=
s2r_config
)
# First run to generates OG templates
# Metadata from the first load - extract the missing templates.
meta_data
=
ps
.
load_meta_file
()
...
...
@@ -441,7 +442,7 @@ def process_scanner_result_using_scan2report(folder_name: str) -> bool:
count_of_known_templates_after
=
len
(
TemplateScan2Report
.
list_files_in_locale_folder
(
ps
.
locale
,
original
=
False
))
if
count_of_known_templates_before
!=
count_of_known_templates_after
:
ps
.
set_step_status
(
ProcessingSteps
.
SCAN2REPORT_SECOND_PASS
,
ProcessingStatus
.
RUNNING
)
scan2report
.
main
(
combined_args
,
reinit_global_vars
=
True
)
# Second run to regenerate the findings if during the first run we found OG templates
scan2report
.
main
(
combined_args
,
s2r
=
s2r_config
)
# Second run to regenerate the findings if during the first run we found OG templates
ps
.
set_step_status
(
ProcessingSteps
.
SCAN2REPORT_SECOND_PASS
,
ProcessingStatus
.
DONE
)
else
:
ps
.
set_step_status
(
ProcessingSteps
.
SCAN2REPORT_SECOND_PASS
,
ProcessingStatus
.
SKIPPED
)
...
...
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