dradis-html_export 3.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.github/issue_template.md +16 -0
- data/.github/pull_request_template.md +36 -0
- data/.gitignore +19 -0
- data/.rspec +1 -0
- data/.travis.yml +11 -0
- data/CHANGELOG.md +53 -0
- data/CONTRIBUTING.md +3 -0
- data/Gemfile +4 -0
- data/README.md +28 -0
- data/Rakefile +1 -0
- data/app/controllers/dradis/plugins/html_export/base_controller.rb +19 -0
- data/config/routes.rb +3 -0
- data/dradis-html_export.gemspec +35 -0
- data/lib/dradis-html_export.rb +9 -0
- data/lib/dradis/plugins/html_export.rb +10 -0
- data/lib/dradis/plugins/html_export/engine.rb +31 -0
- data/lib/dradis/plugins/html_export/exporter.rb +98 -0
- data/lib/dradis/plugins/html_export/gem_version.rb +19 -0
- data/lib/dradis/plugins/html_export/version.rb +13 -0
- data/lib/tasks/thorfile.rb +40 -0
- data/spec/requests/html_export_spec.rb +7 -0
- data/spec/spec_helper.rb +39 -0
- data/templates/basic.html.erb +46 -0
- data/templates/default_dradis_template_v3.0.html.erb +146 -0
- metadata +111 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 44a40f1bc271b8211123ed58ea69212e1bc4c8837da97d76194ebaa1485f29be
|
4
|
+
data.tar.gz: f58b4edfa716c6c77b3a7e264684777705cc46da2cf87f9bb02eb660ee6fa70e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4e39c16ea0cdd301e70c106bc815372ff53fb8de163f6d6a5278869532988b6cb50ec6c0ad18f63786f5b6fc4655f1cbb008c1d75dd0f87e2d63cf4304c18d3a
|
7
|
+
data.tar.gz: 45a5b725f445b9849d2844124bbdc16604e77169e198eaed1c7e2b29cbb82119246c0026796c7e5091a0d129de4f8f6eccdff605ef21662f8676a591a9527b9d
|
@@ -0,0 +1,16 @@
|
|
1
|
+
### Steps to reproduce
|
2
|
+
|
3
|
+
Help us help you, how can we reproduce the problem?
|
4
|
+
|
5
|
+
### Expected behavior
|
6
|
+
Tell us what should happen
|
7
|
+
|
8
|
+
### Actual behavior
|
9
|
+
Tell us what happens instead
|
10
|
+
|
11
|
+
### System configuration
|
12
|
+
**Dradis version**:
|
13
|
+
|
14
|
+
**Ruby version**:
|
15
|
+
|
16
|
+
**OS version**:
|
@@ -0,0 +1,36 @@
|
|
1
|
+
### Summary
|
2
|
+
|
3
|
+
Provide a general description of the code changes in your pull
|
4
|
+
request... were there any bugs you had fixed? If so, mention them. If
|
5
|
+
these bugs have open GitHub issues, be sure to tag them here as well,
|
6
|
+
to keep the conversation linked together.
|
7
|
+
|
8
|
+
|
9
|
+
### Other Information
|
10
|
+
|
11
|
+
If there's anything else that's important and relevant to your pull
|
12
|
+
request, mention that information here. This could include
|
13
|
+
benchmarks, or other information.
|
14
|
+
|
15
|
+
Thanks for contributing to Dradis!
|
16
|
+
|
17
|
+
|
18
|
+
### Copyright assignment
|
19
|
+
|
20
|
+
Collaboration is difficult with commercial closed source but we want
|
21
|
+
to keep as much of the OSS ethos as possible available to users
|
22
|
+
who want to fix it themselves.
|
23
|
+
|
24
|
+
In order to unambiguously own and sell Dradis Framework commercial
|
25
|
+
products, we must have the copyright associated with the entire
|
26
|
+
codebase. Any code you create which is merged must be owned by us.
|
27
|
+
That's not us trying to be a jerks, that's just the way it works.
|
28
|
+
|
29
|
+
Please review the [CONTRIBUTING.md](https://github.com/dradis/dradis-ce/blob/master/CONTRIBUTING.md)
|
30
|
+
file for the details.
|
31
|
+
|
32
|
+
You can delete this section, but the following sentence needs to
|
33
|
+
remain in the PR's description:
|
34
|
+
|
35
|
+
> I assign all rights, including copyright, to any future Dradis
|
36
|
+
> work by myself to Security Roots.
|
data/.gitignore
ADDED
data/.rspec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--color
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
## Dradis Framework 3.18 (July, 2020) ##
|
2
|
+
|
3
|
+
* No changes.
|
4
|
+
|
5
|
+
## Dradis Framework 3.17 (May, 2020) ##
|
6
|
+
|
7
|
+
* Render report using main app's ApplicationController#render.
|
8
|
+
|
9
|
+
## Dradis Framework 3.16 (February, 2020) ##
|
10
|
+
|
11
|
+
* No changes.
|
12
|
+
|
13
|
+
## Dradis Framework 3.15 (November, 2019) ##
|
14
|
+
|
15
|
+
* No changes.
|
16
|
+
|
17
|
+
|
18
|
+
## Dradis Framework 3.14 (August, 2019) ##
|
19
|
+
|
20
|
+
* No changes.
|
21
|
+
|
22
|
+
## Dradis Framework 3.13 (June, 2019) ##
|
23
|
+
|
24
|
+
* No changes.
|
25
|
+
|
26
|
+
## Dradis Framework 3.12 (March, 2019) ##
|
27
|
+
|
28
|
+
* No changes.
|
29
|
+
|
30
|
+
## Dradis Framework 3.11 (November, 2018) ##
|
31
|
+
|
32
|
+
* No changes.
|
33
|
+
|
34
|
+
## Dradis Framework 3.10 (August, 2018) ##
|
35
|
+
|
36
|
+
* Security fix: update RedCloth to 4.3.2
|
37
|
+
* Fix issue sorting
|
38
|
+
|
39
|
+
## Dradis Framework 3.9 (January, 2018) ##
|
40
|
+
|
41
|
+
* Updated rendering html as in Rails 5.1 (`render html:`)
|
42
|
+
|
43
|
+
## Dradis Framework 3.8 (September, 2017) ##
|
44
|
+
|
45
|
+
* No changes.
|
46
|
+
|
47
|
+
## Dradis Framework 3.7 (July, 2017) ##
|
48
|
+
|
49
|
+
* No changes.
|
50
|
+
|
51
|
+
## Dradis Framework 3.6 (March, 2017) ##
|
52
|
+
|
53
|
+
* No changes.
|
data/CONTRIBUTING.md
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# HTML export plugin for the Dradis Framework
|
2
|
+
|
3
|
+
[![Build Status](https://secure.travis-ci.org/dradis/dradis-html_export.png?branch=master)](http://travis-ci.org/dradis/dradis-html_export)
|
4
|
+
|
5
|
+
|
6
|
+
This plugin generates an HTML report for the notes in your [Dradis Framework](https://github.com/dradis/dradisframework) repository.
|
7
|
+
|
8
|
+
The plugin requires Dradis 3.0 or higher.
|
9
|
+
|
10
|
+
|
11
|
+
## More information
|
12
|
+
|
13
|
+
See the Dradis Framework's [README.md](https://github.com/dradis/dradisframework/blob/master/README.md)
|
14
|
+
|
15
|
+
|
16
|
+
## Contributing
|
17
|
+
|
18
|
+
See the Dradis Framework's [CONTRIBUTING.md](https://github.com/dradis/dradisframework/blob/master/CONTRIBUTING.md)
|
19
|
+
|
20
|
+
|
21
|
+
## License
|
22
|
+
|
23
|
+
Dradis Framework and all its components are released under [GNU General Public License version 2.0](http://www.gnu.org/licenses/old-licenses/gpl-2.0.html) as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.
|
24
|
+
|
25
|
+
|
26
|
+
## Feature requests and bugs
|
27
|
+
|
28
|
+
Please use the [Dradis Framework issue tracker](https://github.com/dradis/dradis-ce/issues) for add-on improvements and bug reports.
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dradis
|
2
|
+
module Plugins
|
3
|
+
module HtmlExport
|
4
|
+
class BaseController < Dradis::Plugins::Export::BaseController
|
5
|
+
# This method cycles throw the notes in the reporting category and creates
|
6
|
+
# a simple HTML report with them.
|
7
|
+
#
|
8
|
+
# It uses the template at: ./vendor/plugins/html_export/template.html.erb
|
9
|
+
def index
|
10
|
+
exporter = Dradis::Plugins::HtmlExport::Exporter.new(export_options)
|
11
|
+
html = exporter.export
|
12
|
+
|
13
|
+
render html: html.html_safe
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
data/config/routes.rb
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/dradis/plugins/html_export/version', __FILE__)
|
3
|
+
version = Dradis::Plugins::HtmlExport::version
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.platform = Gem::Platform::RUBY
|
7
|
+
spec.name = "dradis-html_export"
|
8
|
+
spec.version = version
|
9
|
+
spec.required_ruby_version = '>= 1.9.3'
|
10
|
+
spec.license = 'GPL-2'
|
11
|
+
|
12
|
+
spec.authors = ['Daniel Martin']
|
13
|
+
spec.email = ["<etd@nomejortu.com>"]
|
14
|
+
spec.description = %q{Export to HTML plugin for the Dradis Framework}
|
15
|
+
spec.summary = %q{Dradis HTML export plugin}
|
16
|
+
spec.homepage = 'http://dradisframework.org'
|
17
|
+
|
18
|
+
spec.files = `git ls-files`.split($\)
|
19
|
+
spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
20
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
# gem.add_dependency 'dradis_core', version
|
24
|
+
spec.add_dependency 'dradis-plugins', '~> 3.6'
|
25
|
+
|
26
|
+
# Note markup
|
27
|
+
spec.add_dependency 'rails_autolink', '~> 1.1'
|
28
|
+
spec.add_dependency 'RedCloth', '~> 4.3.2'
|
29
|
+
|
30
|
+
# gem.add_development_dependency 'capybara', '~> 1.1.3'
|
31
|
+
# gem.add_development_dependency 'database_cleaner'
|
32
|
+
# gem.add_development_dependency 'factory_girl_rails'
|
33
|
+
# gem.add_development_dependency 'rspec-rails', '~> 2.11.0'
|
34
|
+
# gem.add_development_dependency 'sqlite3'
|
35
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Dradis
|
2
|
+
module Plugins
|
3
|
+
module HtmlExport
|
4
|
+
class Engine < ::Rails::Engine
|
5
|
+
|
6
|
+
# Standard Rails Engine stuff
|
7
|
+
isolate_namespace Dradis::Plugins::HtmlExport
|
8
|
+
engine_name 'dradis_html_export'
|
9
|
+
|
10
|
+
# use rspec for tests
|
11
|
+
config.generators do |g|
|
12
|
+
g.test_framework :rspec
|
13
|
+
end
|
14
|
+
|
15
|
+
# Connect to the Framework
|
16
|
+
include Dradis::Plugins::Base
|
17
|
+
|
18
|
+
# plugin_name 'HTML export'
|
19
|
+
provides :export
|
20
|
+
description 'Generate advanced HTML reports'
|
21
|
+
|
22
|
+
|
23
|
+
initializer 'dradis-html_export.mount_engine' do
|
24
|
+
Rails.application.routes.append do
|
25
|
+
mount Dradis::Plugins::HtmlExport::Engine => '/export/html'
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,98 @@
|
|
1
|
+
module Dradis
|
2
|
+
module Plugins
|
3
|
+
module HtmlExport
|
4
|
+
|
5
|
+
class Exporter < Dradis::Plugins::Export::Base
|
6
|
+
|
7
|
+
def export(args = {})
|
8
|
+
log_report
|
9
|
+
|
10
|
+
# Render template
|
11
|
+
ApplicationController.render(
|
12
|
+
file: options.fetch(:template),
|
13
|
+
layout: false,
|
14
|
+
locals: {
|
15
|
+
categorized_issues: categorized_issues,
|
16
|
+
content_service: content_service,
|
17
|
+
issues: issues,
|
18
|
+
nodes: nodes,
|
19
|
+
notes: notes,
|
20
|
+
project: project,
|
21
|
+
reporting_cat: content_service.report_category,
|
22
|
+
tags: tags,
|
23
|
+
title: title,
|
24
|
+
user: options[:user]
|
25
|
+
}
|
26
|
+
)
|
27
|
+
end
|
28
|
+
|
29
|
+
private
|
30
|
+
def log_report
|
31
|
+
logger.debug { "Report title: #{title}" }
|
32
|
+
logger.debug { "Template properties define a sort field: #{sort_field}" }
|
33
|
+
|
34
|
+
if issues&.any?
|
35
|
+
logger.debug { "Found #{issues.count} issues affecting #{nodes.count} nodes" }
|
36
|
+
else
|
37
|
+
logger.warn { 'No issue library node found in this project' }
|
38
|
+
end
|
39
|
+
|
40
|
+
logger.debug { "Found #{notes.count} notes assigned to the reporting category." }
|
41
|
+
end
|
42
|
+
|
43
|
+
def nodes
|
44
|
+
# FIXME: This is an ugly piece of code and the list of nodes should
|
45
|
+
# come from the ContentService.
|
46
|
+
@nodes ||= issues.map(&:evidence).flatten.map(&:node).uniq
|
47
|
+
end
|
48
|
+
|
49
|
+
def notes
|
50
|
+
@notes ||= content_service.all_notes
|
51
|
+
end
|
52
|
+
|
53
|
+
def issues
|
54
|
+
@issues ||= sort_issues content_service.all_issues.includes(:tags)
|
55
|
+
end
|
56
|
+
|
57
|
+
def categorized_issues
|
58
|
+
@categorized_issues ||= tags
|
59
|
+
.each_with_object({}) do |tag, hash|
|
60
|
+
hash[tag.id] = issues.select { |issue| issue.tags.include?(tag) }
|
61
|
+
end
|
62
|
+
.tap do |hash|
|
63
|
+
hash[:untagged] = issues.select { |issue| issue.tags.empty? }
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
def sort_field
|
68
|
+
@sort_field ||= begin
|
69
|
+
template_path = options.fetch(:template)
|
70
|
+
properties = ::ReportTemplateProperties.find_by_template_file(File.basename(template_path)) rescue nil
|
71
|
+
properties&.sort_field
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def sort_issues(unsorted_issues)
|
76
|
+
return unsorted_issues unless unsorted_issues.any? && sort_field
|
77
|
+
|
78
|
+
# FIXME: Assume the Field :type is :number, so cast .to_f and sort
|
79
|
+
unsorted_issues.sort do |a, b|
|
80
|
+
b.fields.fetch(sort_field, '0').to_f <=> a.fields.fetch(sort_field, '0').to_f
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def tags
|
85
|
+
@tags ||= project.tags
|
86
|
+
end
|
87
|
+
|
88
|
+
def title
|
89
|
+
@title ||= if Dradis.constants.include?(:Pro)
|
90
|
+
"Dradis Professional Edition v#{Dradis::Pro.version}"
|
91
|
+
else
|
92
|
+
"Dradis Community Edition v#{Dradis::CE.version}"
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module Dradis
|
2
|
+
module Plugins
|
3
|
+
module HtmlExport
|
4
|
+
# Returns the version of the currently loaded Frontend as a <tt>Gem::Version</tt>
|
5
|
+
def self.gem_version
|
6
|
+
Gem::Version.new VERSION::STRING
|
7
|
+
end
|
8
|
+
|
9
|
+
module VERSION
|
10
|
+
MAJOR = 3
|
11
|
+
MINOR = 18
|
12
|
+
TINY = 0
|
13
|
+
PRE = nil
|
14
|
+
|
15
|
+
STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
class HtmlExportTasks < Thor
|
2
|
+
include Rails.application.config.dradis.thor_helper_module
|
3
|
+
|
4
|
+
namespace "dradis:plugins:html"
|
5
|
+
|
6
|
+
desc 'export', 'export the current repository structure as an HTML document'
|
7
|
+
method_option :output, required: false, type: :string, desc: "the report file to create (if ends in .html), or directory to create it in"
|
8
|
+
method_option :template, required: true, type: :string, desc: "the template file to use. If not provided the value of the 'advanced_word_export:docx' setting will be used."
|
9
|
+
|
10
|
+
def export
|
11
|
+
require 'config/environment'
|
12
|
+
|
13
|
+
# The options we'll end up passing to the Processor class
|
14
|
+
opts = {}
|
15
|
+
|
16
|
+
report_path = options.output || Rails.root
|
17
|
+
unless report_path.to_s =~ /\.html\z/
|
18
|
+
date = DateTime.now.strftime("%Y-%m-%d")
|
19
|
+
sequence = Dir.glob(File.join(report_path, "dradis-report_#{date}_*.html")).collect { |a| a.match(/_([0-9]+)\.html\z/)[1].to_i }.max || 0
|
20
|
+
report_path = File.join(report_path, "dradis-report_#{date}_#{sequence + 1}.html")
|
21
|
+
end
|
22
|
+
|
23
|
+
if template = options.template
|
24
|
+
shell.error("Template file doesn't exist") && exit(1) unless File.exists?(template)
|
25
|
+
task_options[:template] = template
|
26
|
+
end
|
27
|
+
|
28
|
+
detect_and_set_project_scope
|
29
|
+
|
30
|
+
exporter = Dradis::Plugins::HtmlExport::Exporter.new(task_options)
|
31
|
+
html = exporter.export
|
32
|
+
|
33
|
+
File.open(report_path, 'w') do |f|
|
34
|
+
f << html
|
35
|
+
end
|
36
|
+
|
37
|
+
logger.info{ "Report file created at:\n\t#{report_path}" }
|
38
|
+
end
|
39
|
+
|
40
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
# Configure Rails Envinronment
|
2
|
+
ENV["RAILS_ENV"] ||= 'test'
|
3
|
+
require File.expand_path("../dummy/config/environment", __FILE__)
|
4
|
+
|
5
|
+
require 'rspec/rails'
|
6
|
+
|
7
|
+
# Requires supporting ruby files with custom matchers and macros, etc,
|
8
|
+
# in spec/support/ and its subdirectories.
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
+
|
11
|
+
require 'database_cleaner'
|
12
|
+
require 'factory_girl_rails'
|
13
|
+
|
14
|
+
|
15
|
+
RSpec.configure do |config|
|
16
|
+
|
17
|
+
# Capybara javascript drivers require transactional fixtures set to false,
|
18
|
+
# and we just use DatabaseCleaner to cleanup after each test instead.
|
19
|
+
# Without transactional fixtures set to false none of the records created to
|
20
|
+
# setup a test will be available to the browser, which runs under a seperate
|
21
|
+
# server instance.
|
22
|
+
config.use_transactional_fixtures = false
|
23
|
+
|
24
|
+
config.before(:each) do
|
25
|
+
if example.metadata[:js]
|
26
|
+
DatabaseCleaner.strategy = :truncation
|
27
|
+
else
|
28
|
+
DatabaseCleaner.strategy = :transaction
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
config.before(:each) do
|
33
|
+
DatabaseCleaner.start
|
34
|
+
end
|
35
|
+
|
36
|
+
config.after(:each) do
|
37
|
+
DatabaseCleaner.clean
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<title><%= title %></title>
|
6
|
+
<style type="text/css">
|
7
|
+
html{color:#000;background:#FFF}
|
8
|
+
body,div,ul,ol,li,h1,h2,h3{margin:0;padding:0}
|
9
|
+
li{list-style:none;}
|
10
|
+
h1,h2,h3{font-size:100%;font-weight:bold;}
|
11
|
+
|
12
|
+
body{padding:10px; font-family: "trebuchet ms", helvetica, sans-serif;}
|
13
|
+
h1{border-bottom: 1px solid #CCC; margin:2ex 0; font-size: 120%; font-weight: bold; }
|
14
|
+
h2{text-align:center;}
|
15
|
+
li{margin-left: 40px;}
|
16
|
+
ul{list-style-type: square;}
|
17
|
+
ol{list-style-type: decimal;}
|
18
|
+
ul, ol{margin-bottom: 2ex;}
|
19
|
+
.note{border-bottom: 1px solid #ddd; margin-bottom: 10px; padding-bottom: 10px;}
|
20
|
+
#footer{border-top: 1px solid #ccc;text-align: right;padding-right: 69px;min-height: 64px;height: auto !important;height: 64px;background: url('../images/logo_tiny.png') 100% 50% no-repeat;}
|
21
|
+
</style>
|
22
|
+
</head>
|
23
|
+
<body>
|
24
|
+
<h1><%= title %></h1>
|
25
|
+
|
26
|
+
<section>
|
27
|
+
<h2>Issues</h2>
|
28
|
+
<% issues.each do |issue| %>
|
29
|
+
<div class="note"><%= markup(issue.text) %></div>
|
30
|
+
<% end %>
|
31
|
+
</section>
|
32
|
+
|
33
|
+
<section>
|
34
|
+
<h2>Notes assigned to the <%= reporting_cat.name %> category</h2>
|
35
|
+
<% notes.each do |note| %>
|
36
|
+
<div class="note"><%= markup(note.text) %></div>
|
37
|
+
<% end %>
|
38
|
+
</section>
|
39
|
+
|
40
|
+
<div id="footer">
|
41
|
+
<br/>
|
42
|
+
effective collaboration<br/>
|
43
|
+
<a href="http://dradisframework.org">http://dradisframework.org</a>
|
44
|
+
</div>
|
45
|
+
</body>
|
46
|
+
</html>
|
@@ -0,0 +1,146 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html lang="en">
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
7
|
+
|
8
|
+
<title><%= title %></title>
|
9
|
+
<style type="text/css">
|
10
|
+
/* Sticky footer styles
|
11
|
+
/* See:
|
12
|
+
/* http://getbootstrap.com/examples/sticky-footer/
|
13
|
+
-------------------------------------------------- */
|
14
|
+
html {
|
15
|
+
position: relative;
|
16
|
+
min-height: 100%;
|
17
|
+
}
|
18
|
+
body {
|
19
|
+
/* Margin bottom by footer height */
|
20
|
+
margin-bottom: 60px;
|
21
|
+
padding-bottom: 60px;
|
22
|
+
}
|
23
|
+
#footer {
|
24
|
+
position: absolute;
|
25
|
+
bottom: 0;
|
26
|
+
width: 100%;
|
27
|
+
/* Set the fixed height of the footer here */
|
28
|
+
height: 60px;
|
29
|
+
background-color: #f5f5f5;
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
/* Custom page CSS
|
34
|
+
-------------------------------------------------- */
|
35
|
+
/* Not required for template or sticky footer method. */
|
36
|
+
|
37
|
+
.container {
|
38
|
+
padding: 0 15px;
|
39
|
+
}
|
40
|
+
.container .text-muted {
|
41
|
+
margin: 20px 0;
|
42
|
+
}
|
43
|
+
#footer2{border-top: 1px solid #ccc;text-align: right;padding-right: 69px;min-height: 64px;height: auto !important;height: 64px;background: url('/assets/logopro_tiny.png') 100% 50% no-repeat;}
|
44
|
+
</style>
|
45
|
+
|
46
|
+
<!-- Latest compiled and minified CSS -->
|
47
|
+
<!-- <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> -->
|
48
|
+
<link rel="stylesheet" href="/assets//bootstrap.css">
|
49
|
+
|
50
|
+
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
51
|
+
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
52
|
+
<!--[if lt IE 9]>
|
53
|
+
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
54
|
+
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
55
|
+
<![endif]-->
|
56
|
+
</head>
|
57
|
+
<body>
|
58
|
+
<noscript>
|
59
|
+
<div class="alert alert-danger">
|
60
|
+
<p><strong>Warning</strong>: this report template loads jQuery and Bootstrap JS files from their CDNs, but JavaScript seems to be disabled.</p>
|
61
|
+
</div>
|
62
|
+
</noscript>
|
63
|
+
|
64
|
+
<div class="container">
|
65
|
+
|
66
|
+
<h1><%= title %></h1>
|
67
|
+
|
68
|
+
<h2>Project notes</h2>
|
69
|
+
<p class="lead">In this section you'll find any notes assigned to the <strong>Report category</strong>.</p>
|
70
|
+
<% notes.each do |note| %>
|
71
|
+
<div class="panel panel-default">
|
72
|
+
<div class="panel-body">
|
73
|
+
<%= markup(note.text) %>
|
74
|
+
</div>
|
75
|
+
</div>
|
76
|
+
<% end %>
|
77
|
+
|
78
|
+
|
79
|
+
<h2>Project issues</h2>
|
80
|
+
<p class="lead">In this section you'll find your project's Issues.</p>
|
81
|
+
<% issues.each do |issue| %>
|
82
|
+
<div class="panel panel-default">
|
83
|
+
<div class="panel-body">
|
84
|
+
<%= markup(issue.text) %>
|
85
|
+
|
86
|
+
<h3>Assets affected by this issue</h3>
|
87
|
+
<% if issue.affected.empty? %>
|
88
|
+
<p class="well">None so far.</p>
|
89
|
+
<% else %>
|
90
|
+
<div class="row">
|
91
|
+
<div class="col-md-3 evidence-sidebar">
|
92
|
+
<ul class="nav nav-list evidence-sidenav">
|
93
|
+
<% issue.evidence_by_node.each do |node, instances| %>
|
94
|
+
<li><a href="#evidence_for_<%= node.id %>"><i class="glyphicon glyphicon-<%= ['folder-close','hdd'][node.type_id] %>"></i> <%= node.label %> (<%= pluralize instances.count, 'instance' %>)</a></li>
|
95
|
+
<% end %>
|
96
|
+
</ul>
|
97
|
+
</div>
|
98
|
+
|
99
|
+
<div class="col-md-9">
|
100
|
+
<% issue.evidence_by_node.each do |node, instances| %>
|
101
|
+
<section id="evidence_for_#{node.id}">
|
102
|
+
<% if instances.count == 1 %>
|
103
|
+
<div class="content-textile" id="node_<%= node.id %>_instance_0">
|
104
|
+
<%= markup(instances.first.content) %>
|
105
|
+
</div>
|
106
|
+
<% else %>
|
107
|
+
<ul class="nav nav-tabs">
|
108
|
+
<% instances.each_with_index do |evidence, i| %>
|
109
|
+
<li class="<%= 'active' if i==0 %>"><a href="#node_<%= node.id %>_instance_<%= i %>" data-toggle="tab">Instance <%= i %></a></li>
|
110
|
+
<% end %>
|
111
|
+
</ul>
|
112
|
+
|
113
|
+
<div class="tab-content">
|
114
|
+
<% instances.each_with_index do |evidence, i| %>
|
115
|
+
<div class="content-textile tab-pane<%= ' active' if i==0 %>" id="node_<%= node.id %>_instance_<%= i %>">
|
116
|
+
<%= markup(evidence.content) %>
|
117
|
+
</div>
|
118
|
+
<% end %>
|
119
|
+
</div>
|
120
|
+
<% end %>
|
121
|
+
|
122
|
+
</section>
|
123
|
+
<% end %>
|
124
|
+
</div>
|
125
|
+
</div>
|
126
|
+
<% end %>
|
127
|
+
</div>
|
128
|
+
</div>
|
129
|
+
<% end %>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
|
133
|
+
<div id="footer">
|
134
|
+
<div class="container">
|
135
|
+
<p class="text-muted text-center"><%= title%> - <a href="http://dradisframework.org">http://dradisframework.org</a></p>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
|
139
|
+
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
|
140
|
+
<!-- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> -->
|
141
|
+
<script src="/assets/jquery.js"></script>
|
142
|
+
<!-- Include all compiled plugins (below), or include individual files as needed -->
|
143
|
+
<!-- <script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> -->
|
144
|
+
<script src="/assets/bootstrap.js"></script>
|
145
|
+
</body>
|
146
|
+
</html>
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: dradis-html_export
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 3.18.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Daniel Martin
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: dradis-plugins
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.6'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.6'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rails_autolink
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: RedCloth
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 4.3.2
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 4.3.2
|
55
|
+
description: Export to HTML plugin for the Dradis Framework
|
56
|
+
email:
|
57
|
+
- "<etd@nomejortu.com>"
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".github/issue_template.md"
|
63
|
+
- ".github/pull_request_template.md"
|
64
|
+
- ".gitignore"
|
65
|
+
- ".rspec"
|
66
|
+
- ".travis.yml"
|
67
|
+
- CHANGELOG.md
|
68
|
+
- CONTRIBUTING.md
|
69
|
+
- Gemfile
|
70
|
+
- README.md
|
71
|
+
- Rakefile
|
72
|
+
- app/controllers/dradis/plugins/html_export/base_controller.rb
|
73
|
+
- config/routes.rb
|
74
|
+
- dradis-html_export.gemspec
|
75
|
+
- lib/dradis-html_export.rb
|
76
|
+
- lib/dradis/plugins/html_export.rb
|
77
|
+
- lib/dradis/plugins/html_export/engine.rb
|
78
|
+
- lib/dradis/plugins/html_export/exporter.rb
|
79
|
+
- lib/dradis/plugins/html_export/gem_version.rb
|
80
|
+
- lib/dradis/plugins/html_export/version.rb
|
81
|
+
- lib/tasks/thorfile.rb
|
82
|
+
- spec/requests/html_export_spec.rb
|
83
|
+
- spec/spec_helper.rb
|
84
|
+
- templates/basic.html.erb
|
85
|
+
- templates/default_dradis_template_v3.0.html.erb
|
86
|
+
homepage: http://dradisframework.org
|
87
|
+
licenses:
|
88
|
+
- GPL-2
|
89
|
+
metadata: {}
|
90
|
+
post_install_message:
|
91
|
+
rdoc_options: []
|
92
|
+
require_paths:
|
93
|
+
- lib
|
94
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
95
|
+
requirements:
|
96
|
+
- - ">="
|
97
|
+
- !ruby/object:Gem::Version
|
98
|
+
version: 1.9.3
|
99
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ">="
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
requirements: []
|
105
|
+
rubygems_version: 3.1.2
|
106
|
+
signing_key:
|
107
|
+
specification_version: 4
|
108
|
+
summary: Dradis HTML export plugin
|
109
|
+
test_files:
|
110
|
+
- spec/requests/html_export_spec.rb
|
111
|
+
- spec/spec_helper.rb
|