# lynis-report-converter Manageable report from lynis text output. Currently available report formats: HTML, PDF, Microsoft Excel (XLSX)\*, JSON, XML\*\*. If you want to be able to use the PDF or Excel output formats, you must install some additional software. As is, the modules are required regardless of whether you use these features or not. Attempts are being made to change that behavior. \* It's possible that the Excel format will load for LibreOffic Calc, but this is currently untested. YMMV. \*\* WIP ## Instructions for pre-requisite installation: In Ubuntu 22.04 it should work out of the box; just download the [perl file](https://gitea.avc.cx/borekon/lynis-report-converter/raw/branch/master/lynis-report-converter.pl), and run it. ### For Debian/Ubuntu ``` # (as root) apt update apt -y install htmldoc libxml-writer-perl libarchive-zip-perl libjson-perl pushd /tmp/ wget https://gitea.avc.cx/borekon/lynis-report-converter/raw/branch/master/HTML-HTMLDoc-0.10.tar.gz tar xvf HTML-HTMLDoc-0.10.tar.gz pushd HTML-HTMLDoc-0.10 perl Makefile.PL make && make install popd wget https://gitea.avc.cx/borekon/lynis-report-converter/raw/branch/master/Excel-Writer-XLSX-0.95.tar.gz tar xvf Excel-Writer-XLSX-0.95.tar.gz pushd Excel-Writer-XLSX-0.95 perl Makefile.PL make && make install popd popd ``` ### For RHEL/CentOS/Fedora ``` # (as root) yum -y install htmldoc perl-Excel-Writer-XLSX perl-Module-Load-Conditional perl-JSON pushd /tmp/ wget https://gitea.avc.cx/borekon/lynis-report-converter/raw/branch/master/HTML-HTMLDoc-0.10.tar.gz tar xvf HTML-HTMLDoc-0.10.tar.gz pushd HTML-HTMLDoc-0.10 perl Makefile.PL make && make install popd popd ``` ### For Gentoo ``` # (as root) emerge --ask --verbose --one app-text/htmldoc dev-perl/HTML-HTMLDoc dev-perl/XML-Writer pushd /tmp/ wget https://gitea.avc.cx/borekon/lynis-report-converter/raw/branch/master/Excel-Writer-XLSX-0.95.tar.gz tar xvf Excel-Writer-XLSX-0.95.tar.gz pushd Excel-Writer-XLSX-0.95 perl Makefile.PL make && make install popd popd ``` ## Help Statement ``` ./lynis-report-converter.pl -h|--help -v|--verbose -E|--excel -o|--output -j|--json -x|--xml Where: -h|--help Display this useful message, then exit. -v|--verbose Display more detailed output. This is typically used for debugging, but may provide insight when running into problems. -i|--input Input log filename. Defaults to /var/log/lynis-report.dat. -E|--excel Output the report in Microsoft Excel binary format. -j|--json Output the report in JSON format. The default is to print to STDOUT, unlike the other formats which require an output file. This is based on the assumption that anyone using the JSON output will likely prefer to pipe the output to json_pp or another API or programmatic interface. -x|--xml Output the report in XML. -o|--output Specifies the output file to print the report to. ``` ### Docker ``` docker build -t . docker run --rm -v /local-report-dir:/reports lynis-report-converter -o /reports/report.html -i /reports/lynis-report.dat ``` ### Output Features: * HTML (default) * Summarizes the lynis report into a single HTML file. * Excel: * Breaks out sections into worksheets. * PDF: * Copy of the HTML report ported to PDF. * (This could use refinement.) * JSON: * prints to STDOUT * can also be written to a file with the -o option * XML: * Work in Progress (WIP) ## TODO: * PDF out needs refinement * Other output formats?