PDF exporter.rb - "notes" not recognised

Hi!

I’m new to dradis, trying out the community edition. After downloading and installing via git, I’m trying to use the PDF exporter plugin. It is installed, and generating PDFs, but I cannot seem to include anything regarded as a “note” in Dradis in the PDF.

I am using the unadulterated exporter.rb from Creating PDF reports | Dradis Framework , the only changes are uncommenting the “project_notes” line 22, to encourage the tool to add in project notes in the PDF. I can see a page in the generated PDF called “Project Notes”, but its just a heading on an otherwise blank page. (summary of findings, and detailed findings, are populated with data further on in the PDF, but these are regarded as “Issues” I believe)

I am just testing it against the sample Dradis project that comes bundled with Dradis-CE, and I can confirm that there appear to be several “notes” in many of the nodes, one, for example, is:

Nodes > Scanner Output > 10.0.155.157 > Notes > Basic Host Info.

The raw “source” of the above note (Basic Host Info) is:

#[Title]#
Basic host info

#[Description]#
IP: 10.0.155.157
Name: smtp.example.com
OS: Linux 2.4-2.6

Unfortunately neither this, nor other Notes make a mention in the PDF report.

Could some kind person let me know what I’m doing wrong? Thanks!

Hey @drholr welcome to the forum!

I see the problem, we need to update the default template.

Notes is how we used to handle things like host properties, in your own example: IP, host name, OS, etc.

Today Nodes have properties you can access directly.

Can you give us a hint about what is the output you’re trying to generate so we can point you in the right direction in terms of template changes?

Thank you for the swift reply!

Perhaps I’m trying to something a bit outlandish, please correct me if I’m going in the wrong direction. I’m ultimately trying to create an “Executive Summary” section as part of the PDF. I Understand about creating a Node (not note!) in Dradis, and giving the Node an appropriate Title (“Executive Summary”) and a Description (blurb about a Pen Test), I was having trouble pulling that information into the PDF via exporter.rb using the notes structures already in the template as inspiration.

Any thoughts on how to best proceed, referencing Nodes (if this is now the correct way to do so) and pulling a relevant Note out (“Executive Summary”) would be wonderful. Thanks for any ideas in advance!

No, you’re right, the Notes used to have a category - one of which was for :reporting purposes, but we moved away from that, and the PDF exporter is still trying to use them.

I’ve got a workaround for you, it’s ugly though, so brace yourself.

Re-eneable note category selection

› git diff app/views/notes/_form.html.erb
diff --git a/app/views/notes/_form.html.erb b/app/views/notes/_form.html.erb
index d55bd6e99..f7605f2fd 100644
--- a/app/views/notes/_form.html.erb
+++ b/app/views/notes/_form.html.erb
@@ -6,7 +6,8 @@
     }
   } do |f| %>

-  <%= f.hidden_field :category, value: Category.default.id %>
+  <%= f.association :category, collection: Category.all, label_method: :name, prompt: 'Assign note category' %>

   <%= f.label :text, 'Note source input', class: 'visually-hidden' %>
   <%=

Create a reporting category

Now we need to bring back the old reporting category:

./bin/rails console
irb> Category.report

That will create the record in the DB.

Create your Notes

After you restart the server, the Note form will have a new select box.

I’d create new folder to keep my reporting notes (e.g. “Report” in the screenie), and add a new Note.

Also, add some fields (Title, Description, whatever).

Export report

Once the note is in the right category, Dradis::Plugins and Dradis::Plugins::PdfExport will both find them, and it’s a matter of tweaking the format: