本文整理汇总了Python中fuglu.shared.ScannerPlugin.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python ScannerPlugin.__init__方法的具体用法?Python ScannerPlugin.__init__怎么用?Python ScannerPlugin.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fuglu.shared.ScannerPlugin
的用法示例。
在下文中一共展示了ScannerPlugin.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.backend = None
self.logger = self._logger()
self.requiredvars = {
'redis': {
'default': 'localhost:6379:0',
'description': 'redis config: host:port:db',
},
# commented, for now we only want the count
# 'lowthreshold':{
# 'default':'1',
# 'description': 'threshold for adding <headername>: LOW',
# },
# 'highthreshold':{
# 'default':'3',
# 'description': 'threshold for adding <headername>: HIGH',
# },
'headername': {
'default': 'X-FuZor',
'description': 'header name',
},
'maxsize': {
'default': '600000',
'description':
'maxsize in bytes, larger messages will be skipped'
},
'timeout': {
'default': '2',
'description': 'timeout in seconds'
},
}
示例2: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = {
'template_blockedfile': {
'default': '/etc/fuglu/templates/blockedfile.tmpl',
'description': 'Mail template for the bounce to inform sender about blocked attachment',
},
'sendbounce': {
'default': '1',
'description': 'inform the sender about blocked attachments.\nIf a previous plugin tagged the message as spam or infected, no bounce will be sent to prevent backscatter',
},
'rulesdir': {
'default': '/etc/fuglu/rules',
'description': 'directory that contains attachment rules',
},
'blockaction': {
'default': 'DELETE',
'description': 'what should the plugin do when a blocked attachment is detected\nREJECT : reject the message (recommended in pre-queue mode)\nDELETE : discard messages\nDUNNO : mark as blocked but continue anyway (eg. if you have a later quarantine plugin)',
},
'dbconnectstring': {
'default': '',
'description': 'sqlalchemy connectstring to load rules from a database and use files only as fallback. requires SQL extension to be enabled',
'confidential': True,
},
'query': {
'default': 'SELECT action,regex,description FROM attachmentrules WHERE scope=:scope AND checktype=:checktype ORDER BY prio',
'description': "sql query to load rules from a db. #:scope will be replaced by the recipient address first, then by the recipient domain\n:check will be replaced 'filename','contenttype','archive-filename' or 'archive-contenttype'",
},
'checkarchivenames': {
'default': '0',
'description': "enable scanning of filenames within archives (zip,rar). This does not actually extract the files, it just looks at the filenames found in the archive."
},
'checkarchivecontent': {
'default': '0',
'description': 'extract compressed archives(zip,rar) and check file content type with libmagics\nnote that the files will be extracted into memory - tune archivecontentmaxsize accordingly.\nfuglu does not extract archives within the archive(recursion)',
},
'archivecontentmaxsize': {
'default': '5000000',
'description': 'only extract and examine files up to this amount of (uncompressed) bytes',
},
}
self.logger = self._logger()
self.rulescache = None
self.extremeverbosity = False
# remember that the order is important here, if we support tar.gz and
# gz in the future make sure tar.gz comes first!
self.supported_archive_extensions = ['zip', ]
if RARFILE_AVAILABLE:
self.supported_archive_extensions.append('rar')
示例3: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self,config,section=None):
ScannerPlugin.__init__(self,config,section)
self.requiredvars={
'privatekeyfile':{
'description':"Location of the private key file. supports standard template variables plus additional ${header_from_domain} which extracts the domain name from the From: -Header",
'default':"/etc/fuglu/dkim/${header_from_domain}.key",
},
'canonicalizeheaders':{
'description':"Type of header canonicalization (simple or relaxed)",
'default':"relaxed",
},
'canonicalizebody':{
'description':"Type of body canonicalization (simple or relaxed)",
'default':"relaxed",
},
'selector':{
'description':'selector to use when signing, supports templates',
'default':'default',
},
'signheaders':{
'description':'comma separated list of headers to sign. empty string=sign all headers',
'default':'',
},
'signbodylength':{
'description':'include l= tag in dkim header',
'default':'False',
},
}
示例4: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, section=None):
ScannerPlugin.__init__(self, section)
self.filelist = FileList(strip=True, skip_empty=True, skip_comments=True, lowercase=True,
additional_filters=None, minimum_time_between_reloads=30)
self.requiredvars = {
'domainsfile': {
'default': '/etc/fuglu/spearphish-domains',
'description': 'Filename where we load spearphish domains from. One domain per line. If this setting is empty, the check will be applied to all domains.',
},
'virusenginename': {
'default': 'Fuglu SpearPhishing Protection',
'description': 'Name of this plugins av engine',
},
'virusname': {
'default': 'TRAIT.SPEARPHISH',
'description': 'Name to use as virus signature',
},
'virusaction': {
'default': 'DEFAULTVIRUSACTION',
'description': "action if spear phishing attempt is detected (DUNNO, REJECT, DELETE)",
},
'rejectmessage': {
'default': 'threat detected: ${virusname}',
'description': "reject message template if running in pre-queue mode and virusaction=REJECT",
},
}
示例5: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = {
"yararulesdir": {
"default": "/etc/fuglu/yararules",
"description": "Directory containing one or more YARA rule files",
},
"archivecontentmaxsize": {
"default": "5000000",
"description": "only extract and examine files up to this amount of (uncompressed) bytes",
},
"virusaction": {
"default": "DEFAULTVIRUSACTION",
"description": "action if infection is detected (DUNNO, REJECT, DELETE)",
},
"problemaction": {"default": "DEFER", "description": "action if there is a problem (DUNNO, DEFER)"},
"rejectmessage": {
"default": "threat detected in ${infectedfile}: ${virusname}",
"description": "reject message template if running in pre-queue mode and virusaction=REJECT",
},
}
self.filter = None
self.logger = self._logger()
self.lastreload = 0
self.compiled_rules = None
# remember that the order is important here, if we support tar.gz and
# gz in the future make sure tar.gz comes first!
self.supported_archive_extensions = ["zip"]
if RARFILE_AVAILABLE:
self.supported_archive_extensions.append("rar")
示例6: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self,config,section=None):
ScannerPlugin.__init__(self,config,section)
self.logger=logging.getLogger('fuglu.plugin.DomainAction')
self.requiredvars={
'blacklistconfig':{
'default':'/etc/fuglu/rbl.conf',
'description':'RBL Lookup config file',
},
'checksubdomains':{
'default':'yes',
'description':'check subdomains as well (from top to bottom, eg. example.com, bla.example.com, blubb.bla.example.com',
},
'action':{
'default':'reject',
'description':'action on hit (reject, delete, etc)',
},
'message':{
'default':'5.7.1 black listed URL ${domain} by ${blacklist}',
'description':'message template for rejects/ok messages',
},
'maxdomains':{
'default':'10',
'description':'maximum number of domains to check per message',
}
}
self.rbllookup=None
self.tldmagic=None
示例7: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = {
"path": {
"default": "/usr/local/fuglu/deliver/${to_address}",
"description": "Path to maildir / mbox file, supports templates",
},
# maybe we need to support our own locking later, for now we use python's built-ins
#'locktype':{
# 'default':'',
# 'description':"flock, ...",
# },
"boxtype": {"default": "mbox", "description": "mbox, maildir"},
# maybe we need to support various mbox types later, for now we use python's built-in module
#'subtype':{
# 'default':'',
# 'description':"what type of mbox... ",
# },
"filterfile": {"default": "", "description": "only store messages which use filter..."},
}
self.logger = self._logger()
self.filter = None
self.boxtypemap = {"mbox": self.deliver_mbox, "maildir": self.deliver_maildir}
示例8: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self,config,section=None):
ScannerPlugin.__init__(self,config,section)
self.requiredvars={
'greeting':{
'default':'hello world!',
'description':'greeting the plugin should log to the console',
}
}
示例9: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = { # this defines the configuration options for a plugin
'greeting': { # name of the config
'default': 'hello world!', # default value, always use strings here
'description': 'greeting message the plugin should log to the console', # included as comment when generating default config files
}
}
示例10: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.logger = self._logger()
self.requiredvars = {
'scriptdir': {
'default': '/etc/fuglu/scriptfilter',
'description': 'Dir that contains the scripts (*.fgf files)',
}
}
示例11: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.logger = self._logger()
self.requiredvars = {
'actionrules': {
'default': '/etc/fuglu/actionrules.regex',
'description': 'Rules file',
}
}
self.filter = None
示例12: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = {
'host': {
'default': 'localhost',
'description': 'hostname where the ICAP server runs',
},
'port': {
'default': '1344',
'description': "tcp port or path to unix socket",
},
'timeout': {
'default': '10',
'description': 'socket timeout',
},
'maxsize': {
'default': '22000000',
'description': "maximum message size, larger messages will not be scanned. ",
},
'retries': {
'default': '3',
'description': 'how often should fuglu retry the connection before giving up',
},
'virusaction': {
'default': 'DEFAULTVIRUSACTION',
'description': "action if infection is detected (DUNNO, REJECT, DELETE)",
},
'problemaction': {
'default': 'DEFER',
'description': "action if there is a problem (DUNNO, DEFER)",
},
'rejectmessage': {
'default': 'threat detected: ${virusname}',
'description': "reject message template if running in pre-queue mode and virusaction=REJECT",
},
'service': {
'default': 'AVSCAN',
'description': 'ICAP Av scan service, usually AVSCAN (sophos, symantec)',
},
'enginename': {
'default': 'icap-generic',
'description': "name of the virus engine behind the icap service. used to inform other plugins. can be anything like 'sophos', 'symantec', ...",
},
}
self.logger = self._logger()
示例13: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self,config,section=None):
ScannerPlugin.__init__(self,config,section)
self.requiredvars={
'dbconnectstring':{
'default':'....todo',
'description':'sqlalchemy connectstring to store the greylist',
'confidential':True,
},
}
self.logger=self._logger()
self.cache=None
示例14: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = {
"dbconnectstring": {
"default": "",
"description": "sqlalchemy connectstring to load vacations",
"confidential": True,
}
}
self.logger = self._logger()
self.cache = None
示例15: __init__
# 需要导入模块: from fuglu.shared import ScannerPlugin [as 别名]
# 或者: from fuglu.shared.ScannerPlugin import __init__ [as 别名]
def __init__(self, config, section=None):
ScannerPlugin.__init__(self, config, section)
self.requiredvars = {
'dbconnectstring': {
'default': '',
'description': 'sqlalchemy connectstring to load vacations',
'confidential': True,
},
}
self.logger = self._logger()
self.cache = None