oci_audit_event_facts – Fetches details about one or multiple AuditEvent resources in Oracle Cloud Infrastructure

New in version 2.5.

Synopsis

  • Fetches details about one or multiple AuditEvent resources in Oracle Cloud Infrastructure
  • Returns all audit events for the specified compartment that were processed within the specified time range.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_OCID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
compartment_id
- / required
The OCID of the compartment.
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
end_time
- / required
Returns events that were processed before this end date and time, expressed in RFC 3339 timestamp format. For example, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-01-02T00:00:00Z` will retrieve a list of all events processed on January 1, 2017. Similarly, a start value of `2017-01-01T00:00:00Z` and an end value of `2017-02-01T00:00:00Z` will result in a list of all events processed between January 1, 2017 and January 31, 2017. You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
start_time
- / required
Returns events that were processed at or after this start date and time, expressed in RFC 3339 timestamp format. For example, a start value of `2017-01-15T11:30:00Z` will retrieve a list of all events processed since 30 minutes after the 11th hour of January 15, 2017, in Coordinated Universal Time (UTC). You can specify a value with granularity to the minute. Seconds (and milliseconds, if included) must be set to `0`.
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm

Examples

- name: List audit_events
  oci_audit_event_facts:
      compartment_id: ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
      start_time: 2013-10-20T19:20:30+01:00
      end_time: 2013-10-20T19:20:30+01:00

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
audit_events
complex
on success
List of AuditEvent resources

Sample:
[{'event_type': 'event_type_example', 'response_headers': {}, 'event_name': 'LaunchInstance', 'compartment_name': 'compartment_name_example', 'request_id': 'ocid1.request.oc1..xxxxxxEXAMPLExxxxxx', 'credential_id': 'ocid1.credential.oc1..xxxxxxEXAMPLExxxxxx', 'principal_id': 'ocid1.principal.oc1..xxxxxxEXAMPLExxxxxx', 'request_resource': 'request_resource_example', 'request_parameters': {}, 'response_time': '2013-10-20T19:20:30+01:00', 'event_source': 'event_source_example', 'request_action': 'request_action_example', 'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'event_id': 'ocid1.event.oc1..xxxxxxEXAMPLExxxxxx', 'response_status': 'response_status_example', 'response_payload': {}, 'event_time': '2013-10-20T19:20:30+01:00', 'request_headers': {}, 'request_agent': 'request_agent_example', 'tenant_id': 'ocid1.tenant.oc1..xxxxxxEXAMPLExxxxxx', 'user_name': 'user_name_example', 'request_origin': 'request_origin_example'}]
  compartment_id
string
on success
The OCID of the compartment.

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
  compartment_name
string
on success
The name of the compartment. This value is the friendly name associated with compartmentId. This value can change, but the service logs the value that appeared at the time of the audit event.

Sample:
compartment_name_example
  credential_id
string
on success
The credential ID of the user. This value is extracted from the HTTP 'Authorization' request header. It consists of the tenantId, userId, and user fingerprint, all delimited by a slash (/).

Sample:
ocid1.credential.oc1..xxxxxxEXAMPLExxxxxx
  event_id
string
on success
The GUID of the event.

Sample:
ocid1.event.oc1..xxxxxxEXAMPLExxxxxx
  event_name
string
on success
The name of the event. Example: `LaunchInstance`

Sample:
LaunchInstance
  event_source
string
on success
The source of the event.

Sample:
event_source_example
  event_time
string
on success
The time the event occurred, expressed in RFC 3339 timestamp format.

Sample:
2013-10-20 18:20:30
  event_type
string
on success
The type of the event.

Sample:
event_type_example
  principal_id
string
on success
The OCID of the user whose action triggered the event.

Sample:
ocid1.principal.oc1..xxxxxxEXAMPLExxxxxx
  request_action
string
on success
The HTTP method of the request.

Sample:
request_action_example
  request_agent
string
on success
The user agent of the client that made the request.

Sample:
request_agent_example
  request_headers
dictionary
on success
The HTTP header fields and values in the request.

  request_id
string
on success
The opc-request-id of the request.

Sample:
ocid1.request.oc1..xxxxxxEXAMPLExxxxxx
  request_origin
string
on success
The IP address of the source of the request.

Sample:
request_origin_example
  request_parameters
dictionary
on success
The query parameter fields and values for the request.

  request_resource
string
on success
The resource targeted by the request.

Sample:
request_resource_example
  response_headers
dictionary
on success
The headers of the response.

  response_payload
dictionary
on success
Metadata of interest from the response payload. For example, the OCID of a resource.

  response_status
string
on success
The status code of the response.

Sample:
response_status_example
  response_time
string
on success
The time of the response to the audited request, expressed in RFC 3339 timestamp format.

Sample:
2013-10-20 18:20:30
  tenant_id
string
on success
The OCID of the tenant.

Sample:
ocid1.tenant.oc1..xxxxxxEXAMPLExxxxxx
  user_name
string
on success
The name of the user or service. This value is the friendly name associated with principalId.

Sample:
user_name_example


Status

  • This module is not guaranteed to have a backwards compatible interface. [preview]
  • This module is maintained by the Ansible Community. [community]

Authors

  • Manoj Meda (@manojmeda)
  • Mike Ross (@mross22)
  • Nabeel Al-Saber (@nalsaber)

Hint

If you notice any issues in this documentation you can edit this document to improve it.