email token duplication check

This commit is contained in:
geek 2018-06-21 21:50:07 +09:00
parent 4e7c34f4d2
commit 4df4a962b6

View File

@ -56,27 +56,130 @@ INSERT INTO public.api_key (api_key,domain_id) VALUES (
INSERT INTO public.api_key (api_key,domain_id) VALUES ( INSERT INTO public.api_key (api_key,domain_id) VALUES (
'09c8c54f319911e8a41f3222d3c76cf6',4); '09c8c54f319911e8a41f3222d3c76cf6',4);
INSERT INTO public.probe (authorize_date,cidr,"name", description,encryption_key,probe_key,authorize_member_id,domain_id,meta_probe_status_id, target_count) VALUES ( INSERT INTO public.probe (authorize_date,cidr,connect_address,connect_date,description,encryption_key,"name",probe_key,target_count,authorize_member_id,domain_id,meta_probe_status_id) VALUES
'2017-08-21 14:48:31.563','192.168.1.0/24','snoop probe','test probe 111111','8c51fa9c5bcc11e7980a080027658d13','899fdd145bcc11e7b611080027658d13',1,1,1,0); ('2017-08-21 14:48:31.563','192.168.1.0/24',NULL,NULL,'test probe 111111','8c51fa9c5bcc11e7980a080027658d13','snoop probe','899fdd145bcc11e7b611080027658d13',0,1,1,1);
INSERT INTO public.probe (authorize_date,cidr,connect_address,connect_date,description,encryption_key,"name",probe_key,target_count,authorize_member_id,domain_id,meta_probe_status_id) VALUES
('2017-08-21 15:00:09.691','192.168.2.0/24',NULL,NULL,'test probe 22222','f1f72c8d2a814580bb7c4615ec43a6a8','insanity probe','95d8bcdc739741dca74c4a0e489e0774',0,1,1,1);
INSERT INTO public.probe (authorize_date,cidr,connect_address,connect_date,description,encryption_key,"name",probe_key,target_count,authorize_member_id,domain_id,meta_probe_status_id) VALUES
('2018-06-21 20:17:30.689','192.168.1.0/24','192.168.1.101:60074','2018-06-21 20:17:32.034',NULL,'$2a$10$rPZYValfYvsVb8oDDz7gkuuf1FpqVnG8xbxQa.NhKdH7WDi.H2UD.','crusader-ubuntu probe','b04f6809754411e8b5f2367a389c8dcd',0,1,1,1);
INSERT INTO public.probe (authorize_date,cidr,"name", description,encryption_key,probe_key,authorize_member_id,domain_id,meta_probe_status_id, target_count) VALUES ( INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (1,1,1);
'2017-08-21 15:00:09.691','192.168.2.0/24','insanity probe','test probe 22222','f1f72c8d2a814580bb7c4615ec43a6a8','95d8bcdc739741dca74c4a0e489e0774',1,1,1,0); INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,1);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,1);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (1,1,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (2,2,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra (infra_type,meta_infra_type_id,probe_id) VALUES (3,3,3);
INSERT INTO public.infra_zone ("address", iface, mac, network, id, meta_ip_type_id, meta_target_zone_type_id) VALUES
INSERT INTO public.infra (infra_type, meta_infra_type_id, probe_id) VALUES (1, 1, 1); ('192.168.1.101','enp3s0','44:8a:5b:f1:f1:f3','192.168.1.0/24',1,1,1);
INSERT INTO public.infra (infra_type, meta_infra_type_id, probe_id) VALUES (2, 2, 1); INSERT INTO public.infra_zone ("address",iface,mac,network,id,meta_ip_type_id,meta_target_zone_type_id) VALUES
INSERT INTO public.infra (infra_type, meta_infra_type_id, probe_id) VALUES (3, 3, 1); ('192.168.1.101/24','enp3s0','44:8a:5b:f1:f1:f3','192.168.1.0/24',4,1,NULL);
INSERT INTO public.infra_zone (id, meta_target_zone_type_id, network, iface, meta_ip_type_id, "address", mac) VALUES (1, 1, '192.168.1.0/24', 'enp3s0', 1, '192.168.1.101', '44:8a:5b:f1:f1:f3');
INSERT INTO public.infra_host_machine (meta) VALUES ('{"vendor": "Micro-Star International Co., Ltd.", "product": "GP60 2QF (To be filled by O.E.M.)", "version": "REV:1.0", "serial": "9S716GH21875ZF1000339"}'); INSERT INTO public.infra_host_machine (meta) VALUES ('{"vendor": "Micro-Star International Co., Ltd.", "product": "GP60 2QF (To be filled by O.E.M.)", "version": "REV:1.0", "serial": "9S716GH21875ZF1000339"}');
INSERT INTO public.infra_host_machine (meta) VALUES ('{}');
INSERT INTO public.infra_host_os ("name", os, platform, platform_family, platform_version, kernel_version, host_id) VALUES ('geek-ubuntu', 'linux', 'ubuntu', 'debian', '', '4.4.0-93-generic', '03000200-0400-0500-0006-000700080009'); INSERT INTO public.infra_host_os (host_id,kernel_version,meta,"name",os,platform,platform_family,platform_version) VALUES
('03000200-0400-0500-0006-000700080009','4.4.0-93-generic',NULL,'geek-ubuntu','linux','ubuntu','debian','');
INSERT INTO public.infra_host_os (host_id,kernel_version,meta,"name",os,platform,platform_family,platform_version) VALUES
('5c9e1778-f25f-4df3-8712-83973684e369','4.4.0-128-generic',NULL,'crusader-ubuntu','linux','ubuntu','debian',NULL);
INSERT INTO public.infra_host (id, infra_zone_id, meta_target_host_type_id, infra_host_machine_id, infra_host_os_id) VALUES (2, 1, 127, 1, 1); INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(2, NULL, 1, 1, 1, 127);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(5, NULL, 2, 2, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(6, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(7, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(8, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(9, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(10, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(11, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host (id, container_infra_host_id, infra_host_machine_id, infra_host_os_id, infra_zone_id, meta_target_host_type_id) VALUES
(12, NULL, NULL, NULL, 4, 100);
INSERT INTO public.infra_host_ip (infra_host_id, meta_ip_type_id, "address", mac) VALUES (2, 1, '192.168.1.101', '44:8a:5b:f1:f1:f3'); INSERT INTO public.infra_host_ip ("address", gateway, iface, mac, infra_host_id, meta_ip_type_id) VALUES
INSERT INTO public.infra_host_port (infra_host_ip_id, meta_port_type_id, port) VALUES (1, 1, 5432); ('192.168.1.101', NULL, NULL, '44:8a:5b:f1:f1:f3', 2, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.101/24', '192.168.1.254', 'enp3s0', '44:8a:5b:f1:f1:f3', 5, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('fe80::36c0:6c3e:6006:dd23/64', '192.168.1.254', 'enp3s0', '44:8a:5b:f1:f1:f3', 5, 2);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.23.0.1/16', NULL, 'br-6c078941d24b', '02:42:98:1e:b0:58', 5, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.20.0.1/16', NULL, 'br-7b643c9b5284', '02:42:aa:2a:dc:fb', 5, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('fe80::42:aaff:fe2a:dcfb/64', NULL, 'br-7b643c9b5284', '02:42:aa:2a:dc:fb', 5, 2);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.19.0.1/16', NULL, 'br-a73e4d7bd0ac', '02:42:e3:25:b7:44', 5, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.21.0.1/16', NULL, 'br-a87d468914e9', '02:42:b4:75:bc:9c', 5, 1);
INSERT INTO public.infra_host_ip (address,gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.18.0.1/16', NULL, 'br-bc97baaa807f', '02:42:2b:c8:e5:dd', 5, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.17.0.1/16', NULL, 'docker0', '02:42:ff:84:de:ab', 5, 1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.22.0.1/16',NULL,'br-30ea20f4fdbe','02:42:13:0a:eb:69',5,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('172.24.0.1/16',NULL,'br-629e1bf40111','02:42:8f:8f:5c:72',5,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('fe80::347a:38ff:fe9c:8dcd/64',NULL,'veth9163936','36:7a:38:9c:8d:cd',5,2);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.204',NULL,NULL,'a8:e5:39:5b:c9:62',6,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.50',NULL,NULL,'6c:f0:49:7a:60:68',7,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.10',NULL,NULL,'d0:50:99:97:5d:99',8,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.254',NULL,NULL,'64:e5:99:63:e7:80',9,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.102',NULL,NULL,'44:8a:5b:f1:f2:d3',10,1);
INSERT INTO public.infra_host_ip ("address",gateway,iface,mac,infra_host_id,meta_ip_type_id) VALUES
('192.168.1.103',NULL,NULL,'44:8a:5b:44:8c:e8',11,1);
INSERT INTO public.infra_host_ip ("address", gateway, iface, mac, infra_host_id, meta_ip_type_id) VALUES
('192.168.1.206',NULL,NULL,'30:9c:23:15:a3:09',12,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (5432,1,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (22,15,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (161,17,2);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (53,17,2);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (22,16,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (161,14,2);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (21,19,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (137,20,2);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (80,16,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (139,18,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (88,14,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (445,18,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (443,16,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (135,18,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (80,20,1);
INSERT INTO public.infra_host_port (port, infra_host_ip_id, meta_port_type_id) VALUES (80,17,1);
INSERT INTO public.infra_host_application (infra_host_id, "name") VALUES (2, 'Apache Httpd'); INSERT INTO public.infra_host_application (infra_host_id, "name") VALUES (2, 'Apache Httpd');
@ -89,13 +192,41 @@ INSERT INTO public.infra_host_daemon (infra_host_id, "name") VALUES (2, 'Apache
INSERT INTO public.infra_host_daemon (infra_host_id, "name") VALUES (2, 'PostgreSQL'); INSERT INTO public.infra_host_daemon (infra_host_id, "name") VALUES (2, 'PostgreSQL');
INSERT INTO public.infra_host_daemon (infra_host_id, "name") VALUES (2, 'MySQL'); INSERT INTO public.infra_host_daemon (infra_host_id, "name") VALUES (2, 'MySQL');
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (3,NULL,1,1,1035);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (13,NULL,2,1,1047);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (14,NULL,3,1,1043);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (15,NULL,4,1,1008);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (16,NULL,5,1,1047);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (17,NULL,6,1,1042);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (18,NULL,7,1,1012);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (19,NULL,8,2,1000);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (20,NULL,9,1,1014);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (21,NULL,10,1,1029);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (22,NULL,11,1,1014);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (23,NULL,12,1,1039);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (24,NULL,13,2,1000);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (25,NULL,14,1,1053);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (26,NULL,15,1,1014);
INSERT INTO public.infra_service (id, description, infra_host_port_id, meta_crypto_type_id, meta_target_service_type_id) VALUES (27,NULL,16,1,1014);
INSERT INTO public.infra_service (id, meta_target_service_type_id, infra_host_port_id, meta_crypto_type_id) VALUES (3, 1035, 1, 1);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (1, 'Zone', 'Zone Target', 1, 2); INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (1, 'Zone', 'Zone Target', 1, 2);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Host Target', 1, 127); INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Host Target', 1, 127);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1035); INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1035);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Alpine Linux Host Target', 1, 101);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Alpine Linux Host Target', 1, 101);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'CentOS Host Target', 1, 104);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (2, 'Host', 'Mac OS X Host Target', 1, 117);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1036);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1053);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1050);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1027);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1030);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1032);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1023);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1020);
INSERT INTO public.target (infra_id, "name", description, sensor_count, meta_target_type_id) VALUES (3, 'Service', 'Service Target', 1, 1019);
INSERT INTO public.sensor (target_id, "name", description, meta_sensor_status_id, meta_crawler_id, item_count) VALUES ( INSERT INTO public.sensor (target_id, "name", description, meta_sensor_status_id, meta_crawler_id, item_count) VALUES (
1, 'Zone Sensor', 'Network Change Detection', 1, 1, 0); 1, 'Zone Sensor', 'Network Change Detection', 1, 1, 0);