Create a compliance scan schedule

/api/2.0/fo/schedule/scan/compliance/?action=create

[POST]

Create a new compliance scan schedule in the user's account.

Input Parameters

Parameter

Description

action=create

(Required)

echo_request={0|1}

(Optional) Specify 1 to view (echo) input parameters in the XML output. By default these are not included.

Scan

scan_title (required), active=0|1 (required)

Compliance Profile

option_id or option_profile (one is required)

Scanner Appliance

iscanner_id or iscanner_name

Asset IPs/Groups

ip, asset_group_ids, asset_groups, exclude_ip_per_scan, default_scanner, scanners_in_ag

Asset Tags

target_from=tags, tag_include_selector, tag_exclude_selector, tag_set_by, tag_set_exclude, tag_set_include, use_ip_nt_range_tags

Network

ip_network_id to filter IPs/ranges in “ip” parameter (valid when the networks feature is enabled)

Scheduling

start_date (current date by default) start_hour, start_minute, time_zone_code, occurrence (required) observe_dst, recurrence, end_after, pause_after_hours, resume_in_days

Daily Scan

occurrence=daily, frequency_days (required)

Weekly Scan

occurrence=weekly, frequency_weeks, weeks (required)

Monthly Scan

occurrence=monthly, frequency_months (required) Nth day of month: day_of_month (required) Day in Nth week: day_of_week, week_of_month (required)

Notifications

before_notify, before_notify_unit, before_notify_time, before_notify_message, after_notify, after_notify_message, recipient_group_ids

{scan parameters}

Click here to view scan parameters

{scan schedule parameters}

Click here to view scan schedule parameters

 

Sample - Create a compliance scan schedule

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl"

"https://qualysapi.qualys.com/api/2.0/fo/schedule/scan/compliance?action=create&scan_title=My+Scan+Schedule+api6&active=1&option_id=76960&asset_groups=policyred7&iscanner_name=pyscandsp&occurrence=daily&frequency_days=5&time_zone_code=US-CA&observe_dst=yes&start_hour=14&start_minute=0"

XML output

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

    <RESPONSE>

        <DATETIME>2019-11-19T11:14:19Z</DATETIME>

        <TEXT>New compliance scan scheduled successfully</TEXT>

        <ITEM_LIST>

            <ITEM>

                <KEY>ID</KEY>

                <VALUE>57368</VALUE>

            </ITEM>

        </ITEM_LIST>

    </RESPONSE>

</SIMPLE_RETURN>

Sample - Create compliance scan schedule and cancel after 45 minutes

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl"

"https://qualysapi.qualys.com/api/2.0/fo/schedule/scan/compliance?action=create&scan_title=My_Weekly_Scan&option_title=nordea windows&ip=10.10.10.10&active=1&occurrence=weekly&start_hour=13&start_minute=30&time_zone_code=IN&frequency_weeks=1&weekdays=Sunday&end_after=0&end_after_mins=45&iscanner_name=pyscandsp&before_notify=1&before_notify_unit=hours&before_notify_time=20"windows&ip=10.10.10.10&active=1&occurrence=weekly&start_hour=13&start_minute=30&time_zone_code=IN&frequency_weeks=1&weekdays=Sunday&end_after=0&end_after_mins=45&iscanner_name=pyscandsp&before_notify=1&before_notify_unit=hours&before_notify_time=20"

XML output

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

    <RESPONSE>

        <DATETIME>2019-11-21T08:06:49Z</DATETIME>

        <TEXT>New compliance scan scheduled successfully</TEXT>

        <ITEM_LIST>

            <ITEM>

                <KEY>ID</KEY>

                <VALUE>57369</VALUE>

            </ITEM>

        </ITEM_LIST>

    </RESPONSE>

</SIMPLE_RETURN>

Sample - Create compliance scan schedule using all scanners in network

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl"

"https://qualysapi.qualys.com/api/2.0/fo/schedule/scan/compliance?action=create&scan_title=API+Schedule+scan&option_title=nordea windows&ip_network_id=52010&scanners_in_network=1&ip=10.10.10.10

,10.10.10.11&occurrence=monthly&frequency_months=12&day_of_month=20&start_minute=00&start_hour=22&time_zone_code=IN&observe_dst=no&pause_after_hours=3&resume_in_days=4&recurrence=5&start_date=08/20/

2020&active=1"

XML output

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

    <RESPONSE>

        <DATETIME>2019-11-21T08:26:00Z</DATETIME>

        <TEXT>New compliance scan scheduled successfully</TEXT>

        <ITEM_LIST>

            <ITEM>

                <KEY>ID</KEY>

                <VALUE>57370</VALUE>

            </ITEM>

        </ITEM_LIST>

    </RESPONSE>

</SIMPLE_RETURN>

 

Sample - Create EC2 compliance scan schedule

API request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" "https://qualysapi.qualys.com/api/2.0/fo/schedule/scan/compliance? action=create&scan_title=API_Schedule_EC2_PC&target_from=tags&tag_set_by=name&tag_include_selector=any&tag_set_include=Auth&connector_name=AWS+Connector&ec2_endpoint=us-east-1&active=0&occurrence=daily&start_date=05/21/2020&start_hour=20&start_minute=30&time_zone_code=IN&option_title=Initial+PC+Options&frequency_days=364&end_after=1&observe_dst=no&iscanner_name=EC2_Scanner"

XML output

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE SIMPLE_RETURN SYSTEM "https://qualysapi.qualys.com/api/2.0/simple_return.dtd">

<SIMPLE_RETURN>

  <RESPONSE>

    <DATETIME>2020-06-07T22:09:26Z</DATETIME>

    <TEXT>New compliance scan scheduled successfully</TEXT>

    <ITEM_LIST>

      <ITEM>

        <KEY>ID</KEY>

        <VALUE>279256</VALUE>

      </ITEM>

    </ITEM_LIST>

  </RESPONSE>

</SIMPLE_RETURN>