Aug 21 13:50:36 TSS kernel: [6031296.121710] [TS-bridge-inbound-17-D] IN=br0 OUT=br0 PHYSIN=eth1 PHYSOUT=eth0 MAC=70:4c:a5:46:cd:61:f8:75:a4:10:dd:9a:08:00 SRC=34.120.195.249 DST=192.168.1.131 LEN=52 TOS=0x00 PREC=0x00 TTL=128 ID=7632 DF PROTO=TCP SPT=49541 DPT=443 WINDOW=64240 RES=0x00 SYN URGP=0
/*This log has an SRC that matches a private/local IP address.*/
Aug 21 13:50:36 TSS kernel: [6031296.121710] [TS-bridge-inbound-17-D] IN=br0 OUT=br0 PHYSIN=eth1 PHYSOUT=eth0 MAC=70:4c:a5:46:cd:61:f8:75:a4:10:dd:9a:08:00 SRC=192.168.1.131 DST=34.120.195.249 LEN=52 TOS=0x00 PREC=0x00 TTL=128 ID=7632 DF PROTO=TCP SPT=49541 DPT=443 WINDOW=64240 RES=0x00 SYN URGP=0
These are the roles I am using:
<group name="firewall,">
<rule id="4100" level="15" overwrite="yes">
<category>firewall</category>
<description>t INTELLIGENCE blocked malicious traffic</description>
</rule>
</group>
<group name="firewall">
<rule id="100002" level="5">
<if_sid>4100</if_sid>
<match type="pcre2">\b(?!(10)|192\.168|172\.(2[0-9]|1[6-9]|3[0-1])|(25[6-9]|2[6-9][0-9]|[3-9][0-9][0-9]|99[1-9]))[0-9]{1,3}\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)</match>
<description>Traffic Flow: $(srcip) --> $(dstip)</description>
</rule>
<rule id="100004" level="10">
<field name="abuseipdb.source.rule" type="pcre2">^100002$</field>
<field name="abuseipdb.abuse_confidence_score" type="pcre2" negate="yes">^0$</field>
<description>Blocked: Malicious, a public IP address: $(srcip) with $(abuseipdb.abuse_confidence_score)% confidence of abuse.</description>
</rule>
</group>
I have analyzed the rule with id="100002". As I understand it, this rule captures information from rule id="4100" and analyzes the srcip field using a "pcre2" match type. This match type denies certain formats of private IP addresses, such as: 10.0.0.0/8, 192.168.0.0/16, 172.16.0.0/12, and 25.0.0.0 to 25.255.255.255. After detecting a public IP, rule id="100004" should take this information and send it to abuseIPDB, which will then provide information back about the score of the collected public IP.
The issue is that so far, the role with id="100004" has not been functioning for me. I am only reaching the role with id="100002". I have attached the test results for the role.
**Messages:
WARNING: (7003): 'd036f450' token expires
INFO: (7202): Session initialized with token 'b2922e53'
**Phase 1: Completed pre-decoding.
full event: 'Aug 21 13:50:36 TSS kernel: [6031296.121710] [TS-bridge-inbound-17-D] IN=br0 OUT=br0 PHYSIN=eth1 PHYSOUT=eth0 MAC=70:4c:a5:46:cd:61:f8:75:a4:10:dd:9a:08:00 SRC=34.120.195.249 DST=192.168.1.131 LEN=52 TOS=0x00 PREC=0x00 TTL=128 ID=7632 DF PROTO=TCP SPT=49541 DPT=443 WINDOW=64240 RES=0x00 SYN URGP=0'
timestamp: 'Aug 21 13:50:36'
hostname: 'TSS'
program_name: 'kernel'
**Phase 2: Completed decoding.
name: 'kernel'
parent: 'kernel'
action: '[TS-bridge-inbound-17-D]'
dstip: '192.168.1.131'
dstport: '443'
protocol: 'TCP'
srcip: '34.120.195.249'
srcport: '49541'
**Phase 3: Completed filtering (rules).
id: '100002'
level: '5'
description: 'Traffic Flow: 34.120.195.249 --> 192.168.1.131'
groups: '["firewall"]'
firedtimes: '1'
mail: 'false'
**Alert to be generated.
I would like to create a rule similar to rule id="100002" which analyzes the dstip field and does the same thing, searching for public IPs. It would be great if when role 100002 doesn't find a public IP in the srcip field during its analysis, it triggers another role, like id="10003", to check for a public IP in the dstip field.