示例#1
0
 def __init__(self):
     BaseBackend.__init__(self, models.Listing)
     self.ip = IP()
     self.sensor = Sensor()
     self.host = Host()
     self.reason = Reason()
     self.duration = Duration()
     self.user = User()
     self.historylisting = HistoryListing()
     self.config = Config()
     self.ipcalc = IPCalc()
示例#2
0
文件: key.py 项目: jesk78/blacklist
 def __init__(self):
     BaseBackend.__init__(self, models.Key)
     self.config = Config()
     self.encryption = Encryption(self.config["blacklist.keystore.psk"])
示例#3
0
basedir = "/www/blacklist/app/backup"

from blacklist.common.config			import Config
from blacklist.middleware.country		import Country
from blacklist.middleware.rir			import RIR
from blacklist.middleware.asnum			import ASNum
from blacklist.middleware.subnet		import Subnet
from blacklist.middleware.whitelisting	import WhiteListing
from blacklist.middleware.peering		import Peering
from blacklist.middleware.rule			import Rule
from blacklist.middleware.duration		import Duration
from blacklist.middleware.listing		import Listing
from blacklist.middleware.historylisting	import HistoryListing

config = Config()
asnum = ASNum()
country = Country()
rir = RIR()
subnet = Subnet()
whitelisting = WhiteListing()
peering = Peering()
rule = Rule()
duration = Duration()
listing = Listing()
historylisting = HistoryListing()

def log(msg):
	stdout.write(msg)
	stdout.flush()
示例#4
0
 def __init__(self):
     BaseBackend.__init__(self, models.Peering)
     self.config = Config()
     self.encryption = Encryption(self.config["blacklist.keystore.psk"])
     self.ipcalc = IPCalc()
     self.netdata = NetData()
示例#5
0
import sys
import os.path
import os

sys.path.append("%DJANGO_ROOT%")
os.environ["DJANGO_SETTINGS_MODULE"] = "settings"

from blacklist.common.config	import Config

def help():
	print "Usage: %s (get|set|del|list) <key> [<value>]" % (os.path.basename(sys.argv[0]))
	sys.exit(1)

if __name__ == "__main__":
	if not len(sys.argv) in [2,3,4]: help()
	if not sys.argv[1] in ["get", "set", "del", "list"]: help()

	cfg = Config()
	if sys.argv[1] == "get":
		print "==> Getting %s" % (sys.argv[2])
		print cfg[sys.argv[2]]
	elif sys.argv[1] == "set":
		print "==> Setting %s => %s" % (sys.argv[2], sys.argv[3])
		cfg[sys.argv[2]] = sys.argv[3]
	elif sys.argv[1] == "del":
		del(cfg[sys.argv[2]])
	elif sys.argv[1] == "list":
		for k in cfg.keys():
			print "%s: %s" % (k, cfg[k])
 def __init__(self):
     self.config = Config()
     self.context = zmq.Context()
     self.broker = self.context.socket(zmq.REQ)
     self.broker.connect(self.config["blacklist.broker"])
     self.encryption = Encryption(self.config["blacklist.api.psk"])
示例#7
0
from django.template			import RequestContext

from blacklist.common.config		import Config
from blacklist.common.search		import Search
from blacklist.common.broker		import Broker
from blacklist.forms.search			import SearchForm
from blacklist.middleware.country	import Country
from blacklist.middleware.rir		import RIR
from blacklist.middleware.asnum		import ASNum
from blacklist.middleware.subnet	import Subnet 
from blacklist.table.country		import CountryTable
from blacklist.table.rir			import RIRTable
from blacklist.table.asnum			import ASNumTable
from blacklist.table.subnet			import SubnetTable

cfg = Config()
country = Country()
rir = RIR()
asnum = ASNum()
subnet = Subnet()
broker = Broker()

@login_required
def countries(request):
	errmsg = ""
	listing_changed = False
	whitelisting_changed = False

	for item in request.GET.keys():
		if item.startswith("id_"):
			(result, cc) = country.get(id=item[3:])