Skip to content

Commit 2fc390f

Browse files
committed
System Touch
1 parent b409f7e commit 2fc390f

8 files changed

Lines changed: 217 additions & 26 deletions

File tree

heuristics/HeuristicClassifier.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,15 @@ public static final class Classification
337337
public String summary()
338338
{
339339
StringBuilder sb = new StringBuilder();
340-
sb.append("HeuristicClassifier [IP=").append(event.ip)
340+
sb.append("HEURISTICCLASSIFIER [IP=").append(event.ip)
341341
.append(" port=").append(event.port)
342342
.append(" country=").append(event.countryCode)
343343
.append("] score=").append(score).append("/100 — ")
344-
.append(threat ? "THREAT" : "CLEAR").append('\n');
345-
for (String f : findings) sb.append(" ").append(f).append('\n');
346-
return sb.toString().stripTrailing();
344+
.append(threat ? "THREAT" : "CLEAR");
345+
return sb.toString();
347346
}
347+
348+
/** Returns the individual finding lines (PASS / INFO / FAIL). */
349+
public java.util.List<String> findings() { return findings; }
348350
}
349351
}

logging/clamav.log

Lines changed: 188 additions & 0 deletions
Large diffs are not rendered by default.

source/commons/color/ColorResolver.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ public static String resolveCategoryColor(String className) {
3535
if (low.contains("liveness") || low.contains("monitor"))
3636
return ColorPalette.OID_LIVENESS;
3737

38+
if (low.contains("heuristic") || low.contains("classifier"))
39+
return ColorPalette.COLOR_YELLOW;
40+
3841
return ColorPalette.OID_DEFAULT;
3942
}
4043
}

source/heuristics/HeuristicClassifier.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,13 +413,15 @@ public static final class Classification
413413
public String summary()
414414
{
415415
StringBuilder sb = new StringBuilder();
416-
sb.append("HeuristicClassifier [IP=").append(event.ip)
416+
sb.append("HEURISTICCLASSIFIER [IP=").append(event.ip)
417417
.append(" port=").append(event.port)
418418
.append(" country=").append(event.countryCode)
419419
.append("] score=").append(score).append("/100 — ")
420-
.append(threat ? "THREAT" : "CLEAR").append('\n');
421-
for (String f : findings) sb.append(" ").append(f).append('\n');
422-
return sb.toString().stripTrailing();
420+
.append(threat ? "THREAT" : "CLEAR");
421+
return sb.toString();
423422
}
423+
424+
/** Returns the individual finding lines (PASS / INFO / FAIL). */
425+
public java.util.List<String> findings() { return findings; }
424426
}
425427
}

source/messaging/MessageQueue.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ public synchronized void send(final Message MESSAGE)
7373

7474
public synchronized void add(final Message MESSAGE)
7575
{
76-
CommonRails.printSystemComponent(this, this.hashCode(),"MessageQueue add >> receives ["+MESSAGE.MESSAGE_BUFFER.toString()+"].");
76+
CommonRails.printSystemComponent(this, this.hashCode(),
77+
"MESSAGEQUEUE add >> receives [" + MESSAGE.MESSAGE_BUFFER.toString().trim() + "].");
7778

7879
this.MESSAGES.add(MESSAGE);
7980
this.notifyAll();

source/messaging/MessageQueueSorter.java

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ public void run()
4545
{
4646
MessageQueue.Message message = message_queue.MESSAGES.remove(0);
4747

48-
// Audit trail: log the message to the telnet proxy writer.
49-
// ConnectionPoller.handleSession() has already completed the full
50-
// HTTP round-trip directly (Socket → tacobell.phd:80 → client), so
51-
// the sorter must NOT attempt a second read from the shared proxy
52-
// reader here — doing so would block waiting on a stream that has
53-
// already delivered its response and is now idle/closed.
5448
try
5549
{
5650
if (SocketUtils.isConnected(message.SOCKET)
@@ -64,13 +58,10 @@ public void run()
6458
writer.write("[IP Address]: "+ message.INTERNET_ADDRESS + "\n");
6559
writer.write("[Socket]: " + message.SOCKET + "\n");
6660
writer.flush();
67-
68-
CommonRails.printSystemComponent(this, this.hashCode(),
69-
". MessageQueueSorter >> audit logged to proxy writer for "
70-
+ message.INTERNET_ADDRESS + " .");
7161
}
7262

73-
message_queue.remove(message);
63+
CommonRails.printSystemComponent(this, this.hashCode(),
64+
". MessageQueueSorter >> processed [" + message.MESSAGE_BUFFER.toString().trim() + "] from " + message.INTERNET_ADDRESS + " .");
7465
}
7566
catch (SocketTimeoutException ste)
7667
{
@@ -80,8 +71,6 @@ public void run()
8071
catch (IOException e)
8172
{
8273
ExceptionHandler.dispatch(e);
83-
CommonRails.printSystemComponent(this, this.hashCode(),
84-
". MessageQueueSorter socket closed for " + message.INTERNET_ADDRESS + " .");
8574
}
8675
}
8776
}
@@ -96,11 +85,7 @@ public void run()
9685

9786
public synchronized void addMessage(final MessageQueue.Message MESSAGE)
9887
{
99-
CommonRails.printSystemComponent(this, this.hashCode(), ". WebExpress addMessage MESSAGE queue size before "+this.getMessageQueueSize()+" .");
100-
10188
this.WEBEXPRESS.MESSAGE_QUEUE.add(MESSAGE);
102-
103-
CommonRails.printSystemComponent(this, this.hashCode(), ". WebExpress addMessage MESSAGE queue size after "+this.getMessageQueueSize()+" .");
10489
}
10590

10691
public synchronized MessageQueue getMessageQueue()

source/national/NationalFinanceIDFeeder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,10 @@ public static NationalFinanceID greet(final Connection CONN)
159159
// National ID Finance prompt — runs after login for both new and returning users
160160
// ─────────────────────────────────────────────────────────────────────────
161161

162+
// Named class so ColorResolver sees "MessageHandler" → OID_MESSAGING (green)
163+
private static final class MessageHandler { }
164+
private static final MessageHandler MSG_OWNER = new MessageHandler();
165+
162166
private static void financePrompt(final Connection CONN, final NationalFinanceID NFID)
163167
{
164168
// Ensure proxy table exists
@@ -173,6 +177,10 @@ private static void financePrompt(final Connection CONN, final NationalFinanceID
173177
String input = prompt(CONN, line + " > ");
174178
if (input == null || input.equalsIgnoreCase("quit") || input.equalsIgnoreCase("exit")) break;
175179

180+
// Single system component print per input received (green/OID_MESSAGING)
181+
commons.CommonRails.printSystemComponent(MSG_OWNER, MSG_OWNER.hashCode(),
182+
"49152 >> receives [" + input.trim() + "] from NID " + NFID.nationalId + ".");
183+
176184
String cmd = input.trim().toLowerCase();
177185

178186
if (cmd.startsWith("crypto"))

source/server/base/BaseServer.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,8 @@ public void run()
176176
.build();
177177
HeuristicClassifier.Classification result = HEURISTIC.classify(event);
178178
CommonRails.printSystemComponent(this, this.hashCode(), result.summary());
179+
for (String finding : result.findings())
180+
CommonRails.printSystemComponent(HEURISTIC, HEURISTIC.hashCode(), finding);
179181
if (result.threat)
180182
{
181183
connection.SOCKET.close();

0 commit comments

Comments
 (0)