Report command is part of Report module
usage: fcpc report [-h] [--report.tag Tag] [--report.customer str] [--report.customermail str] [--report.sub {0,1}] [--report.preclean_queue {0,1}]
{generate-from-template,generate-all,generate,test-item} [reportobjects ...]
positional arguments:
{generate-from-template,generate-all,generate,test-item}
Choices:
generate-from-template
generate-all
generate
test-item
reportobjects
optional arguments:
-h, --help show this help message and exit
--report.tag Tag Filter objects to match only this tag.[Defined:fcplib.module.report.cmd] (default: None)
--report.customer str
Name of customer which will be displayed in report[Defined:fcplib.module.report.cmd] (default: )
--report.customermail str
Email of our queue in RT which will be displayed in report[Defined:fcplib.module.report.cmd] (default: )
--report.sub {0,1} Internally used for subreports[Defined:fcplib.module.report.cmd] (default: 0)
Choices:
0
1
--report.preclean_queue {0,1}
Preclean job queue[Defined:fcplib.module.report.cmd] (default: 0)
Choices:
0
1
We support YAML report templates which are generic definition of complex reports.
Just create template directory with file fcpreport.yaml and define all required actions and subreports.
Template directory is used as input and it is not touched by report module. All reports will be created within output_dir.
Full schema and possibilties: schema
fcpreport.yaml example:
---
type: fcpreport
version: '0.1'
name: FCP report
# Report will be sent using SMTP. Comment this to disable email sending.
transport: smtp
# Smtp parameters
smtp:
server: smtp
protocol: tls
from: nobody@report.acme
# Where and which data to send
send:
to:
- somebody@report.acme
- somebodyelse@report.acme
# Which file to use as body
htmlbody: coverage.html
# Which file used as text body
#body: body.txt
# Which files to send. Use standard glob notation
files:
- "icons/*"
- "*html"
- "*csv"
prepare:
# Copy icons subdir
- name: Copy icons
copy:
- icons
- name: Tag hosts based on owners
tag:
query: host+
tag: report/{owned}
also:
- same
- links
continue_on_error: false
- name: Create CSV defition for pergroup report (owners)
search:
query: person+ ~is-owner host+
unique: True
output: report_owners.csv
output_format: csv
output_type: table
columns:
- left_id
- left_email
- left_url
- left_description
- left_name
disabled: false
options:
- "--search.unique=1"
items:
- name: Consistency report
template:
file: consistency.html.j2
output: consistency.html
disabled: true
subreports:
- name: Per owner report
groups:
input_csv: report_owners.csv
output_csv: report_owners_result.csv
email_attr: left_email
tag_attr: left_id
tag_prefix: report/
dir_attr: left_id
name_attr: left_name
description_attr: left_description
input_directory: perowner
output_directory: perowner
disabled: true
fcpc report generate template_dir output_dir
fcpc report generate-from-template template.html.j2
fcpc report test-item 'epoch["objects_types"]'
fcpc help command/report
fcpc help item/<name>
Report topics:
See help report/item for more info about topic
epoch[]
db[]
vulnerabilities[]
epoch_last
epoch_prev
now
graph[]
qualys[]