This commit is contained in:
Ryan Prather 2018-12-01 23:21:20 -05:00
parent 5849a2620e
commit dfb81bf388
No known key found for this signature in database
GPG Key ID: 66FDE2B4E8AB87A7
8 changed files with 224 additions and 235 deletions

View File

@ -48,10 +48,14 @@
*/ */
set_time_limit(0); set_time_limit(0);
include_once 'vendor/autoload.php';
include_once 'config.inc'; include_once 'config.inc';
include_once 'import.inc'; include_once 'import.inc';
include_once 'helper.inc'; include_once 'helper.inc';
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
chdir(dirname(__FILE__)); chdir(dirname(__FILE__));
$db = new db(); $db = new db();

View File

@ -252,8 +252,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "sw_man_match", "table": "sw_man_match",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -454,8 +454,8 @@
"schema": "rmf", "schema": "rmf",
"table": "family", "table": "family",
"field": "abbr", "field": "abbr",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -502,8 +502,8 @@
"schema": "rmf", "schema": "rmf",
"table": "controls", "table": "controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "rmf_related_controls_related_id", "id": "rmf_related_controls_related_id",
@ -511,8 +511,8 @@
"schema": "rmf", "schema": "rmf",
"table": "controls", "table": "controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -563,8 +563,8 @@
"schema": "rmf", "schema": "rmf",
"table": "controls", "table": "controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -641,8 +641,8 @@
"schema": "rmf", "schema": "rmf",
"table": "controls", "table": "controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -704,8 +704,8 @@
"schema": "rmf", "schema": "rmf",
"table": "controls", "table": "controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "rmf_eny_baseline_enh_id", "id": "rmf_eny_baseline_enh_id",
@ -713,8 +713,8 @@
"schema": "rmf", "schema": "rmf",
"table": "control_enh", "table": "control_enh",
"field": "enh_id", "field": "enh_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -805,8 +805,8 @@
"schema": "rmf", "schema": "rmf",
"table": "controls", "table": "controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "fk_cci_control_enh1", "id": "fk_cci_control_enh1",
@ -814,8 +814,8 @@
"schema": "rmf", "schema": "rmf",
"table": "control_enh", "table": "control_enh",
"field": "enh_id", "field": "enh_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -1363,8 +1363,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "fp_src_id", "id": "fp_src_id",
@ -1372,8 +1372,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "sources", "table": "sources",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -1423,8 +1423,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "exp_sys_id", "id": "exp_sys_id",
@ -1432,8 +1432,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "system", "table": "system",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -1776,8 +1776,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "proc_ia_controls", "table": "proc_ia_controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -1858,8 +1858,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "proc_ia_controls", "table": "proc_ia_controls",
"field": "control_id", "field": "control_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -2013,8 +2013,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "checklist", "table": "checklist",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "chk_sw_lu_sw_id", "id": "chk_sw_lu_sw_id",
@ -2022,8 +2022,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "software", "table": "software",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2125,8 +2125,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "checklist", "table": "checklist",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "pdi_pdi_id", "id": "pdi_pdi_id",
@ -2134,8 +2134,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2237,8 +2237,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2285,8 +2285,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2432,8 +2432,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "cci", "table": "cci",
"field": "cci_id", "field": "cci_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2600,8 +2600,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "cve_db", "table": "cve_db",
"field": "cve_id", "field": "cve_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2648,8 +2648,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "cve_cve_id", "id": "cve_cve_id",
@ -2657,8 +2657,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "cve_db", "table": "cve_db",
"field": "cve_id", "field": "cve_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -2697,8 +2697,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "cve_db", "table": "cve_db",
"field": "cve_id", "field": "cve_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -2748,8 +2748,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -2807,8 +2807,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3014,8 +3014,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3071,8 +3071,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "iavm_notices", "table": "iavm_notices",
"field": "noticeId", "field": "noticeId",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3138,8 +3138,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "iavm_notices", "table": "iavm_notices",
"field": "noticeId", "field": "noticeId",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3215,8 +3215,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "iavm_notices", "table": "iavm_notices",
"field": "noticeId", "field": "noticeId",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3282,8 +3282,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "iavm_notices", "table": "iavm_notices",
"field": "noticeId", "field": "noticeId",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3339,8 +3339,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "iavm_notices", "table": "iavm_notices",
"field": "noticeId", "field": "noticeId",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3387,8 +3387,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "cve_db", "table": "cve_db",
"field": "cve_id", "field": "cve_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "iavm_lookup_id", "id": "iavm_lookup_id",
@ -3396,8 +3396,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "iavm_notices", "table": "iavm_notices",
"field": "noticeId", "field": "noticeId",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3542,8 +3542,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "nessus_plugins", "table": "nessus_plugins",
"field": "plugin_id", "field": "plugin_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3590,8 +3590,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "nessus_n_id", "id": "nessus_n_id",
@ -3599,8 +3599,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "nessus_plugins", "table": "nessus_plugins",
"field": "plugin_id", "field": "plugin_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3663,8 +3663,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3761,8 +3761,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3879,8 +3879,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -3927,8 +3927,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -4169,8 +4169,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "system", "table": "system",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "ste_site_id", "id": "ste_site_id",
@ -4178,8 +4178,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "sites", "table": "sites",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -4241,8 +4241,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "people", "table": "people",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "ste_team_ste_id", "id": "ste_team_ste_id",
@ -4250,8 +4250,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste", "table": "ste",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -4310,8 +4310,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste", "table": "ste",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -4358,8 +4358,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste_cat", "table": "ste_cat",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "ste_cat_src_id", "id": "ste_cat_src_id",
@ -4367,8 +4367,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "sources", "table": "sources",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -4467,8 +4467,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste_cat", "table": "ste_cat",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "cat_int_ques_id", "id": "cat_int_ques_id",
@ -4476,8 +4476,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "interview_questions", "table": "interview_questions",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -4669,8 +4669,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "sources", "table": "sources",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "scan_ste_id", "id": "scan_ste_id",
@ -4678,8 +4678,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste", "table": "ste",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -4968,8 +4968,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste_cat", "table": "ste_cat",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "t_os_id", "id": "t_os_id",
@ -4977,8 +4977,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "software", "table": "software",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "t_ste_id", "id": "t_ste_id",
@ -4986,8 +4986,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ste", "table": "ste",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "t_auto_id", "id": "t_auto_id",
@ -4995,8 +4995,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "task_status", "table": "task_status",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "t_man_id", "id": "t_man_id",
@ -5004,8 +5004,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "task_status", "table": "task_status",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "t_data_id", "id": "t_data_id",
@ -5013,8 +5013,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "task_status", "table": "task_status",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "t_fp_cat1_id", "id": "t_fp_cat1_id",
@ -5022,8 +5022,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "task_status", "table": "task_status",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
], ],
"index": [ "index": [
@ -5148,8 +5148,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5248,8 +5248,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5388,8 +5388,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5508,8 +5508,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5565,8 +5565,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "checklist", "table": "checklist",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "tgt_tgt_chk_id", "id": "tgt_tgt_chk_id",
@ -5574,8 +5574,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5625,8 +5625,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "software", "table": "software",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "tgt_tgt_sft_id", "id": "tgt_tgt_sft_id",
@ -5634,8 +5634,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5705,8 +5705,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "scans", "table": "scans",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "host_tgt_id", "id": "host_tgt_id",
@ -5714,8 +5714,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5795,8 +5795,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "interfaces", "table": "interfaces",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "pps_pps_id", "id": "pps_pps_id",
@ -5804,8 +5804,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "ports_proto_services", "table": "ports_proto_services",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5914,8 +5914,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "pdi_catalog", "table": "pdi_catalog",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "find_tgt_id", "id": "find_tgt_id",
@ -5923,8 +5923,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "target", "table": "target",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "find_scan_id", "id": "find_scan_id",
@ -5932,8 +5932,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "scans", "table": "scans",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "find_status_id", "id": "find_status_id",
@ -5941,8 +5941,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings_status", "table": "findings_status",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -5993,8 +5993,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings", "table": "findings",
"field": "tgt_id", "field": "tgt_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "find_pdi_ctrl_id", "id": "find_pdi_ctrl_id",
@ -6002,8 +6002,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings", "table": "findings",
"field": "pdi_id", "field": "pdi_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -6063,8 +6063,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings", "table": "findings",
"field": "tgt_id", "field": "tgt_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "scan_find_pdi_notes_id", "id": "scan_find_pdi_notes_id",
@ -6072,8 +6072,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings", "table": "findings",
"field": "pdi_id", "field": "pdi_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "scan_find_scan_notes_id", "id": "scan_find_scan_notes_id",
@ -6081,8 +6081,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "scans", "table": "scans",
"field": "id", "field": "id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },
@ -6132,8 +6132,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings", "table": "findings",
"field": "tgt_id", "field": "tgt_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
}, },
{ {
"id": "analyst_find_pdi_notes_id", "id": "analyst_find_pdi_notes_id",
@ -6141,8 +6141,8 @@
"schema": "sagacity", "schema": "sagacity",
"table": "findings", "table": "findings",
"field": "pdi_id", "field": "pdi_id",
"update": null, "update": "CASCADE",
"delete": null "delete": "CASCADE"
} }
] ]
}, },

