Skip to content

Commit

Permalink
Merge pull request #140 from SerpicoProject/issue138
Browse files Browse the repository at this point in the history
support for issue138
  • Loading branch information
BuffaloWill committed Jul 29, 2016
2 parents 370f3d4 + 618ddc1 commit 6600542
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
21 changes: 19 additions & 2 deletions serpico.rb
Expand Up @@ -368,6 +368,14 @@
redirect to("/no_access") if not is_administrator?

@config = config_options
if config_options["cvss"]
@scoring = "cvss"
elsif config_options["dread"]
@scoring = "dread"
else
@scoring = "default"
end

haml :config, :encode_html => true
end

Expand All @@ -385,15 +393,24 @@
config_options["ldap"] = params["ldap"] ? true : false
config_options["ldap_domain"] = params["ldap_domain"]
config_options["ldap_dc"] = params["ldap_dc"]
config_options["dread"] = params["dread"] ? true : false
config_options["cvss"] = params["cvss"] ? true : false
config_options["burpmap"] = params["burpmap"] ? true : false
config_options["nessusmap"] = params["nessusmap"] ? true : false
config_options["logo"] = params["logo"]
config_options["auto_import"] = params["auto_import"] ? true : false
config_options["chart"] = params["chart"] ? true : false
config_options["threshold"] = params["threshold"]

if params["risk_scoring"] == "CVSS"
config_options["dread"] = false
config_options["cvss"] = true
elsif params["risk_scoring"] == "DREAD"
config_options["dread"] = true
config_options["cvss"] = false
else
config_options["dread"] = false
config_options["cvss"] = false
end

File.open("./config.json","w") do |f|
f.write(JSON.pretty_generate(config_options))
end
Expand Down
19 changes: 19 additions & 0 deletions views/config.haml
Expand Up @@ -5,9 +5,28 @@
%br
%form
%table
%tr
%td
Risk Scoring Algorithm
%td
%select{ :name => "risk_scoring" }
- if @scoring == "default"
%option{ :selected => "selected" } Default
- else
%option Default Scoring
- if @scoring == "dread"
%option{ :selected => "selected" } DREAD
- else
%option DREAD
- if @scoring == "cvss"
%option{ :selected => "selected" } CVSS
- else
%option CVSS

- @config.each do |k,v|
- next if k =~ /ssl_certificate/
- next if k =~ /ssl_key/
- next if k == "cvss" or k == "dread"
%tr
%td
#{k}
Expand Down

0 comments on commit 6600542

Please sign in to comment.