Create Compliance Scan Schedule

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

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

Input ParametersInput Parameters

Parameter

Required/Optional

Data Type

Description

action=create

Required

String 

Specify action to create compliance scan schedule.

echo_request={0|1}

Optional

Integer 

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

Scan

 Required

String
Integer 

scan_title,
active=0|1 

Compliance Profile

Required 

Integer 

option_id or option_profile 

Scanner Appliance

Optional 

String
Integer 

iscanner_id or iscanner_name

Asset IPs/Groups

Optional 

Integer 

ip, asset_group_ids, asset_groups, exclude_ip_per_scan, default_scanner, scanners_in_ag

Asset Tags

Optional 

 Integer

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

Network

Optional 

Integer 

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

Scheduling

Optional 

Integer 

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

Required 

Integer 

occurrence=daily, frequency_days 

Weekly Scan

Required 

Integer

occurrence=weekly, frequency_weeks, weeks

Monthly Scan

Required 

Integer 

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

Notifications

Optional 

Integer 

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

{scan parameters}

Optional 

Integer 

Click here to view scan parameters

{scan schedule parameters}

Optional 

Integer 

Click here to view scan schedule parameters

Sample - Create a Compliance Scan ScheduleSample - Create a Compliance Scan Schedule

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl""https://<qualys_base_url>/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://<qualys_base_url>/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 MinutesSample - Create Compliance Scan Schedule and Cancel After 45 Minutes

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl""https://<qualys_base_url>/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://<qualys_base_url>/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 NetworkSample - Create Compliance Scan Schedule Using All Scanners in Network

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl""https://<qualys_base_url>/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://<qualys_base_url>/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 ScheduleSample - Create EC2 Compliance Scan Schedule

API Request

curl -u "USERNAME:PASSWORD" -H "X-Requested-With: Curl" "https://<qualys_base_url>/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://<qualys_base_url>/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>