Skip to content

Latest commit

 

History

History
317 lines (283 loc) · 12.3 KB

community.missing_collection.docker_hub_auditlogs_info_module.rst

File metadata and controls

317 lines (283 loc) · 12.3 KB

community.missing_collection.docker_hub_auditlogs_info

The Audit Logs API endpoints allow you to query audit log events across a namespace.

Version added: 0.4.0

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

  • requests
Parameter Choices/Defaults Comments
account
string / required
Namespace to query audit logs for.
action
string
action name one of ["repo.tag.push", ...].
Optional parameter to filter specific audit log actions.
actor
string
Optional parameter to filter audit log events to the specific user who triggered the event.
from_date
string
Start of the time window you wish to query audit events for.
example 2021-09-01T00:00:00Z
list_log_actions
boolean
    Choices:
  • no
  • yes
Get audit log actions for a namespace to be used as a filter for querying audit events.
list_log_events
boolean
    Choices:
  • no
  • yes
Get audit log events for a given namespace.
name
string
Optional parameter to filter audit log events to a specific name.
For repository events, this is the name of the repository.
For organization events, this is the name of the organization.
For team member events, this is the username of the team member.
page
integer
Default:
1
page number of record retrieve call.
page_size
integer
Default:
25
number of records retrieved in one call.
to_date
string
End of the time window you wish to query audit events for.
example 2021-09-01T00:00:00Z
token
string / required
jwt/Bearer token for docker hub api.
url
string
Default:
docker hub api.

- name: get jwt token from docker hub
  community.missing_collection.docker_hub_token:
    username: 'testUser'
    password: 'aDL0xxxxxxxxxxoQt6'
  register: '__'

- name: get all log events which are repo.tag.push
  community.missing_collection.docker_hub_auditlogs_info:
    token: '{{ __.token }}'
    list_log_events: true
    account: 'yourAccount'
    action: 'repo.tag.push'
    from_date: '2021-09-01T00:00:00Z'
    to_date: '2021-10-02T00:00:00Z'

- name: get all log actions
  community.missing_collection.docker_hub_auditlogs_info:
    token: '{{ __.token }}'
    list_log_actions: true
    account: 'yourAccount'

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

Key Returned Description
result
dictionary
when success.
result of docker hub api.

Sample:
{'logs': [{'account': 'docker', 'action': 'repo.tag.push', 'name': 'docker/example', 'actor': 'docker', 'data': {'digest': 'sha256:c1ae9c435032a276f80220c7d9b40f76266bbe79243d34f9cda30b76fe114dfa', 'tag': 'latest'}, 'timestamp': '2021-02-19T01:34:35Z', 'action_description': 'pushed the tag latest with the digest sha256:c1ae9c435032a to the repository docker/example'}]}


Authors