type added

This commit is contained in:
crusader 2018-09-12 13:26:27 +09:00
parent add118ce9d
commit 0ef5ca805c
25 changed files with 101 additions and 1 deletions

View File

@ -177,6 +177,10 @@ func (m *ActiveDirectoryMatcher) Key() string {
return "ACTIVEDIRECTORY" return "ACTIVEDIRECTORY"
} }
func (m *ActiveDirectoryMatcher) Type() string {
return "DIRECTORY"
}
func (m *ActiveDirectoryMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *ActiveDirectoryMatcher) Name(matchCtx *osm.MatchCtx) string {
return "ActiveDirectory" return "ActiveDirectory"
} }

View File

@ -23,6 +23,10 @@ func (m *CassandraMatcher) Key() string {
return "CASSANDRA" return "CASSANDRA"
} }
func (m *CassandraMatcher) Type() string {
return "NOSQL"
}
func (m *CassandraMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *CassandraMatcher) Name(matchCtx *osm.MatchCtx) string {
return "Cassandra" return "Cassandra"
} }

View File

@ -45,6 +45,10 @@ func (m *DNSMatcher) Key() string {
return "DNS" return "DNS"
} }
func (m *DNSMatcher) Type() string {
return "NETWORK"
}
func (m *DNSMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *DNSMatcher) Name(matchCtx *osm.MatchCtx) string {
return "DNS" return "DNS"
} }

View File

@ -17,6 +17,10 @@ func (m *ElasticSearchMatcher) Key() string {
return "ELASTICSEARCH" return "ELASTICSEARCH"
} }
func (m *ElasticSearchMatcher) Type() string {
return "SEARCH"
}
func (m *ElasticSearchMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *ElasticSearchMatcher) Name(matchCtx *osm.MatchCtx) string {
name := "ElasticSearch" name := "ElasticSearch"
if v, ok := matchCtx.GetAttribute("number"); ok { if v, ok := matchCtx.GetAttribute("number"); ok {

View File

@ -33,6 +33,10 @@ func (m *FTPMatcher) Key() string {
return "FTP" return "FTP"
} }
func (m *FTPMatcher) Type() string {
return "NETWORK"
}
func (m *FTPMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *FTPMatcher) Name(matchCtx *osm.MatchCtx) string {
return "FTP" return "FTP"
} }

View File

@ -14,6 +14,10 @@ func (m *HTTPMatcher) Key() string {
return "HTTP" return "HTTP"
} }
func (m *HTTPMatcher) Type() string {
return "WEB"
}
func (m *HTTPMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *HTTPMatcher) Name(matchCtx *osm.MatchCtx) string {
name := "HTTP" name := "HTTP"
if v, ok := matchCtx.GetAttribute("server"); ok { if v, ok := matchCtx.GetAttribute("server"); ok {

View File

@ -17,6 +17,10 @@ func (m *IMAPMatcher) Key() string {
return "IMAP" return "IMAP"
} }
func (m *IMAPMatcher) Type() string {
return "MAIL"
}
func (m *IMAPMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *IMAPMatcher) Name(matchCtx *osm.MatchCtx) string {
return "IMAP" return "IMAP"
} }

View File

@ -22,6 +22,10 @@ func (m *LDAPMatcher) Key() string {
return "LDAP" return "LDAP"
} }
func (m *LDAPMatcher) Type() string {
return "DIRECTORY"
}
func (m *LDAPMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *LDAPMatcher) Name(matchCtx *osm.MatchCtx) string {
return "LDAP" return "LDAP"
} }

View File

@ -12,6 +12,10 @@ func (m *LPDMatcher) Key() string {
return "LPD" return "LPD"
} }
func (m *LPDMatcher) Type() string {
return "NETWORK"
}
func (m *LPDMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *LPDMatcher) Name(matchCtx *osm.MatchCtx) string {
return "LPD (Printer)" return "LPD (Printer)"
} }

View File

@ -1,9 +1,12 @@
package matcher package matcher
import "fmt" import (
"fmt"
)
type Matcher interface { type Matcher interface {
Key() string Key() string
Type() string
Name(matchCtx *MatchCtx) string Name(matchCtx *MatchCtx) string
IsPrePacket() bool IsPrePacket() bool

View File

@ -54,6 +54,10 @@ func (m *MongoDBMatcher) Key() string {
return "MONGODB" return "MONGODB"
} }
func (m *MongoDBMatcher) Type() string {
return "NOSQL"
}
func (m *MongoDBMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *MongoDBMatcher) Name(matchCtx *osm.MatchCtx) string {
return "MongoDB" return "MongoDB"
} }

View File

