Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Allow to configure the lines in the XML report #244

Closed
LoZio opened this issue Jan 18, 2024 · 7 comments
Closed

[FEATURE] Allow to configure the lines in the XML report #244

LoZio opened this issue Jan 18, 2024 · 7 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@LoZio
Copy link

LoZio commented Jan 18, 2024

** Please attach large files to the report instead of pasting the contents into the report. **

Describe the improvement
Exporting XML files is limited to 1000 lines.
From my understanding (https://github.com/greenbone/gvmd/blob/7862bd54a0c7524524e6460dad70f155dd30510d/src/manage_sql.h#L113) it is something that can be configured during the build or setting a configuration parameter like:
gvmd --modify-setting 76374a7a-0569-11e6-b6da-28d24461215b --value 10000
I know I can use the cli inside the container but it is very clunky.
If I'm not mistaken during the first startup of a container a line dealing with report limits pops up...

The general problem is having less lines than you need, say you have 2000 results and can export only 1000.
The opposite is not a problem since if you need fewer results you can easily apply filters from the interface.
So the proposal is to increase the build limit to 10000 (10x).
It would be usefult to have a script in the /scripts directory just like
set-report-lines.sh <number>
That just switches to the gvm user and runs
/usr/local/sbin/gvmd --modify-setting 76374a7a-0569-11e6-b6da-28d24461215b --value <number>

Maybe an env variable can do the trick during container creation.

@immauss
Copy link
Owner

immauss commented Jan 18, 2024

Ugh ...
sorry

Undocumented feature.

It's been there for a while.

REPORT_LINES=${REPORT_LINES:-1000}

Just add -e REPORT_LINES to your docker run. Or set it in the environment of the dockercompose.yml.

@immauss
Copy link
Owner

immauss commented Jan 18, 2024

I'm going to mark this as documentation and leave it open until I get a chance to update the docs.

Thanks for bringing it up.

-Scott

@immauss immauss added the documentation Improvements or additions to documentation label Jan 18, 2024
@LoZio
Copy link
Author

LoZio commented Jan 18, 2024

Since it's just a two-liner maybe also creating the script in the /scripts dir can be useful if you want to change the value after the container creation

if [ "$1" == "" ] ; then
 echo Need to specify the number of lines in the report
 exit 1
fi
su gvm -c /usr/local/sbin/gvmd --modify-setting 76374a7a-0569-11e6-b6da-28d24461215b --value $1

maybe adding some checks on the parameter can be added but given who the users of this stuff are maybe its enough.
Or an example in the docs may be a valid alternative

@immauss
Copy link
Owner

immauss commented Jan 18, 2024

Easy enough. I can do that too.

Hmmm ....

Would also need some logic in the startup scripts to only make a change if the value is set to something other than the default of 1000. Otherwise, changes made by the script would get replaced on the next restart.

( So I don't for get that ^^^ )

Thanks,
-Scott

@LoZio
Copy link
Author

LoZio commented Jan 18, 2024

You can save the env variable value in a file that by default contains 1000. At each start the above script will re-set it every time
So you are actually resetting it at each start with the last value in the file

@immauss
Copy link
Owner

immauss commented Jan 18, 2024

That only works for folks using docker-compose though.
I've actually already added the checks in my base code... :)

-Scott

@immauss
Copy link
Owner

immauss commented Feb 13, 2024

This is resolved in the latest and 22.4.40.
And the option has been added to the docs.

-Scott

@immauss immauss closed this as completed Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants