diff --git a/activedirectory/activedirectory.go b/activedirectory/activedirectory.go index cf7837a..56d4e3a 100644 --- a/activedirectory/activedirectory.go +++ b/activedirectory/activedirectory.go @@ -177,6 +177,10 @@ func (m *ActiveDirectoryMatcher) Key() string { return "ACTIVEDIRECTORY" } +func (m *ActiveDirectoryMatcher) Type() string { + return "DIRECTORY" +} + func (m *ActiveDirectoryMatcher) Name(matchCtx *osm.MatchCtx) string { return "ActiveDirectory" } diff --git a/cassandra/cassandra.go b/cassandra/cassandra.go index 485f1cf..d26281f 100644 --- a/cassandra/cassandra.go +++ b/cassandra/cassandra.go @@ -23,6 +23,10 @@ func (m *CassandraMatcher) Key() string { return "CASSANDRA" } +func (m *CassandraMatcher) Type() string { + return "NOSQL" +} + func (m *CassandraMatcher) Name(matchCtx *osm.MatchCtx) string { return "Cassandra" } diff --git a/dns/dns.go b/dns/dns.go index c6578c4..7819a15 100644 --- a/dns/dns.go +++ b/dns/dns.go @@ -45,6 +45,10 @@ func (m *DNSMatcher) Key() string { return "DNS" } +func (m *DNSMatcher) Type() string { + return "NETWORK" +} + func (m *DNSMatcher) Name(matchCtx *osm.MatchCtx) string { return "DNS" } diff --git a/elasticsearch/elasticsearch.go b/elasticsearch/elasticsearch.go index 4db2a5d..80f5c0d 100644 --- a/elasticsearch/elasticsearch.go +++ b/elasticsearch/elasticsearch.go @@ -17,6 +17,10 @@ func (m *ElasticSearchMatcher) Key() string { return "ELASTICSEARCH" } +func (m *ElasticSearchMatcher) Type() string { + return "SEARCH" +} + func (m *ElasticSearchMatcher) Name(matchCtx *osm.MatchCtx) string { name := "ElasticSearch" if v, ok := matchCtx.GetAttribute("number"); ok { diff --git a/ftp/ftp.go b/ftp/ftp.go index 364ac6b..9550685 100644 --- a/ftp/ftp.go +++ b/ftp/ftp.go @@ -33,6 +33,10 @@ func (m *FTPMatcher) Key() string { return "FTP" } +func (m *FTPMatcher) Type() string { + return "NETWORK" +} + func (m *FTPMatcher) Name(matchCtx *osm.MatchCtx) string { return "FTP" } diff --git a/http/http.go b/http/http.go index 00df303..a328f75 100644 --- a/http/http.go +++ b/http/http.go @@ -14,6 +14,10 @@ func (m *HTTPMatcher) Key() string { return "HTTP" } +func (m *HTTPMatcher) Type() string { + return "WEB" +} + func (m *HTTPMatcher) Name(matchCtx *osm.MatchCtx) string { name := "HTTP" if v, ok := matchCtx.GetAttribute("server"); ok { diff --git a/imap/imap.go b/imap/imap.go index 48df72a..01d1677 100644 --- a/imap/imap.go +++ b/imap/imap.go @@ -17,6 +17,10 @@ func (m *IMAPMatcher) Key() string { return "IMAP" } +func (m *IMAPMatcher) Type() string { + return "MAIL" +} + func (m *IMAPMatcher) Name(matchCtx *osm.MatchCtx) string { return "IMAP" } diff --git a/ldap/ldap.go b/ldap/ldap.go index c270eb8..b56e3f0 100644 --- a/ldap/ldap.go +++ b/ldap/ldap.go @@ -22,6 +22,10 @@ func (m *LDAPMatcher) Key() string { return "LDAP" } +func (m *LDAPMatcher) Type() string { + return "DIRECTORY" +} + func (m *LDAPMatcher) Name(matchCtx *osm.MatchCtx) string { return "LDAP" } diff --git a/lpd/lpd.go b/lpd/lpd.go index f18792c..6a511c5 100644 --- a/lpd/lpd.go +++ b/lpd/lpd.go @@ -12,6 +12,10 @@ func (m *LPDMatcher) Key() string { return "LPD" } +func (m *LPDMatcher) Type() string { + return "NETWORK" +} + func (m *LPDMatcher) Name(matchCtx *osm.MatchCtx) string { return "LPD (Printer)" } diff --git a/matcher.go b/matcher.go index f777eec..20de11a 100644 --- a/matcher.go +++ b/matcher.go @@ -1,9 +1,12 @@ package matcher -import "fmt" +import ( + "fmt" +) type Matcher interface { Key() string + Type() string Name(matchCtx *MatchCtx) string IsPrePacket() bool diff --git a/mongodb/mongodb.go b/mongodb/mongodb.go index 5870b8b..f7c42ed 100644 --- a/mongodb/mongodb.go +++ b/mongodb/mongodb.go @@ -54,6 +54,10 @@ func (m *MongoDBMatcher) Key() string { return "MONGODB" } +func (m *MongoDBMatcher) Type() string { + return "NOSQL" +} + func (m *MongoDBMatcher) Name(matchCtx *osm.MatchCtx) string { return "MongoDB" } diff --git a/mysql/mysql.go b/mysql/mysql.go index 44227de..2d63a57 100644 --- a/mysql/mysql.go +++ b/mysql/mysql.go @@ -17,6 +17,10 @@ func (m *MySqlMatcher) Key() string { return "MYSQL" } +func (m *MySqlMatcher) Type() string { + return "DATABASE" +} + func (m *MySqlMatcher) Name(matchCtx *osm.MatchCtx) string { name := "MySQL" if v, ok := matchCtx.GetAttribute("version"); ok { diff --git a/nbss/nbss.go b/nbss/nbss.go index de8f5f8..2a336b3 100644 --- a/nbss/nbss.go +++ b/nbss/nbss.go @@ -33,6 +33,10 @@ func (m *NBSSMatcher) Key() string { return "NBSS" } +func (m *NBSSMatcher) Type() string { + return "NETWORK" +} + func (m *NBSSMatcher) Name(matchCtx *osm.MatchCtx) string { return "NBSS" } diff --git a/oracle/oracle.go b/oracle/oracle.go index c8a81e9..3105577 100644 --- a/oracle/oracle.go +++ b/oracle/oracle.go @@ -14,6 +14,11 @@ type OracleMatcher struct { func (m *OracleMatcher) Key() string { return "ORACLE" } + +func (m *OracleMatcher) Type() string { + return "DATABASE" +} + func (m *OracleMatcher) Name(matchCtx *osm.MatchCtx) string { return "Oracle" } diff --git a/pop/pop.go b/pop/pop.go index 1b18864..7fe9d8b 100644 --- a/pop/pop.go +++ b/pop/pop.go @@ -16,6 +16,10 @@ func (m *POPMatcher) Key() string { return "POP3" } +func (m *POPMatcher) Type() string { + return "MAIL" +} + func (m *POPMatcher) Name(matchCtx *osm.MatchCtx) string { return "POP3" } diff --git a/postgresql/postgresql.go b/postgresql/postgresql.go index 1c6b82c..ab8f8bc 100644 --- a/postgresql/postgresql.go +++ b/postgresql/postgresql.go @@ -45,6 +45,10 @@ func (m *PostgreSQLMatcher) Key() string { return "POSTGRESQL" } +func (m *PostgreSQLMatcher) Type() string { + return "DATABASE" +} + func (m *PostgreSQLMatcher) Name(matchCtx *osm.MatchCtx) string { return "PostgreSQL" } diff --git a/redis/redis.go b/redis/redis.go index 98db016..6e8cc07 100644 --- a/redis/redis.go +++ b/redis/redis.go @@ -20,6 +20,10 @@ func (m *RedisMatcher) Key() string { return "REDIS" } +func (m *RedisMatcher) Type() string { + return "NOSQL" +} + func (m *RedisMatcher) Name(matchCtx *osm.MatchCtx) string { name := "Redis" diff --git a/rmi/rmi.go b/rmi/rmi.go index ddef85b..1d6909a 100644 --- a/rmi/rmi.go +++ b/rmi/rmi.go @@ -35,6 +35,10 @@ func (m *RMIMatcher) Key() string { return "RMI" } +func (m *RMIMatcher) Type() string { + return "NETWORK" +} + func (m *RMIMatcher) Name(matchCtx *osm.MatchCtx) string { return "RMI" } diff --git a/smb/smb.go b/smb/smb.go index a1be8e6..fee213c 100644 --- a/smb/smb.go +++ b/smb/smb.go @@ -56,6 +56,10 @@ func (m *SMBMatcher) Key() string { return "SMB" } +func (m *SMBMatcher) Type() string { + return "NETWORK" +} + func (m *SMBMatcher) Name(matchCtx *osm.MatchCtx) string { return "SMB" } diff --git a/smtp/smtp.go b/smtp/smtp.go index d649331..f08b726 100644 --- a/smtp/smtp.go +++ b/smtp/smtp.go @@ -14,6 +14,10 @@ func (m *SmtpMatcher) Key() string { return "SMTP" } +func (m *SmtpMatcher) Type() string { + return "MAIL" +} + func (m *SmtpMatcher) Name(matchCtx *osm.MatchCtx) string { return "SMTP" } diff --git a/snmp/v2/snmpv2.go b/snmp/v2/snmpv2.go index 8b20485..63a6d2e 100644 --- a/snmp/v2/snmpv2.go +++ b/snmp/v2/snmpv2.go @@ -47,6 +47,10 @@ func (s *SNMPMatcher) Key() string { return "SNMP" } +func (m *SNMPMatcher) Type() string { + return "MONITORING" +} + func (s *SNMPMatcher) Name(matchCtx *osm.MatchCtx) string { return "SNMP" } diff --git a/sqlserver/sqlserver.go b/sqlserver/sqlserver.go index 5dd2dda..7b539fd 100644 --- a/sqlserver/sqlserver.go +++ b/sqlserver/sqlserver.go @@ -73,6 +73,10 @@ func (m *SQLServerMatcher) Key() string { return "SQLSERVER" } +func (m *SQLServerMatcher) Type() string { + return "DATABASE" +} + func (m *SQLServerMatcher) Name(matchCtx *osm.MatchCtx) string { if m.isSSL { return "SQL Server (SSL)" diff --git a/ssh/ssh.go b/ssh/ssh.go index 99bdf94..d61bb47 100644 --- a/ssh/ssh.go +++ b/ssh/ssh.go @@ -16,6 +16,10 @@ func (m *SSHMatcher) Key() string { return "SSH" } +func (m *SSHMatcher) Type() string { + return "NETWORK" +} + func (m *SSHMatcher) Name(matchCtx *osm.MatchCtx) string { name := "SSH" if v, ok := matchCtx.GetAttribute("softwareversion"); ok { diff --git a/telnet/telnet.go b/telnet/telnet.go index 36397a2..ad54df1 100644 --- a/telnet/telnet.go +++ b/telnet/telnet.go @@ -20,6 +20,10 @@ func (m *TelnetMatcher) Key() string { return "TELNET" } +func (m *TelnetMatcher) Type() string { + return "NETWORK" +} + func (m *TelnetMatcher) Name(matchCtx *osm.MatchCtx) string { return "Telnet" } diff --git a/wmi/wmi.go b/wmi/wmi.go index ab1e921..267dad6 100644 --- a/wmi/wmi.go +++ b/wmi/wmi.go @@ -25,6 +25,10 @@ func (m *WMIMatcher) Key() string { return "WMI" } +func (m *WMIMatcher) Type() string { + return "MONITORING" +} + func (m *WMIMatcher) Name(matchCtx *osm.MatchCtx) string { return "WMI" }