Skip to content

Commit ca4177a

Browse files
committed
feat(alert-detail): update alert detail fields to use target and adversary terminology
1 parent 17a82b3 commit ca4177a

2 files changed

Lines changed: 29 additions & 37 deletions

File tree

backend/src/main/resources/templates/mail/alertEmailAttachment.html

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ <h2 th:text="${alert.getId() + ':' + alert.getName()}"></h2>
3333
<tr style="font-family:Roboto, sans-serif;font-size: 13px">
3434
<td style="font-weight: bold;" th:text="'Category:'"></td>
3535
<td th:text="${alert.getCategory()}"></td>
36-
<td style="font-weight: bold;" th:text="'Protocol:'"></td>
37-
<td th:text="${alert.getProtocol()}"></td>
3836
<td style="font-weight: bold;" th:text="'Generated by:'"></td>
3937
<td th:text="${alert.getDataType()}"></td>
4038
</tr>
@@ -90,7 +88,7 @@ <h2 th:text="${alert.getId() + ':' + alert.getName()}"></h2>
9088
</table>
9189
</div>
9290
<hr>
93-
<div style="margin-bottom: 20px" th:if="${alert.getSource() != null || alert.getDestination() != null}">
91+
<div style="margin-bottom: 20px" th:if="${alert.getTarget() != null || alert.getAdversary() != null}">
9492
<div style="text-align: center;margin-bottom: 10px;font-weight: bold;font-size: 14px;"
9593
th:text="'Involved Hosts/ IPs'"></div>
9694
<table style="width: 100%;border-collapse: collapse;">
@@ -111,30 +109,30 @@ <h2 th:text="${alert.getId() + ':' + alert.getName()}"></h2>
111109
</tr>
112110
</thead>
113111
<tbody>
114-
<tr th:if="${alert.getSource() != null}" th:with="source=${alert.getSource()}">
112+
<tr th:if="${alert.getTarget() != null}" th:with="source=${alert.getAdversary()}">
115113
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
116114
th:text="${(source.getIp() != null && !source.getIp().isEmpty()) ? source.getIp() : '-'}"></td>
117115
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
118116
th:text="${source.getPort() != null ? source.getPort() : '-'}"></td>
119117
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
120118
th:text="${(source.getHost() != null && !source.getHost().isEmpty()) ? source.getHost() : '-'}"></td>
121119
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
122-
th:text="${(source.getCountry() != null && !source.getCountry().isEmpty()) ? source.getCountry() : '-'}"></td>
120+
th:text="${(source.getGeolocation() != null && source.getGeolocation().getCountry() != null && !source.getGeolocation().getCountry().isEmpty()) ? source.getGeolocation().getCountry() : '-'}"></td>
123121
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
124-
th:text="${(source.getCity() != null && !source.getCity().isEmpty()) ? source.getCity() : '-'}"></td>
122+
th:text="${(source.getGeolocation() != null && source.getGeolocation().getCity() != null && !source.getGeolocation().getCity().isEmpty()) ? source.getGeolocation().getCity() : '-'}"></td>
125123
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;" th:text="${'Source'}"></td>
126124
</tr>
127-
<tr th:if="${alert.getDestination() != null}" th:with="destination=${alert.getDestination()}">
125+
<tr th:if="${alert.getAdversary() != null}" th:with="destination=${alert.getAdversary()}">
128126
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
129127
th:text="${(destination.getIp() != null && !destination.getIp().isEmpty()) ? destination.getIp() : '-'}"></td>
130128
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
131129
th:text="${destination.getPort() != null ? destination.getPort() : '-'}"></td>
132130
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
133131
th:text="${(destination.getHost() != null && !destination.getHost().isEmpty()) ? destination.getHost() : '-'}"></td>
134132
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
135-
th:text="${(destination.getCountry() != null && !destination.getCountry().isEmpty()) ? destination.getCountry() : '-'}"></td>
133+
th:text="${(destination.getGeolocation() != null && destination.getGeolocation().getCountry() != null && !destination.getGeolocation().getCountry().isEmpty()) ? destination.getGeolocation().getCountry() : '-'}"></td>
136134
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;"
137-
th:text="${(destination.getCity() != null && !destination.getCity().isEmpty()) ? destination.getCity() : '-'}"></td>
135+
th:text="${(destination.getGeolocation() != null && destination.getGeolocation().getCity() != null && !destination.getGeolocation().getCity().isEmpty()) ? destination.getGeolocation().getCity() : '-'}"></td>
138136
<td style="border: 1px solid #dddddd;font-size: 13px;" th:text="${'Destination'}"></td>
139137
</tr>
140138
</tbody>
@@ -159,7 +157,7 @@ <h2 th:text="${alert.getId() + ':' + alert.getName()}"></h2>
159157
<tbody>
160158
<tr th:each="relatedLog: ${relatedLogs}">
161159
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;vertical-align: top;"
162-
th:text="${relatedLog.getLogx().get('type')}"></td>
160+
th:text="${relatedLog.getLog().get('type')}"></td>
163161
<td style="padding: 3px 3px;border: 1px solid #dddddd;font-size: 13px;vertical-align: top;"
164162
th:with="timestampFormatted = ${relatedLog.getTimestampFormatted()}"
165163
th:text="${#strings.isEmpty(timestampFormatted) ? '-' : timestampFormatted}"></td>

