Skip to content

Commit

Permalink
Snyk test (#1550)
Browse files Browse the repository at this point in the history
* deprecate k8s admission log UI

* whitespace change to re trigger checks

---------

Co-authored-by: Nasir Rabbani <[email protected]>
  • Loading branch information
mandibles232 and nasir-rabbani authored Apr 4, 2023
1 parent ef2c91d commit 77ba67b
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 57 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,4 +233,3 @@ Terrascan is licensed under the [Apache 2.0 License](LICENSE).

[![Forkers @tenable/terrascan](https://reporoster.com/forks/tenable/terrascan)](https://github.com/tenable/terrascan/network/members)


18 changes: 18 additions & 0 deletions pkg/http-server/assets/webhook-scan-logs.css
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,21 @@ ul {
color: #43e268;
font-weight: bold;
}

div.message {
position: relative;
padding: 10px;
padding-left: 35px;
margin: 30px 10px;
box-shadow:0 2px 5px rgba(0,0,0,.3);
background: #BBB;
color: #FFF;

-webkit-transition: all .5s ease;
-moz-transition: all .5s ease;
-ms-transition: all .5s ease;
-o-transition: all .5s ease;
transition: all .5s ease;
}

div.message.warning{background: #E74;}
59 changes: 32 additions & 27 deletions pkg/http-server/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,34 +1,39 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>K8s Admission Review Logs</title>
<head>
<title>K8s Admission Review Logs</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="/assets/jsonTree.css">
<link rel="stylesheet" href="/assets/webhook-scan-logs.css">
</head>
<body>
<table class="table table-sm" style="table-layout: fixed;" aria-describedby="logs-table">
<thead class="thead-light">
<tr>
</head>
<body>
<table class="table table-sm" style="table-layout: fixed;" aria-describedby="logs-table">
<thead class="thead-light">
<tr>
<th scope="col" style="width: 256px" >Time</th>
<th scope="col" style="width: 200px">Status</th>
<th scope="col" style="width: 50%">Request</th>
<th scope="col" style="width: 50%">Reasoning</th>
</tr>
</thead>
<tbody>
{{range .}}
<tr>
<td class="review-time"><a href={{.LogURL}} class="time-object" target="_blank">{{.CreatedAt}}</a></td>
<td class="review-status">{{.Status}}</td>
<td class="review-request json-object ">{{.Request}}</td>
<td class="review-reasoning json-object ">{{.Reasoning}}</td>
</tr>
{{end}}
</tbody>
</table>
<script type="text/javascript" src="/assets/jsonTree.js"></script>
<script type="text/javascript" src="/assets/moment.js"></script>
<script type="text/javascript" src="/assets/webhook-scan-logs.js"></script>
</body>
<th scope="col" style="width: 200px">Status</th>
<th scope="col" style="width: 50%">Request</th>
<th scope="col" style="width: 50%">Reasoning</th>
</tr>
</thead>
<tbody>
{{range .}}
<tr>
<td class="review-time"><a href={{.LogURL}} class="time-object" target="_blank">{{.CreatedAt}}</a></td>
<td class="review-status">{{.Status}}</td>
<td class="review-request json-object ">{{.Request}}</td>
<td class="review-reasoning json-object ">{{.Reasoning}}</td>
</tr>
{{end}}
</tbody>
</table>
<div class="warning message">
<h2>Deprecation Warning</h2>
<p>We're sorry to inform that K8s Admission Review Logs UI is deprecated and will be deleted in the upcoming
release.</p>
</div>
<script type="text/javascript" src="/assets/jsonTree.js"></script>
<script type="text/javascript" src="/assets/moment.js"></script>
<script type="text/javascript" src="/assets/webhook-scan-logs.js"></script>
</body>
</html>
65 changes: 36 additions & 29 deletions pkg/http-server/templates/show.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,41 @@
<link rel="stylesheet" href="/assets/webhook-scan-logs.css">
</head>
<body>
<main class="jumbotron">
<table class="table table-sm" style="table-layout: fixed;" aria-describedby="logs-table">
<tbody>
<tr>
<th scope="col" style="width: 256px">UID</th>
<th scope="col">{{.UID}}</th>
</tr>
<tr>
<th scope="col">Status</th>
<th scope="col" class="review-status">{{.Status}}</th>
</tr>
<tr>
<th scope="col">Request</th>
<th class="json-object" scope="col">{{.Request}}</th>
</tr>
<tr>
<th scope="col">Violations Summary</th>
<th class="json-object" scope="col">{{.Violations}}</th>
</tr>
<tr>
<th scope="col">Deniable Violations</th>
<th class="json-object" scope="col">{{.DeniableViolations}}</th>
</tr>
</tbody>
</table>
</main>
<script type="text/javascript" src="/assets/jsonTree.js"></script>
<script type="text/javascript" src="/assets/moment.js"></script>
<script type="text/javascript" src="/assets/webhook-scan-logs.js"></script>
<main class="jumbotron">
<table class="table table-sm" style="table-layout: fixed;" aria-describedby="logs-table">
<tbody>
<tr>
<th scope="col" style="width: 256px">UID</th>
<th scope="col">{{.UID}}</th>
</tr>
<tr>
<th scope="col">Status</th>
<th scope="col" class="review-status">{{.Status}}</th>
</tr>
<tr>
<th scope="col">Request</th>
<th class="json-object" scope="col">{{.Request}}</th>
</tr>
<tr>
<th scope="col">Violations Summary</th>
<th class="json-object" scope="col">{{.Violations}}</th>
</tr>
<tr>
<th scope="col">Deniable Violations</th>
<th class="json-object" scope="col">{{.DeniableViolations}}</th>
</tr>
</tbody>
</table>
</main>
<div>
<div class="warning message">
<h2>Deprecation Warning</h2>
<p>We're sorry to inform that K8s Admission Review Logs UI is deprecated and will be deleted in the upcoming
release.</p>
</div>
</div>
<script type="text/javascript" src="/assets/jsonTree.js"></script>
<script type="text/javascript" src="/assets/moment.js"></script>
<script type="text/javascript" src="/assets/webhook-scan-logs.js"></script>
</body>
</html>

0 comments on commit 77ba67b

Please sign in to comment.