View File

@ -358,6 +358,7 @@ Total STIGs: $total_stigs
EOO; EOO;
/** /**
* Function to retrieve all the PDIs for a specified target and checklist
* *
* @global db $db * @global db $db
* *

View File

@ -118,10 +118,16 @@ class scc_parser extends scan_xml_parser
$this->groups = []; $this->groups = [];
$this->tag = []; $this->tag = [];
parent::__construct($this, $ste_id_in, $fname_in); parent::__construct($this, $ste_id_in, $fname_in);
$this->db->update_Running_Scan($this->scan->get_File_Name(), [ }
'name' => 'pid',
'value' => getmypid() /**
]); * Function to parse \cdf:Benchmark
*
* @param array $attrs
*/
public function cdf_Benchmark($attrs)
{
$this->scan->set_Start_Time(new DateTime("now", new DateTimeZone("UTC")));
} }
/** /**

View File

@ -967,7 +967,11 @@ class db_helper
if (isset($json->constraints) && is_array($json->constraints) && count($json->constraints)) { if (isset($json->constraints) && is_array($json->constraints) && count($json->constraints)) {
foreach ($json->constraints as $con) { foreach ($json->constraints as $con) {
$this->sql .= ", CONSTRAINT `{$con->id}` " . "FOREIGN KEY (`{$con->local}`) " . "REFERENCES `{$con->schema}`.`{$con->table}` (`{$con->field}`) " . "ON DELETE " . (is_null($con->delete) ? "NO ACTION" : strtoupper($con->delete)) . " " . "ON UPDATE " . (is_null($con->update) ? "NO ACTION" : strtoupper($con->update)); $this->sql .= ", CONSTRAINT `{$con->id}` " .
"FOREIGN KEY (`{$con->local}`) " .
"REFERENCES `{$con->schema}`.`{$con->table}` (`{$con->field}`) " .
"ON DELETE " . (!isset($con->delete) || is_null($con->delete) ? "NO ACTION" : strtoupper($con->delete)) . " " .
"ON UPDATE " . (!isset($con->update) || is_null($con->update) ? "NO ACTION" : strtoupper($con->update));
} }
} }
@ -8721,8 +8725,11 @@ EOQ;
foreach ($src_arr as $row) { foreach ($src_arr as $row) {
$src = new source($row['id'], $row['name']); $src = new source($row['id'], $row['name']);
$icon = null; $icon = null;
if ($row['icon']) { $missing_fname = str_replace(" ", "-", substr($row['icon'], 0, - 4)) . "-missing.png";
$icon = str_replace(" ", "-", substr($row['icon'], 0, - 4)) . "-missing.png"; if ($row['icon'] && file_exists(DOC_ROOT . "/img/scan_types/{$missing_fname}")) {
$icon = $missing_fname;
} else {
$icon = $row['icon'];
} }
$src->set_Icon($icon); $src->set_Icon($icon);
$ret[$src->get_ID()]['src'] = $src; $ret[$src->get_ID()]['src'] = $src;
@ -8742,7 +8749,7 @@ EOQ;
*/ */
public function get_Target_Scan_Sources($tgt, &$exp_scan_srcs = null) public function get_Target_Scan_Sources($tgt, &$exp_scan_srcs = null)
{ {
$ret = []; $ret = (!is_null($exp_scan_srcs) ? $exp_scan_srcs : []);
$this->help->select("sources src", [ $this->help->select("sources src", [
"src.id", "src.id",
"src.name", "src.name",
@ -8762,7 +8769,6 @@ EOQ;
"LEFT JOIN host_list hl ON hl.scan_id=s.id" "LEFT JOIN host_list hl ON hl.scan_id=s.id"
] ]
]); ]);
$rows = $this->help->execute(); $rows = $this->help->execute();
if (is_array($rows) && count($rows) && isset($rows['id'])) { if (is_array($rows) && count($rows) && isset($rows['id'])) {
@ -8772,39 +8778,15 @@ EOQ;
} }
if (is_array($rows) && count($rows) && isset($rows[0])) { if (is_array($rows) && count($rows) && isset($rows[0])) {
if (is_null($exp_scan_srcs)) { foreach($rows as $row) {
foreach ($rows as $row) {
$src = new source($row['id'], $row['name']); $src = new source($row['id'], $row['name']);
$src->set_Icon($row['icon']); $src->set_Icon($row['icon']);
$ret[$row['id']] = [
'src' => $src,
'scan_error' => (boolean) $row['scanner_error'],
'notes' => $row['notes'],
'file_name' => (!isset($ret[$row['id']]['file_name']) ? "{$row['file_name']} ({$row['finding_count']})" : "{$ret[$row['id']]['file_name']}\n{$row['file_name']} ({$row['finding_count']})")
];
}
} else {
foreach ($rows as $row) {
if (isset($exp_scan_srcs[$row['id']]) && isset($exp_scan_srcs[$row['id']]['src']) && is_a($exp_scan_srcs[$row['id']]['src'], 'source')) {
$exp_scan_srcs[$row['id']]['src']->set_Icon($row['icon']);
$exp_scan_srcs[$row['id']] = [
'scan_error' => (boolean) $row['scanner_error'],
'notes' => $row['notes'],
'file_name' => (!isset($exp_scan_srcs[$row['id']]['file_name']) ? "{$row['file_name']} ({$row['finding_count']})" : "{$exp_scan_srcs[$row['id']]['file_name']}\n{$row['file_name']} ({$row['finding_count']})")
];
} else {
$src = new source($row['id'], $row['name']);
$src->set_Icon($row['icon']);
$exp_scan_srcs[$row['id']] = [
'src' => $src,
'scan_error' => (boolean) $row['scanner_error'],
'notes' => $row['notes'],
'file_name' => "{$row['file_name']} ({$row['finding_count']})"
];
}
}
return $exp_scan_srcs; $ret[$src->get_ID()]['src'] = $src;
$ret[$src->get_ID()]['count'] = $row['finding_count'];
$ret[$src->get_ID()]['notes'] = $row['notes'];
$ret[$src->get_ID()]['scan_error'] = $row['scanner_error'];
$ret[$src->get_ID()]['file_name'] = $row['file_name'];
} }
} }
@ -11145,7 +11127,7 @@ EOQ;
'value' => $intCat 'value' => $intCat
] ]
], [ ], [
'order' => 'name' 'order' => 'LENGTH(name),name'
]); ]);
$rows = $this->help->execute(); $rows = $this->help->execute();
@ -11188,7 +11170,7 @@ EOQ;
'sql_op' => 'AND' 'sql_op' => 'AND'
] ]
], [ ], [
'order' => 'name' 'order' => 'LENGTH(name),name'
]); ]);
$ret = []; $ret = [];
@ -12624,6 +12606,18 @@ EOQ;
return false; return false;
} }
$this->help->delete("analyst_notes", null, [
[
'field' => 'tgt_id',
'op' => '=',
'value' => $tgt_id
]
]);
if (! $this->help->execute()) {
$this->help->debug(E_ERROR);
return false;
}
$this->help->delete("target", null, [ $this->help->delete("target", null, [
[ [
'field' => 'id', 'field' => 'id',

View File

@ -26,7 +26,7 @@
?> ?>
<div id='copyright-text'> <div id='copyright-text'>
<p>Portions Copyright &copy; 2016-2018 Cyber Perspective, LLC All rights reserved.</p> <p>Portions Copyright &copy; 2016-2018 Cyber Perspectives, LLC All rights reserved.</p>
<p>Portions Copyright &copy; 2012-2015 Salient Federal Solutions</p> <p>Portions Copyright &copy; 2012-2015 Salient Federal Solutions</p>
<p>Portions Copyright &copy; 2008-2011 Science Applications International Corp.</p> <p>Portions Copyright &copy; 2008-2011 Science Applications International Corp.</p>
</div> </div>

View File

@ -384,7 +384,7 @@ function display_ops_hosts(hosts) {
var odd = true; var odd = true;
for (var x in hosts.targets) { for (var x in hosts.targets) {
$(cat).after( $(cat).append(
"<div class='" + (odd ? "odd_row" : "even_row") + " cat_" + cat_id + "'>" + "<div class='" + (odd ? "odd_row" : "even_row") + " cat_" + cat_id + "'>" +
"<span class='cat-cell' style='width:102px;text-align:left'>" + "<span class='cat-cell' style='width:102px;text-align:left'>" +
"<input type='checkbox' class='tgt-sel' value='" + hosts.targets[x].id + "' onclick='javascript:update_tgt_chk(this);' />" + "<input type='checkbox' class='tgt-sel' value='" + hosts.targets[x].id + "' onclick='javascript:update_tgt_chk(this);' />" +

18
ste/ste_script.min.js vendored

File diff suppressed because one or more lines are too long