예제 #1
0
                    // Write the scan details into vulnDB
                    $insert_details = $insert_model->scan_details($scan_to_get, array('ACCOUNT' => $account_name, "DATE_ENTERED" => $now));
                } else {
                    Logger::msg('info', array('account' => $account_name, 'message' => 'unable to insert scan into vulnDB', 'scan_id' => $scanid, 'scan_title' => $scantitle, 'scan_status', $scanstatus));
                }
            } elseif ($scanstatus = 'RUNNING') {
                // We can't pull in running scans, nor do we want to put that entry into the db
                continue;
            } else {
                Logger::msg('info', array('account' => $account_name, 'message' => 'scan status did not match $scantypestoget and will not be pulled in', 'scan_id' => $scanid, 'scan_title' => $scantitle, 'scan_status' => $scanstatus));
                $insert_details = $insert_model->scan_details($scan_to_get, array("ACCOUNT" => $account_name, "DATE_ENTERED" => $now));
            }
        }
    } else {
        Logger::msg('info', array('account' => $account_name, 'message' => "no scans found for this account.  moving onto the next one"));
    }
    // Delete AGs for account so we always have a fresh copy
    // If you want to keep a trail for the AG's, just comment this out
    $deleted_ags = DB::query(Database::DELETE, "DELETE FROM " . MAIN_AG_TABLE . " WHERE ACCOUNT=:account")->bind(':account', $account_name)->execute();
    // Pull in the asset groups for the account
    Logger::msg('info', array('message' => 'downloading asset groups', 'api_call' => 'get_asset_groups', 'api_version' => 1));
    $ags = $api1->get_asset_groups($url1, $username, $password);
    // Put AG's into vulnDB
    $insert = $insert_model->ags($ags, $account_name);
    Logger::msg('info', array('message' => 'asset groups successfully entered into vulndb', 'account' => $account_name));
    // release the api classes
    unset($api1);
    unset($api2);
}
// end foreaach($accounts...)
Logger::msg('info', array('message' => 'Ending vulnDB updater'));