Skip to content

Instantly share code, notes, and snippets.

@vjayajv
Last active May 26, 2023 16:22
Show Gist options
  • Save vjayajv/2fc83aaa80656f976bb39b447cad362d to your computer and use it in GitHub Desktop.
Save vjayajv/2fc83aaa80656f976bb39b447cad362d to your computer and use it in GitHub Desktop.
Grype report template
<!-- Go template for grype report -->
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Vulnerability Report</title>
<style>
.Critical {
background-color: #cd5c5c;
}
.High {
background-color: #f88379;
}
.Medium {
background-color: #fdf5e6;
}
.Low {
background-color: #f5f5dc;
}
@media only screen and (max-width: 620px) {
table[class=body] h1 {
font-size: 28px !important;
margin-bottom: 10px !important;
}
table[class=body] p,
table[class=body] ul,
table[class=body] ol,
table[class=body] td,
table[class=body] span,
table[class=body] a {
font-size: 16px !important;
}
table[class=body] .wrapper,
table[class=body] .article {
padding: 10px !important;
}
table[class=body] .content {
padding: 0 !important;
}
table[class=body] .container {
padding: 0 !important;
width: 100% !important;
}
table[class=body] .main {
border-left-width: 0 !important;
border-radius: 0 !important;
border-right-width: 0 !important;
}
table[class=body] .btn table {
width: 100% !important;
}
table[class=body] .btn a {
width: 100% !important;
}
table[class=body] .img-responsive {
height: auto !important;
max-width: 100% !important;
width: auto !important;
}
}
@media all {
.ExternalClass {
width: 100%;
}
.ExternalClass,
.ExternalClass p,
.ExternalClass span,
.ExternalClass font,
.ExternalClass td,
.ExternalClass div {
line-height: 100%;
}
.apple-link a {
color: inherit !important;
font-family: inherit !important;
font-size: inherit !important;
font-weight: inherit !important;
line-height: inherit !important;
text-decoration: none !important;
}
.btn-primary table td:hover {
background-color: #d5075d !important;
}
.btn-primary a:hover {
background-color: #d5075d !important;
border-color: #d5075d !important;
}
}
</style></head>
<body class style="background-color: #eaebed; font-family: sans-serif; -webkit-font-smoothing: antialiased; font-size: 14px; line-height: 1.4; margin: 0; padding: 0; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%;">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; min-width: 100%; background-color: #eaebed; width: 100%;" width="100%" bgcolor="#eaebed">
<tr>
<td class="container" style="font-family: sans-serif; font-size: 12px; vertical-align: top; display: block; max-width: 580px; padding: 10px; width: 580px; Margin: 0 auto;" width="580" valign="top">
<div class="header" style="padding: 20px 0;">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; min-width: 100%; width: 100%;" width="100%">
<tr>
</tr>
</table>
</div>
<div class="content" style="box-sizing: border-box; display: block; Margin: 0 auto; max-width: 600px; padding: 15px;">
<!-- START CENTERED WHITE CONTAINER -->
<span class="preheader" style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">Vulnerability Report</span>
<table role="presentation" class="main" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; min-width: 100%; background: #ffffff; border-radius: 3px; width: 100%;" width="100%">
<!-- START MAIN CONTENT AREA -->
<tr>
<td class="wrapper" style="font-family: sans-serif; font-size: 12px; vertical-align: top; box-sizing: border-box; padding: 22px;" valign="top">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; min-width: 100%; width: 100%;" width="100%">
<tr>
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top;" valign="top">
<p><a href=# style="color: #ec0867; text-decoration: underline;"><img src="https://www.securecoding.com/wp-content/uploads/2020/11/3-types-of-sec-vul-3.png" width="100%" alt="grype" style="border: none; -ms-interpolation-mode: bicubic; max-width: 100%;"></a></p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;">Vulnerability Report for {{.Source.Target.Tags}} .</p>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;">Upgrade packages below to Fixed-In version to avoid security risks.</p>
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="btn" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; box-sizing: border-box; min-width: 100%; width: 100%;" width="100%">
<tbody>
<tr>
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding-bottom: 15px;" valign="top">
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; min-width: auto; width: auto;">
<tbody>
<tr>
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">
<table class="styled-table" style="mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-collapse: collapse; margin: 25px 0; font-size: 0.9em; font-family: sans-serif; box-shadow: 0 0 20px rgba(0, 0, 0, 0.15); min-width: auto; width: auto;">
<tr>
<th style="padding: 12px 15px;">Package</th>
<th style="padding: 12px 15px;">Version</th>
<th style="padding: 12px 15px;">Fixed-In</th>
<th style="padding: 12px 15px;">Vulnerability ID</th>
<th style="padding: 12px 15px;">Severity</th>
</tr>
{{- range .Matches}}
<tr>
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">{{.Artifact.Name}}</td>
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">{{.Artifact.Version}}</td>
{{if .Vulnerability.Fix.Versions }}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">{{.Vulnerability.Fix.Versions}}</td>
{{else}}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">NA</td>
{{end}}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">{{.Vulnerability.ID}}</td>
{{if (eq .Vulnerability.Severity "Critical") }}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; color: #cd5c5c; border-radius: 5px; text-align: center;" valign="top" align="center">{{.Vulnerability.Severity}}</td>
{{else if (eq .Vulnerability.Severity "High") }}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; color: #f88379; border-radius: 5px; text-align: center;" valign="top" align="center">{{.Vulnerability.Severity}}</td>
{{else if (eq .Vulnerability.Severity "Medium") }}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; color: #f4c430; border-radius: 5px; text-align: center;" valign="top" align="center">{{.Vulnerability.Severity}}</td>
{{else if (eq .Vulnerability.Severity "Low") }}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; color: #eedc82; border-radius: 5px; text-align: center;" valign="top" align="center">{{.Vulnerability.Severity}}</td>
{{else }}
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top; padding: 12px 15px; background-color: #ffffff; border-radius: 5px; text-align: center;" valign="top" bgcolor="#ffffff" align="center">{{.Vulnerability.Severity}}</td>
</tr>
{{end}}
{{- end}}
</table>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p style="font-family: sans-serif; font-size: 14px; font-weight: normal; margin: 0; margin-bottom: 15px;">All the vulnerabilities above are identified and published CVEs (Common Vulnerabilities and Exposures) based on public vulnerability databases based on <a href="https://github.com/anchore/grype#grypes-database" style="color: #ec0867; text-decoration: underline;">grype's database</a>.</p>
</td>
</tr>
</table>
</td>
</tr>
<!-- END MAIN CONTENT AREA -->
</table>
<!-- END CENTERED WHITE CONTAINER -->
</div>
</td>
<td style="font-family: sans-serif; font-size: 12px; vertical-align: top;" valign="top">&nbsp;</td>
</tr>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment