Skip to content

Commit

Permalink
Report file type (#78)
Browse files Browse the repository at this point in the history
* changes to report file types

* fixing save

* auto detect file type

* ui bug

* auto detect file type

* fix file type checks

* Move these for better organization

* setup for additional reporting features

* Bugfix and feature enhancement

Fix issue where headers and footers don't update variables
Fix issue where CVSS Vector incorrectly showed the CVSS Score
Setup for more reporting features.

* allow report options in pr

* adding jar
  • Loading branch information
summitt authored Oct 21, 2024
1 parent d55dbca commit 1074561
Show file tree
Hide file tree
Showing 36 changed files with 904 additions and 1,446 deletions.
17 changes: 17 additions & 0 deletions WebContent/WEB-INF/jsp/assessment/AddVuln.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,23 @@ td:first-child {
</div>

</bs:row>
<s:if test="sectionsEnabled">
<bs:row>
<div class="form-group">
<label for="section" class="col-sm-2 control-label">Section:
<span id="reportSection_header"></span>
</label>
<div class="col-sm-10">
<select class="select2 form-control field-error" id="reportSection"
style="width: 100%">
<s:iterator value="sections" var="section">
<option value="<s:property value="#section[0]"/>"><s:property value="#section[1]"/></option>
</s:iterator>
</select>
</div>
</div>
</bs:row>
</s:if>
<s:if test="assessment.type.cvss31 || assessment.type.cvss40" >
<div class="cvss<s:property value="assessment.type.cvss31 || assessment.type.cvss40"/>">
<bs:row>
Expand Down
4 changes: 3 additions & 1 deletion WebContent/WEB-INF/jsp/assessment/editVulnJSON.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
"dfcatid" : "<s:property value="current.defaultVuln.category.id"/>",
"catid" : "<s:property value="current.category.id"/>",
"cvssScore" : "<s:property value="current.cvssScore" escapeJavaScript="true"/>",
"cvssString" : "<s:property value="current.cvssString" escapeJavaScript="true"/>"
"cvssString" : "<s:property value="current.cvssString" escapeJavaScript="true"/>",
"section" : "<s:property value="current.section" escapeJavaScript="true"/>",
"sectionPretty" : "<s:property value="current.sectionPretty" escapeJavaScript="true"/>"
}


53 changes: 42 additions & 11 deletions WebContent/WEB-INF/jsp/cms/ReportingTemplates.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,41 @@
</bs:row>
<br>
<hr>
<s:if test="sectionsEnabled">
<bs:row>
<div class="box-header with-border">
<h3 class="box-title">Report Sections</h3>
</div>
</bs:row>
<bs:row>
<input type="text" id="sectionName" class="form-control" placeholder="Report Section Name"/>
<br>
<button class="btn btn-block btn-info btn-lg" id="addSection">Add
Section</button>
<br>
</bs:row>
<bs:row>
<bs:datatable columns="Section Name,Variable,Edit"
classname="primary" id="reportSectionsTable">
<s:iterator value="reportSections" var="sectionName">
<tr>
<td><s:property value="#sectionName[1]" /></td>
<td><s:property value="#sectionName[0]" /></td>
<td> <span class="vulnControl vulnControl-delete deleteSection"
id="deleteSection_<s:property value="#sectionName[0]"/>"> <i class="fa fa-trash"></i>
</span></td>
</tr>
</s:iterator>
</bs:datatable>
</bs:row>
</s:if>
<br>
<hr>
<bs:row>
<div class="box-header with-border">
<h3 class="box-title">Generate Sample Reports</h3>
</div>
</bs:row>
<bs:row>
<bs:select name="Assessment Type" colsize="6" id="asmtType">
<s:iterator value="types">
Expand Down Expand Up @@ -103,18 +137,15 @@
classname="primary" id="templates">
<s:iterator value="templates">
<tr>
<td><s:property value="name"/></td>
<td><s:property value="team.teamName"/></td>
<td><s:property value="type.type"/></td>
<td><s:property value="name" /></td>
<td><s:property value="team.teamName" /></td>
<td><s:property value="type.type" /></td>
<td>${retest}</td>
<td>
<span class="vulnControl editUser" id="tmpEdit${id}">
<i class="fa fa-edit"></i>
</span>
<span class="vulnControl vulnControl-delete deleteUser" id="tmpDel${id}">
<i class="fa fa-trash"></i>
</span>
</td>
<td><span class="vulnControl editUser" id="tmpEdit${id}">
<i class="fa fa-edit"></i>
</span> <span class="vulnControl vulnControl-delete deleteUser"
id="tmpDel${id}"> <i class="fa fa-trash"></i>
</span></td>
</tr>
</s:iterator>
</bs:datatable>
Expand Down
15 changes: 14 additions & 1 deletion WebContent/WEB-INF/jsp/cms/TemplateUpload.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,25 @@
</bs:select>
</bs:row>
<bs:row>
<bs:select name="Result File Type" colsize="12" id="fileType">
<s:iterator value="fileTypes" var="fileType">
<s:if test="#fileType.equals(selectedTemplate.fileType)" >
<option value="${fileType }" selected="selected">${fileType}</option>
</s:if>
<s:else>
<option value="${fileType }">${fileType}</option>

</s:else>
</s:iterator>
</bs:select>
</bs:row>
<bs:row>
<form enctype="multipart/form-data" action="cms" id="imgForm" method="POST" style="display:none">
<input type="hidden" id="id" value="${id}" name="id"/>
<input type="hidden" id="action" value="templateSave" name="action"/>

<div class="col-md-12">
<label class="control-label">Select Docx File</label>
<label class="control-label">Select DOCX File</label>
<input id="image" type="file" name="file_data"/>
</div>

Expand Down
34 changes: 0 additions & 34 deletions WebContent/WEB-INF/jsp/cms/cms.jsp

This file was deleted.

188 changes: 0 additions & 188 deletions WebContent/WEB-INF/jsp/cms/cmsEditors.jsp

This file was deleted.

5 changes: 0 additions & 5 deletions WebContent/WEB-INF/jsp/cms/imgJSON.jsp

This file was deleted.

Loading

0 comments on commit 1074561

Please sign in to comment.