108 lines
3.8 KiB
Mako
108 lines
3.8 KiB
Mako
<%inherit file="base.mako"/>
|
|
<%namespace name="base" file="base.mako"/>
|
|
|
|
## EMAIL SUBJECT
|
|
<%def name="subject()" filter="n,trim,whitespace_filter">
|
|
Security Audit Completed: ${repo_name}
|
|
</%def>
|
|
|
|
## PLAINTEXT VERSION OF BODY
|
|
<%def name="body_plaintext()" filter="n,trim">
|
|
Security Audit Results for ${repo_name}
|
|
|
|
Files Scanned: ${scan_summary.get('files_scanned', 0)}
|
|
Secrets Found: ${scan_summary.get('secrets_found', 0)}
|
|
|
|
% if scan_summary.get('secrets_found', 0) > 0:
|
|
FINDINGS:
|
|
% for finding in findings:
|
|
- ${finding['file']} (line ${finding['line']}): ${finding['type']}
|
|
% endfor
|
|
% else:
|
|
No exposed credentials or secrets were found.
|
|
% endif
|
|
|
|
---
|
|
${self.plaintext_footer()}
|
|
</%def>
|
|
|
|
## header
|
|
<table style="text-align:left;vertical-align:middle;width: 100%">
|
|
<tr>
|
|
<td style="width:100%;border-bottom:1px solid #dbd9da;">
|
|
<div style="margin: 0; font-weight: bold">
|
|
<div class="clear-both" style="margin-bottom: 4px">
|
|
<span style="color:#7E7F7F">${_('Security Scanner')}</span>
|
|
${_('completed audit for repository')}
|
|
<a href="${repo_url}" style="${base.link_css()}">${repo_name}</a>
|
|
</div>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<div class="clear-both"></div>
|
|
|
|
## main body
|
|
<table style="text-align:left;vertical-align:middle;width: 100%">
|
|
<tr>
|
|
<td style="width: 130px"></td>
|
|
<td></td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="padding-right:20px;"><strong>${_('Repository')}:</strong></td>
|
|
<td>
|
|
<a href="${repo_url}" style="${base.link_css()}">${repo_name}</a>
|
|
</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="padding-right:20px;"><strong>${_('Files Scanned')}:</strong></td>
|
|
<td>${scan_summary.get('files_scanned', 0)}</td>
|
|
</tr>
|
|
|
|
<tr>
|
|
<td style="padding-right:20px;"><strong>${_('Secrets Found')}:</strong></td>
|
|
<td>
|
|
% if scan_summary.get('secrets_found', 0) > 0:
|
|
<span style="color: #e85e4d; font-weight: bold;">${scan_summary.get('secrets_found', 0)}</span>
|
|
% else:
|
|
<span style="color: #0ac878; font-weight: bold;">0</span>
|
|
% endif
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
% if scan_summary.get('secrets_found', 0) > 0:
|
|
<div style="margin-top: 20px;">
|
|
<table style="text-align:left;vertical-align:middle;width: 100%; border-collapse: collapse;">
|
|
<tr style="background-color: #f5f5f5;">
|
|
<th style="padding: 8px; border: 1px solid #ddd; text-align: left;">${_('File')}</th>
|
|
<th style="padding: 8px; border: 1px solid #ddd; text-align: left;">${_('Line')}</th>
|
|
<th style="padding: 8px; border: 1px solid #ddd; text-align: left;">${_('Type')}</th>
|
|
</tr>
|
|
% for finding in findings:
|
|
<tr>
|
|
<td style="padding: 8px; border: 1px solid #ddd;"><code>${finding['file']}</code></td>
|
|
<td style="padding: 8px; border: 1px solid #ddd;">${finding['line']}</td>
|
|
<td style="padding: 8px; border: 1px solid #ddd;">${finding['type']}</td>
|
|
</tr>
|
|
% endfor
|
|
</table>
|
|
</div>
|
|
|
|
<div style="margin-top: 15px; padding: 10px; background-color: #fff3cd; border: 1px solid #ffc107; border-radius: 4px;">
|
|
<strong style="color: #856404;">${_('Action Required')}</strong>
|
|
<p style="margin: 5px 0 0 0; color: #856404;">
|
|
${_('Please review the findings above and remove or rotate any exposed credentials.')}
|
|
</p>
|
|
</div>
|
|
% else:
|
|
<div style="margin-top: 15px; padding: 10px; background-color: #d4edda; border: 1px solid #28a745; border-radius: 4px;">
|
|
<strong style="color: #155724;">${_('All Clear')}</strong>
|
|
<p style="margin: 5px 0 0 0; color: #155724;">
|
|
${_('No exposed credentials or secrets were found in this repository.')}
|
|
</p>
|
|
</div>
|
|
% endif
|