yebinama / paclair

Paclair is a Python3 Cli tool to interact with Coreos's Clair (https://github.com/coreos/clair).
Apache License 2.0
27 stars 13 forks source link

Add availability to work with Microsoft Azure artifactory #29

Closed SofyaTavrovskaya closed 4 years ago

SofyaTavrovskaya commented 4 years ago

To have availability to scan images that store in Microsoft Azure registry I suggest this fix

Have problem with scanning image from Microsoft Azure registry like: mirantis.azurecr.io/general/mariadb:10.4.14-bionic-20200812025059

File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/bin/paclair", line 8, in <module>
    sys.exit(main())
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/__main__.py", line 71, in main
    paclair_object.push(args.plugin, host)
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/handler.py", line 76, in push
    self._plugins[plugin].push(name)
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/plugins/abstract_plugin.py", line 53, in push
    return self.clair.post_ancestry(self.create_ancestry(name))
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/plugins/docker_plugin.py", line 68, in create_ancestry
    return DockerAncestry(self.create_docker_image(name))
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/ancestries/docker.py", line 19, in __init__
    headers = {'Authorization': "{}".format(docker_image.authorization)}
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/docker/docker_image.py", line 43, in authorization
    return self.registry.get_authorization(self)
  File "/home/sofya/docker-image-scanner/imagescanner/virtenv_paclair/lib/python3.6/site-packages/paclair/docker/docker_registry.py", line 125, in get_authorization
    token = resp.json()['token']
KeyError: 'token'
yebinama commented 4 years ago

Hi, Thanks for your PR, LGTM. I'll release a new version quickly with your fix.

SofyaTavrovskaya commented 3 years ago

Any updates about package with feature?

yebinama commented 3 years ago

Just released a new version. Sorry it took so long, I've changed job recently and didn't have much time :)