backend/src/main/resources/templates/mail/fragments/alert-detail-fragment.html

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<body>
44

55
<div th:fragment="alert-detail"
6-
th:with="source=${alert.getSource()}, destination=${alert.getDestination()}">
6+
th:with="source=${alert.getTarget()}, destination=${alert.getAdversary()}">
77
<table>
88
<thead>
99
<tr>
@@ -30,80 +30,74 @@
3030

3131
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
3232
th:if="${source != null && !#strings.isEmpty(source.getHost())}">
33-
<td style="font-weight: bold;vertical-align: top;" th:text="'Source Hostname:'"></td>
33+
<td style="font-weight: bold;vertical-align: top;" th:text="'Target Hostname:'"></td>
3434
<td style="vertical-align: top;" th:text="${source.getHost()}"></td>
3535
</tr>
3636

3737
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
3838
th:if="${source != null && !#strings.isEmpty(source.getIp())}">
39-
<td style="font-weight: bold;vertical-align: top;" th:text="'Source Ip:'"></td>
39+
<td style="font-weight: bold;vertical-align: top;" th:text="'Target Ip:'"></td>
4040
<td style="vertical-align: top;" th:text="${source.getIp()}"></td>
4141
</tr>
4242

4343
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
4444
th:if="${source != null && source.getPort() != null && source.getPort() > 0}">
45-
<td style="font-weight: bold;vertical-align: top;" th:text="'Source Port:'"></td>
45+
<td style="font-weight: bold;vertical-align: top;" th:text="'Target Port:'"></td>
4646
<td style="vertical-align: top;" th:text="${source.getPort()}"></td>
4747
</tr>
4848

4949
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
5050
th:if="${source != null && !#strings.isEmpty(source.getUser())}">
51-
<td style="font-weight: bold;vertical-align: top;" th:text="'Source User:'"></td>
51+
<td style="font-weight: bold;vertical-align: top;" th:text="'Target User:'"></td>
5252
<td style="vertical-align: top;" th:text="${source.getUser()}"></td>
5353
</tr>
5454

5555
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
56-
th:if="${source != null && !#strings.isEmpty(source.getCountry())}">
57-
<td style="font-weight: bold;vertical-align: top;" th:text="'Source Country:'"></td>
58-
<td style="vertical-align: top;" th:text="${source.getCountry()}"></td>
56+
th:if="${source != null && source.getGeolocation() != null && !#strings.isEmpty(source.getGeolocation().getCountry())}">
57+
<td style="font-weight: bold;vertical-align: top;" th:text="'Target Country:'"></td>
58+
<td style="vertical-align: top;" th:text="${source.getGeolocation().getCountry()}"></td>
5959
</tr>
6060

