{"id":19368464,"url":"https://github.com/anchore/anchore-grafeas-cli","last_synced_at":"2025-04-23T15:30:44.100Z","repository":{"id":50211431,"uuid":"110029540","full_name":"anchore/anchore-grafeas-cli","owner":"anchore","description":"Tool for connecting to an anchore-engine DB and generating grafeas note/occurrence JSON documents","archived":true,"fork":false,"pushed_at":"2021-06-01T21:55:49.000Z","size":142,"stargazers_count":9,"open_issues_count":2,"forks_count":1,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-13T08:14:21.802Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anchore.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-08T20:56:08.000Z","updated_at":"2024-09-17T16:12:46.000Z","dependencies_parsed_at":"2022-09-24T08:23:22.935Z","dependency_job_id":null,"html_url":"https://github.com/anchore/anchore-grafeas-cli","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fanchore-grafeas-cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fanchore-grafeas-cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fanchore-grafeas-cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anchore%2Fanchore-grafeas-cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anchore","download_url":"https://codeload.github.com/anchore/anchore-grafeas-cli/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250460242,"owners_count":21434229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T08:06:39.845Z","updated_at":"2025-04-23T15:30:43.756Z","avatar_url":"https://github.com/anchore.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Installing Anchore CLI from source\n==================================\n\nThe Anchore grafeas CLI can be installed from source using the Python\npip utility. The utility connects to an existing anchore-engine DB and\nconstructs grafeas note and occurrence documents.  Below is an example\ninstallation if, say, one were running a fresh container based on\ncentos:latest\n\n.. code::\n\n    yum -y install epel-release \u0026\u0026 yum -y install python-pip git \u0026\u0026 pip install --upgrade pip \u0026\u0026 pip install --upgrade setuptools\n\n    git clone https://github.com/anchore/anchore-grafeas-cli\n    cd anchore-grafeas-cli\n    pip install --upgrade . \n    cd ..\n\nUsing Anchore Grafeas CLI\n==================================\n\nThe pre-requisites for using this tool are that there is an existing\nanchore-engine service up and running, along with the anchore-engine\ndatabase port exposed and accessible from the place where this tool is\nbeing executed.  Note that if you are running anchore-engine using the\nsupplied docker-compose.yaml, you will have to add a section to the\nanchore-db service (and restart the services) to expose the DB port\n5432 in order for it to be accessed externally.  If you do not have\nanchore-engine service running already, please visit the\n`anchore-engine github page \u003chttps://github.com/anchore/anchore-engine\u003e`_ for instructions on\nhow to install anchore-engine.\n\nOnce anchore-engine is up and running (we also recommend adding some\nimages to anchore-engine, in order to get package notes and\npackage-vulnerability occurrences), the general flow is to set the\nANCHORE_DB_CONNECT environment to the connect string for the\nanchore-engine DB, and then use the tool to list and then generate\nvulnerability/package note JSON documents.  To generate grafeas\npackage-vulnerability occurrences, set GRAFEAS_HOSTPORT environment to\nan accessible grafeas service, and then use the tool to list and then\ngenerate package-vulnerability occurrence JSON documents.\n\n.. code::\n\n    export ANCHORE_DB_CONNECT=\"postgresql+pg8000://postgres:\u003cyour-anchore-db-password\u003e@\u003cyour-anchore-db-host\u003e:5432/postgres\"\n    anchore-grafeas note vulnerabilities\n    anchore-grafeas note vulnerabilities \u003cvulnerabilityId from previous\u003e\n    anchore-grafeas note packages\n    anchore-grafeas note packages \u003cpackageName from previous\u003e\n\n    export GRAFEAS_HOSTPORT=\"\u003cyour-grafeas-host\u003e:8080\"\n    anchore-grafeas occurrence package-vulnerabilities\n    anchore-grafeas occurrence package-vulnerabilities \u003cfull line (imageId packageName vulnId) from previous\u003e\n\nExamples with curl uploads to grafeas service (for the 'nash' package in this example)\n\n.. code::\n\n    anchore-grafeas note packages nash | curl -v -H 'content-type: application-json' -XPOST http://${GRAFEAS_HOSTPORT}/v1alpha1/projects/anchore-distro-packages/notes?noteId=nash -d @-\n    anchore-grafeas note packages nash | curl -v -H 'content-type: application-json' -XPUT http://${GRAFEAS_HOSTPORT}/v1alpha1/projects/anchore-distro-packages/notes/nash -d @-\n    curl -v -XGET http://${GRAFEAS_HOSTPORT}/v1alpha1/projects/anchore-distro-packages/notes/nash    \n    curl -v -XDELETE http://${GRAFEAS_HOSTPORT}/v1alpha1/projects/anchore-distro-packages/notes/nash\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fanchore-grafeas-cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanchore%2Fanchore-grafeas-cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanchore%2Fanchore-grafeas-cli/lists"}