Reputation: 457
I want to find out who / what user pushed an image to the Gitlab Container registry. Optimally by using the gitlab-python package. When using the gitlab-python package I was able to get the object 'ProjectRegistryRepository'. However, this does not show me any attributes that could lead to the person who executed the push.
Example output of the objet 'ProjectRegistryRepository':
{'id': 1589, 'name': 'python-test-image', 'path': 'repo-name/python-test-image', 'project_id': 8433, 'location': 'dockerhublocation', 'created_at': '2022-03-11T09:45:19.071Z', 'cleanup_policy_started_at': None}
Upvotes: 0
Views: 900
Reputation: 41119
This information is not exposed by the API. You cannot determine from the API the user who pushed an image.
However, it is a planned feature to include container registry events in Audit Events and Audit Events API.
If you are using a self-hosted GitLab instance, you may be able to determine who pushes an image by analyzing the access logs for your instance.
Upvotes: 1