'ccontinent': 'EU',
'asnumber': 8560,
'asname': '1&1 IONOS SE',
+ 'flags': ["NETWORK_FLAG_ANYCAST", "NETWORK_FLAG_ANONYMOUS_PROXY", "NETWORK_FLAG_SATELLITE_PROVIDER"],
}
}
net.country_code = data["ccode"]
net.asn = asn.number
+ # Check if one ore more network flags should be added to this network.
+ if "flags" in data.keys():
+ # Loop through the list of flags.
+ for flag in data["flags"]:
+ # Add flag to the network.
+ net.set_flag(getattr(location, flag))
+
# Write the database to disk
db.write("test.db")
alert tcp any any -> any any (msg:"China IP"; flow:established,to_server; geoip:dst,CN; sid:1; rev:1; flowbits:isnotset,china; flowbits:set,china;)
alert tcp any any -> any any (msg:"German IP"; flow:established,to_server; geoip: dst,DE; sid:2; rev:1; flowbits:isnotset,german; flowbits:set,german;)
+alert tcp any any -> any any (msg:"ANYCAST ADDRESS"; flow:established,to_server; anycast: dst; sid: 3; rev:1; flowbits:isnotset,anycast; flowbits:set,anycast;)
+alert tcp any any -> any any (msg:"ANONYMOUS PROXY"; flow:established,to_server; anonymous-proxy: dst; sid: 4; rev:1; flowbits:isnotset,anonymous-proxy; flowbits:set,anonymous-proxy;)
+alert tcp any any -> any any (msg:"SATELLITE PROVIDER"; flow:established,to_server; satellite-provider: dst; sid: 5; rev:1; flowbits:isnotset,satellite-provider; flowbits:set,satellite-provider;)
checks:
- # Check that we only have one alert event type in eve.
+ # Check that we only have four events in eve.
- filter:
- count: 1
+ count: 4
match:
event_type: alert
- # Check alert is the good one
+ # Check if the geoip keyword workded.
- filter:
count: 1
match:
event_type: alert
alert.signature_id: 2
+
+ # Check if the anycast keyword worked.
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 3
+
+ # Check if the anonymous-proxy keyword worked.
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 4
+
+ # Check if the satellite-provider keyworkd worked.
+ - filter:
+ count: 1
+ match:
+ event_type: alert
+ alert.signature_id: 5