@ -17,6 +17,10 @@ func (m *MySqlMatcher) Key() string {
return "MYSQL" return "MYSQL"
} }
func (m *MySqlMatcher) Type() string {
return "DATABASE"
}
func (m *MySqlMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *MySqlMatcher) Name(matchCtx *osm.MatchCtx) string {
name := "MySQL" name := "MySQL"
if v, ok := matchCtx.GetAttribute("version"); ok { if v, ok := matchCtx.GetAttribute("version"); ok {

View File

@ -33,6 +33,10 @@ func (m *NBSSMatcher) Key() string {
return "NBSS" return "NBSS"
} }
func (m *NBSSMatcher) Type() string {
return "NETWORK"
}
func (m *NBSSMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *NBSSMatcher) Name(matchCtx *osm.MatchCtx) string {
return "NBSS" return "NBSS"
} }

View File

@ -14,6 +14,11 @@ type OracleMatcher struct {
func (m *OracleMatcher) Key() string { func (m *OracleMatcher) Key() string {
return "ORACLE" return "ORACLE"
} }
func (m *OracleMatcher) Type() string {
return "DATABASE"
}
func (m *OracleMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *OracleMatcher) Name(matchCtx *osm.MatchCtx) string {
return "Oracle" return "Oracle"
} }

View File

@ -16,6 +16,10 @@ func (m *POPMatcher) Key() string {
return "POP3" return "POP3"
} }
func (m *POPMatcher) Type() string {
return "MAIL"
}
func (m *POPMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *POPMatcher) Name(matchCtx *osm.MatchCtx) string {
return "POP3" return "POP3"
} }

View File

@ -45,6 +45,10 @@ func (m *PostgreSQLMatcher) Key() string {
return "POSTGRESQL" return "POSTGRESQL"
} }
func (m *PostgreSQLMatcher) Type() string {
return "DATABASE"
}
func (m *PostgreSQLMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *PostgreSQLMatcher) Name(matchCtx *osm.MatchCtx) string {
return "PostgreSQL" return "PostgreSQL"
} }

View File

@ -20,6 +20,10 @@ func (m *RedisMatcher) Key() string {
return "REDIS" return "REDIS"
} }
func (m *RedisMatcher) Type() string {
return "NOSQL"
}
func (m *RedisMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *RedisMatcher) Name(matchCtx *osm.MatchCtx) string {
name := "Redis" name := "Redis"

View File

@ -35,6 +35,10 @@ func (m *RMIMatcher) Key() string {
return "RMI" return "RMI"
} }
func (m *RMIMatcher) Type() string {
return "NETWORK"
}
func (m *RMIMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *RMIMatcher) Name(matchCtx *osm.MatchCtx) string {
return "RMI" return "RMI"
} }

View File

@ -56,6 +56,10 @@ func (m *SMBMatcher) Key() string {
return "SMB" return "SMB"
} }
func (m *SMBMatcher) Type() string {
return "NETWORK"
}
func (m *SMBMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *SMBMatcher) Name(matchCtx *osm.MatchCtx) string {
return "SMB" return "SMB"
} }

View File

@ -14,6 +14,10 @@ func (m *SmtpMatcher) Key() string {
return "SMTP" return "SMTP"
} }
func (m *SmtpMatcher) Type() string {
return "MAIL"
}
func (m *SmtpMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *SmtpMatcher) Name(matchCtx *osm.MatchCtx) string {
return "SMTP" return "SMTP"
} }

View File

@ -47,6 +47,10 @@ func (s *SNMPMatcher) Key() string {
return "SNMP" return "SNMP"
} }
func (m *SNMPMatcher) Type() string {
return "MONITORING"
}
func (s *SNMPMatcher) Name(matchCtx *osm.MatchCtx) string { func (s *SNMPMatcher) Name(matchCtx *osm.MatchCtx) string {
return "SNMP" return "SNMP"
} }

View File

@ -73,6 +73,10 @@ func (m *SQLServerMatcher) Key() string {
return "SQLSERVER" return "SQLSERVER"
} }
func (m *SQLServerMatcher) Type() string {
return "DATABASE"
}
func (m *SQLServerMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *SQLServerMatcher) Name(matchCtx *osm.MatchCtx) string {
if m.isSSL { if m.isSSL {
return "SQL Server (SSL)" return "SQL Server (SSL)"

View File

@ -16,6 +16,10 @@ func (m *SSHMatcher) Key() string {
return "SSH" return "SSH"
} }
func (m *SSHMatcher) Type() string {
return "NETWORK"
}
func (m *SSHMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *SSHMatcher) Name(matchCtx *osm.MatchCtx) string {
name := "SSH" name := "SSH"
if v, ok := matchCtx.GetAttribute("softwareversion"); ok { if v, ok := matchCtx.GetAttribute("softwareversion"); ok {

View File

@ -20,6 +20,10 @@ func (m *TelnetMatcher) Key() string {
return "TELNET" return "TELNET"
} }
func (m *TelnetMatcher) Type() string {
return "NETWORK"
}
func (m *TelnetMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *TelnetMatcher) Name(matchCtx *osm.MatchCtx) string {
return "Telnet" return "Telnet"
} }

View File

@ -25,6 +25,10 @@ func (m *WMIMatcher) Key() string {
return "WMI" return "WMI"
} }
func (m *WMIMatcher) Type() string {
return "MONITORING"
}
func (m *WMIMatcher) Name(matchCtx *osm.MatchCtx) string { func (m *WMIMatcher) Name(matchCtx *osm.MatchCtx) string {
return "WMI" return "WMI"
} }