Lists the Device Defender audits that have been performed during a given time period.
See also: AWS API Documentation
See ‘aws help’ for descriptions of global parameters.
list-audit-tasks
is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate
argument.
When using --output text
and the --query
argument on a paginated response, the --query
argument must extract data from the results of the following query expressions: tasks
list-audit-tasks
--start-time <value>
--end-time <value>
[--task-type <value>]
[--task-status <value>]
[--cli-input-json | --cli-input-yaml]
[--starting-token <value>]
[--page-size <value>]
[--max-items <value>]
[--generate-cli-skeleton <value>]
[--cli-auto-prompt <value>]
--start-time
(timestamp)
The beginning of the time period. Audit information is retained for a limited time (180 days). Requesting a start time prior to what is retained results in an “InvalidRequestException”.
--end-time
(timestamp)
The end of the time period.
--task-type
(string)
A filter to limit the output to the specified type of audit: can be one of “ON_DEMAND_AUDIT_TASK” or “SCHEDULED__AUDIT_TASK”.
Possible values:
ON_DEMAND_AUDIT_TASK
SCHEDULED_AUDIT_TASK
--task-status
(string)
A filter to limit the output to audits with the specified completion status: can be one of “IN_PROGRESS”, “COMPLETED”, “FAILED”, or “CANCELED”.
Possible values:
IN_PROGRESS
COMPLETED
FAILED
CANCELED
--cli-input-json
| --cli-input-yaml
(string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by --generate-cli-skeleton
. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with --cli-input-yaml
.
--starting-token
(string)
A token to specify where to start paginating. This is the
NextToken
from a previously truncated response.For usage examples, see Pagination in the AWS Command Line Interface User Guide .
--page-size
(integer)
The size of each page to get in the AWS service call. This does not affect the number of items returned in the command’s output. Setting a smaller page size results in more calls to the AWS service, retrieving fewer items in each call. This can help prevent the AWS service calls from timing out.
For usage examples, see Pagination in the AWS Command Line Interface User Guide .
--max-items
(integer)
The total number of items to return in the command’s output. If the total number of items available is more than the value specified, a
NextToken
is provided in the command’s output. To resume pagination, provide theNextToken
value in thestarting-token
argument of a subsequent command. Do not use theNextToken
response element directly outside of the AWS CLI.For usage examples, see Pagination in the AWS Command Line Interface User Guide .
--generate-cli-skeleton
(string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value input
, prints a sample input JSON that can be used as an argument for --cli-input-json
. Similarly, if provided yaml-input
it will print a sample input YAML that can be used with --cli-input-yaml
. If provided with the value output
, it validates the command inputs and returns a sample output JSON for that command.
--cli-auto-prompt
(boolean)
Automatically prompt for CLI input parameters.
See ‘aws help’ for descriptions of global parameters.
To list all findings from an audit
The following list-audit-tasks
example lists the audit tasks that ran between June 5, 2019 and June 12, 2019.
aws iot list-audit-tasks \
--start-time 1559747125 \
--end-time 1560357228
Output:
{
"tasks": [
{
"taskId": "a3aea009955e501a31b764abe1bebd3d",
"taskStatus": "COMPLETED",
"taskType": "ON_DEMAND_AUDIT_TASK"
},
{
"taskId": "f76b4b5102b632cd9ae38a279c266da1",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "51d9967d9f9ff4d26529505f6d2c444a",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "eeef61068b0eb03c456d746c5a26ee04",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "041c49557b7c7b04c079a49514b55589",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "82c7f2afac1562d18a4560be73998acc",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "bade6b5efd2e1b1569822f6021b39cf5",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "c23f6233ba2d35879c4bb2810fb5ffd6",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
},
{
"taskId": "ac9086b7222a2f5e2e17bb6fd30b3aeb",
"taskStatus": "COMPLETED",
"taskType": "SCHEDULED_AUDIT_TASK"
}
]
}
For more information, see Audit Commands in the AWS IoT Developer Guide.
tasks -> (list)
The audits that were performed during the specified time period.
(structure)
The audits that were performed.
taskId -> (string)
The ID of this audit.
taskStatus -> (string)
The status of this audit. One of “IN_PROGRESS”, “COMPLETED”, “FAILED”, or “CANCELED”.
taskType -> (string)
The type of this audit. One of “ON_DEMAND_AUDIT_TASK” or “SCHEDULED_AUDIT_TASK”.
nextToken -> (string)
A token that can be used to retrieve the next set of results, or
null
if there are no additional results.