(OGASAWARA) 徳彦 (Naruhiko) – Call me “NARU” • FLOSS lover from Japan – LibreOffice, Ubuntu, Selenium, Jenkins, ... • An employee of the security vendor in Japan – Internal tools development (like report generation systems) – DevSecOps service development
reports • Application independent • Environment independent • Suitable for viewing on a monitor and for printing • Casual prevention of modification • PDF is the best file format for easy-to-read reports that don't require editing
As the security vendor, we do vulnerability testing every day • Test customers’ software to find vulnerability – Sometimes manually by hands – Sometimes automated by vulnerability scanners • Then generate PDF reports from test results
ODF + LibreOffice • Scala – Hybrid language: Object Oriented + Functional Programming – Run on JVM • Can use huge Java-based library ecosystem and multi-platform • ODF – LibreOffice native format – Easily manipulate via codes than OOXML (discussed later) – Suitable for intermediate format • LibreOffice – Can covert from ODF to PDF
• LibreOffice is the feature-rich OSS office suite; it can be used to create all kinds of nice looking documents • And powerful PDF generation functions – PDF/A – Accessibility complient – PDF forms – Digital signature • Do this with command line, without GUI – Easy to integrate your own software soffice --headless --convert-to pdf *.odt soffice --headless --convert-to pdf *.odt
http://opendocumentformat.org/ • “REAL” International Standard file format for document productive suite – Standardized by OASIS, Open Document Format for Office Applications TC – ISO/IEC 26300 • LibreOffice (and its predecessor, OpenOffice.org) native format • Other software can use it thanks of Open Standard – Microsoft Office, Google Drive also support • Simple, human-readable, easy to machine-manipulate zipped XML • Keep up with the evolution of the application – Not as the “pseudo standard,” which is essentially unrevised from the proprietary application document format released in 2007
human-readable, easy to machine-manipulate zipped XML – With some embedded media files – Easily found contents of your document • Same package structures for each applications – Wordprocessor, Spreadsheet, Presentation, … • Mostly common schema for each applications • Better properties to process than OOXML, the same zipped XML
• Primitive – Unzip it, modify XML, then zip it again; no special tools needed • Flat ODF – Special representation of ODF: all contents as a single XML file • Manipulate LibreOffice via UNO interface – Powerful, but quite heavy • ODF manipulation libraries – Flexible, lightweight and powerful, most recommended!
• https://github.com/search?q=opendocument+form at&ref=opensearch • There should be several libraries available in your favorite programming languages • Or easily can develop your own libraries because ODF is so simple
http://www.jopendocument.org/ • Well template handling with the dedicated extension • Simple API • Bit an old: latest release at 2014 (1.4 rc2) • But still useful
Unfortunately, jOpenDocument has not published in public repo (like maven central) • So grab *.jar then put it on your project ‘lib’ dir • Then SBT automatically recognize the dependency
extension • If you use LibreOffice 7.0 (which will release within a week), DO NOT FORGET save your template as ODF format version “1.2 Extended” – ODF 1.3 is the latest standard version of ODF, which does not be supported 2014’s library
have several parts – Title – Issues list – Issue details for each issues – End of report (such as disclaimer, contact, …) ABC System Vulnerability Test Report Issues List Issue Detail #1 ... Issue Detail #2 ... End Of Report
to others – Such as ODFDOM, part of ODF Toolkit – ODF Toolkit is an official project by The Document Foundation, home organization of LibreOffice – https://odftoolkit.org/odfdom/ • Even better, re-implement jOpenDocument on top of ODFDOM
best report file format • ODF is great for PDF report generation, – with using ODF manipulation libraries for your favorite programming languages • In our case, we are happy with Scala + jOpenDocument + ODF + LibreOffice :)
Scala + jOpenDocument + ODF (+ LibreOffice) – https://github.com/naruoga/jopendocumentsample – At this time, no document includes README and LICENSES – And might have unused files – But hope it helps you