The Word and PowerPoint reports are easily customized by editing template documents to change fonts, colors, and table styles. Some modifications will require editing code within
The templates live in
ghostwriter/reporting/templates/reports. There are templates for the Word and PowerPoint report formats. Customize the formatting by opening the template files in Microsoft Office and editing the styles.
Ghostwriter uses Word's Header, Normal, Table, and Caption styles in the template.docx. There are also several custom styles:
CodeBlock: Used for formatting blocks of code, terminal output, and other text evidence.
Code (Inline): Used for code, one-liners, and other special text inline with other text, i.e. mid-sentence.
Ghostwriter Table: The default style used for all tables.
Open template.docx and edit the styles by right-clicking the style in the ribbon and choosing the Modify option. Make the desired changes and then save the style.
PowerPoint styles are controlled by the slide masters. Open the template.pptx, click the View tab, and then click Slide Master.
Adjust the slide masters as desired and then save the template.
In the current version of Ghostwriter, each Office document is built from scratch for more fine grained control. If you wish to rearrange the placement of text or change how text is displayed you will need to review and edit the
Major edits will require a careful review of the code and accompanying comments; however, simpler edits, like changing colors for finding severity, can be tweaked relatively easily.
You may want to change the colors or hues of the severity ratings. Open
ghostwriter/modules/reportwriter.py and look at the top of the
Finding Severity Colors# Color codes used for finding severity# Blueinformational_color = '8eaadb'informational_color_hex = [0x83, 0xaa, 0xdb]# Greenlow_color = 'a8d08d'low_color_hex = [0xa8, 0xd0, 0x8d]# Orangemedium_color = 'f4b083'medium_color_hex = [0xf4, 0xb0, 0x83]# Redhigh_color = 'ff7e79'high_color_hex = [0xff, 0x7e, 0x79]# Purplecritical_color = '7030a0'critical_color_hex = [0x70, 0x30, 0xa0]
The different report formats all require the colors to be represented in their hex form. You need to set both a
string value and a
*_color variable must be a string value like
8eaabd (hex without any
*_color_hex variable must be a string value like
[0x83, 0xaa, 0xdb] (with the