6161
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
62-
th:if="${source != null && !#strings.isEmpty(source.getCity())}">
63-
<td style="font-weight: bold;vertical-align: top;" th:text="'Source City:'"></td>
64-
<td style="vertical-align: top;" th:text="${source.getCity()}"></td>
62+
th:if="${source != null && source.getGeolocation() != null && !#strings.isEmpty(source.getGeolocation().getCity())}">
63+
<td style="font-weight: bold;vertical-align: top;" th:text="'Target City:'"></td>
64+
<td style="vertical-align: top;" th:text="${source.getGeolocation().getCity()}"></td>
6565
</tr>
6666

6767
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
6868
th:if="${destination != null && !#strings.isEmpty(destination.getHost())}">
69-
<td style="font-weight: bold;vertical-align: top;" th:text="'Destination Hostname:'"></td>
69+
<td style="font-weight: bold;vertical-align: top;" th:text="'Adversary Hostname:'"></td>
7070
<td style="vertical-align: top;" th:text="${destination.getHost()}"></td>
7171
</tr>
7272

7373
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
7474
th:if="${destination != null && !#strings.isEmpty(destination.getIp())}">
75-
<td style="font-weight: bold;vertical-align: top;" th:text="'Destination Ip:'"></td>
75+
<td style="font-weight: bold;vertical-align: top;" th:text="'Adversary Ip:'"></td>
7676
<td style="vertical-align: top;" th:text="${destination.getIp()}"></td>
7777
</tr>
7878

7979
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
8080
th:if="${destination != null && destination.getPort() != null && destination.getPort() > 0}">
81-
<td style="font-weight: bold;vertical-align: top;" th:text="'Destination Port:'"></td>
81+
<td style="font-weight: bold;vertical-align: top;" th:text="'Adversary Port:'"></td>
8282
<td style="vertical-align: top;" th:text="${destination.getPort()}"></td>
8383
</tr>
8484

8585
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
8686
th:if="${destination != null && !#strings.isEmpty(destination.getUser())}">
87-
<td style="font-weight: bold;vertical-align: top;" th:text="'Destination User:'"></td>
87+
<td style="font-weight: bold;vertical-align: top;" th:text="'Adversary User:'"></td>
8888
<td style="vertical-align: top;" th:text="${destination.getUser()}"></td>
8989
</tr>
9090

9191
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
92-
th:if="${destination != null && !#strings.isEmpty(destination.getCountry())}">
93-
<td style="font-weight: bold;vertical-align: top;" th:text="'Destination Country:'"></td>
94-
<td style="vertical-align: top;" th:text="${destination.getCountry()}"></td>
92+
th:if="${destination != null && destination.getGeolocation() != null && !#strings.isEmpty(destination.getGeolocation().getCountry())}">
93+
<td style="font-weight: bold;vertical-align: top;" th:text="'Adversary Country:'"></td>
94+
<td style="vertical-align: top;" th:text="${destination.getGeolocation().getCountry()}"></td>
9595
</tr>
9696

9797
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
98-
th:if="${destination != null && !#strings.isEmpty(destination.getCity())}">
99-
<td style="font-weight: bold;vertical-align: top;" th:text="'Destination City:'"></td>
100-
<td style="vertical-align: top;" th:text="${destination.getCity()}"></td>
101-
</tr>
102-
103-
<tr style="font-family:Roboto, sans-serif;font-size: 13px"
104-
th:if="${!#strings.isEmpty(alert.getProtocol())}">
105-
<td style="font-weight: bold;vertical-align: top;" th:text="'Protocol:'"></td>
106-
<td style="vertical-align: top;" th:text="${alert.getProtocol()}"></td>
98+
th:if="${destination != null && destination.getGeolocation() != null && !#strings.isEmpty(destination.getGeolocation().getCity())}">
99+
<td style="font-weight: bold;vertical-align: top;" th:text="'Adversary City:'"></td>
100+
<td style="vertical-align: top;" th:text="${destination.getGeolocation().getCity()}"></td>
107101
</tr>
108102

109103
<tr style="font-family:Roboto, sans-serif;font-size: 13px"

0 commit comments

Comments
 (0)