📄 arnold.sql
字号:
CREATE TABLE blocked_reason (blocked_reasonid SERIAL PRIMARY KEY,text VARCHAR);CREATE TABLE identity (identityid SERIAL PRIMARY KEY,mac VARCHAR NOT NULL, -- MAC-address of computerblocked_status VARCHAR CHECK (blocked_status='enabled' OR blocked_status='disabled'),blocked_reasonid INT REFERENCES blocked_reason ON UPDATE CASCADE ON DELETE SET NULL, -- reason of blockswportid INT NOT NULL, -- FK to swport-table. We find sysname,ip,module and port from thisswsysname VARCHAR, -- current sysname of switch, kept for consistency checkswvendor VARCHAR, -- vendor of switch, used to determine snmp-queryswip INET, -- current ip of switch, kept for consistency checkswmodule VARCHAR, -- current module, kept for consistency checkswport INT, -- current port, kept for consistency checkswifindex INT, -- current ifindex, kept for consistency checkcommunity VARCHAR, -- community of switchip INET, -- current ip of computerdns VARCHAR, -- current dns-name of computernetbios VARCHAR, -- current netbios-name of computerstarttime TIMESTAMP NOT NULL, -- time of first event on this computer-swport combolastchanged TIMESTAMP NOT NULL, -- time of last current event on this computer-swport comboautoenable TIMESTAMP, -- time for autoenableautoenablestep INT, -- number of days to wait for autoenablemultiple INT, -- stores the amount of computers detected behind this portmail VARCHAR, -- the mail address the warning was sent tosecret CHAR(1), -- flag this tuple as visible only to members of the secret clubuserlock VARCHAR, -- lock this tuple to the specified user, it is visible but not possible to enable by other usersorgid VARCHAR,determined CHAR(1), -- set to y if this is mac/port combo is blocked with the -d option.UNIQUE (mac,swportid));CREATE TABLE event (eventid SERIAL PRIMARY KEY,identityid INT REFERENCES identity ON UPDATE CASCADE ON DELETE CASCADE,event_comment VARCHAR,blocked_status VARCHAR CHECK (blocked_status='enabled' OR blocked_status='disabled'),blocked_reasonid INT REFERENCES blocked_reason ON UPDATE CASCADE ON DELETE SET NULL, -- reason of blockeventtime TIMESTAMP NOT NULL,autoenablestep INT,username VARCHAR NOT NULL);-- A block, of lack of better name, is a run where we do automatic blocking -- of computers based on input ip-list.CREATE TABLE block (blockid SERIAL PRIMARY KEY,blocktitle VARCHAR NOT NULL, -- title of blockblockdesc VARCHAR, -- description of blockmailfile VARCHAR, -- path to mailfile to use to send mail when blockingreasonid INT REFERENCES blocked_reason ON UPDATE CASCADE ON DELETE CASCADE,private CHAR(1), -- if set uses the -k parameter in Arnolddetermined CHAR(1), -- if set uses the -d parameter in Arnoldincremental CHAR(1), -- if set uses the -e parameter in Arnoldblocktime INT NOT NULL, -- days from block to autoenableuserid VARCHAR, -- the user that blocks the ip-adressesactive CHAR(1) CHECK (active='y' OR active='n'), -- if set to n will not do blocking of this kindlastedited TIMESTAMP NOT NULL, -- timestamp of last time this block was editedlastedituser VARCHAR NOT NULL, -- username of user who last edited this blockinputfile VARCHAR -- path to file where list of ip-adresses is, if applicable);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -