コード例 #1
0
def registering_scan_at_internet_nl(scan_id: int):
    update_state("registering scan at internet.nl", scan_id)

    scan = AccountInternetNLScan.objects.all().filter(id=scan_id).first()
    if not scan or not scan.scan:
        log.warning(
            f'Trying to registering_scan_at_internet_nl with unknown scan: {scan_id}.'
        )
        return group([])

    # mail = websecmap, mail_dashboard = internet.nl dashboard, web is the same on both. Mail here is a fallback
    # because the dashboard only understands dns_soa endpoints.
    relevant_endpoint_types = {
        "web": "dns_a_aaaa",
        "mail_dashboard": "dns_soa",
        "mail": "dns_soa"
    }

    # auto saved.
    scan.scan.subject_urls.set(
        get_relevant_urls(scan.urllist.id,
                          relevant_endpoint_types[scan.scan.type]))

    internet_nl_v2_websecmap.update_state(
        scan.scan.id, "requested",
        "requested a scan to be performed on internet.nl api")

    return chain(
        internet_nl_v2_websecmap.progress_running_scan(scan.scan.id)
        | copy_state_from_websecmap_scan.si(scan.id))
コード例 #2
0
def continue_running_scan(scan_id: int):
    # Used to progress in error situations.
    scan = AccountInternetNLScan.objects.all().filter(id=scan_id).first()
    if not scan or not scan.scan:
        log.warning(
            f'Trying to continue_running_scan with unknown scan: {scan_id}.')
        return group([])

    return chain(
        internet_nl_v2_websecmap.progress_running_scan(scan.scan.id)
        | copy_state_from_websecmap_scan.si(scan.id))
コード例 #3
0
def running_scan(scan_id: int):
    update_state("running scan", scan_id)

    scan = AccountInternetNLScan.objects.all().filter(id=scan_id).first()
    if not scan or not scan.scan:
        log.warning(f'Trying to running_scan with unknown scan: {scan_id}.')
        return group([])

    return chain(
        internet_nl_v2_websecmap.progress_running_scan(scan.scan.id)
        | copy_state_from_websecmap_scan.si(scan.id))
コード例 #4
0
def registering_scan_at_internet_nl(scan: AccountInternetNLScan):
    update_state("registering scan at internet.nl", scan)

    # mail = websecmap, mail_dashboard = internet.nl dashboard, web is the same on both. Mail here is a fallback
    # because the dashboard only understands dns_soa endpoints.
    relevant_endpoint_types = {
        "web": "dns_a_aaaa",
        "mail_dashboard": "dns_soa",
        "mail": "dns_soa"
    }

    # auto saved.
    scan.scan.subject_urls.set(
        get_relevant_urls(scan.urllist,
                          relevant_endpoint_types[scan.scan.type]))

    internet_nl_v2_websecmap.update_state(
        scan.scan, "requested",
        "requested a scan to be performed on internet.nl api")

    return chain(
        internet_nl_v2_websecmap.progress_running_scan(scan.scan)
        | copy_state_from_websecmap_scan.si(scan))
コード例 #5
0
def processing_scan_results(scan: AccountInternetNLScan):
    update_state("processing scan results", scan)
    return chain(
        internet_nl_v2_websecmap.progress_running_scan(scan.scan)
        | copy_state_from_websecmap_scan.si(scan))
コード例 #6
0
def continue_running_scan(scan: AccountInternetNLScan):
    # Used to progress in error situations.
    return chain(
        internet_nl_v2_websecmap.progress_running_scan(scan.scan)
        | copy_state_from_websecmap_scan.si(scan))