summaryrefslogtreecommitdiffstats
path: root/snort-details-html.lsp
blob: 35eebbec31475fcd687d8a6e72972d1e2fddc4dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<% local data, viewlibrary, page_info, session = ...
htmlviewfunctions = require("htmlviewfunctions")
html = require("acf.html")
%>

<% viewlibrary.dispatch_component("status") %>

<% local header_level = htmlviewfunctions.displaysectionstart(data, page_info) %>
<% local header_level2 = htmlviewfunctions.incrementheader(header_level) %>
<% local header_level3 = htmlviewfunctions.incrementheader(header_level2) %>
<% 
if #data.value == 0 then
	io.write("<p>No alerts found</p>")
else
	for i,priority in ipairs(data.value) do %>
		<% htmlviewfunctions.displaysectionstart(cfe({label=priority.name}), page_info, header_level2) %>
		<% for cls in pairs(priority.value) do %>
			<% htmlviewfunctions.displaysectionstart(cfe({label=cls}), page_info, header_level3) %>
			<% for id,alert in pairs(priority.value[cls]) do %>
				<p><b><%= html.html_escape(alert.value[1]) %></b><br/>
				<% for j=2, table.maxn(alert.value) do %>
					<%= html.html_escape(alert.value[j]) %><br/>
				<% end %>
				<i>(This alarm is repeated <b><%= html.html_escape(alert.count) %></b> times)</i>
				<% if (table.maxn(alert.url) ~= 0) then %>
					( URL's:
					<% for k,url in ipairs(alert.url) do %>
						<a href="<%= html.html_escape(url) %>" target="_new"><img src="<%= html.html_escape(page_info.wwwprefix..page_info.staticdir) %>/tango/16x16/categories/applications-internet.png" alt="<%= html.html_escape(url) %>"></a>
					<% end %>
				)
				<% end %>
				</p>
			<% end %>
			<% htmlviewfunctions.displaysectionend(header_level3) %>
		<% end %>
		<% htmlviewfunctions.displaysectionend(header_level2) %>
	<% end %>
<% end %>
<% htmlviewfunctions.displaysectionend(header_level) %>