{"id":13816076,"url":"https://github.com/optiopay/klar","last_synced_at":"2026-01-18T15:11:17.750Z","repository":{"id":45943470,"uuid":"61352446","full_name":"optiopay/klar","owner":"optiopay","description":"Integration of Clair and Docker Registry","archived":false,"fork":false,"pushed_at":"2023-10-11T07:06:36.000Z","size":1861,"stargazers_count":505,"open_issues_count":52,"forks_count":137,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-15T14:45:59.392Z","etag":null,"topics":["clair","docker-image","docker-registry","security","security-audit","severity-vulnerabilities"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/optiopay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-06-17T06:55:33.000Z","updated_at":"2025-02-12T12:45:57.000Z","dependencies_parsed_at":"2023-01-25T17:15:30.126Z","dependency_job_id":"7a4c84d2-e4d5-474d-ae07-2fa5ad9681c5","html_url":"https://github.com/optiopay/klar","commit_stats":{"total_commits":85,"total_committers":31,"mean_commits":"2.7419354838709675","dds":0.8,"last_synced_commit":"3b2151ae7b7357d7a4744ecce80b4240157ee2db"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"purl":"pkg:github/optiopay/klar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiopay%2Fklar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiopay%2Fklar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiopay%2Fklar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiopay%2Fklar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/optiopay","download_url":"https://codeload.github.com/optiopay/klar/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/optiopay%2Fklar/sbom","scorecard":{"id":711296,"data":{"date":"2025-08-11","repo":{"name":"github.com/optiopay/klar","commit":"4c05f4d8a74169e3a626ddc6f21dfadd4a3cb241"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.2,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":7,"reason":"Found 13/17 approved changesets -- score normalized to 7","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v2.4.0 not signed: https://api.github.com/repos/optiopay/klar/releases/14314331","Warn: release artifact v2.3.0 not signed: https://api.github.com/repos/optiopay/klar/releases/12050636","Warn: release artifact v2.2.0 not signed: https://api.github.com/repos/optiopay/klar/releases/11852437","Warn: release artifact v2.1.1 not signed: https://api.github.com/repos/optiopay/klar/releases/11216882","Warn: release artifact v2.1.0 not signed: https://api.github.com/repos/optiopay/klar/releases/11026364","Warn: release artifact v2.4.0 does not have provenance: https://api.github.com/repos/optiopay/klar/releases/14314331","Warn: release artifact v2.3.0 does not have provenance: https://api.github.com/repos/optiopay/klar/releases/12050636","Warn: release artifact v2.2.0 does not have provenance: https://api.github.com/repos/optiopay/klar/releases/11852437","Warn: release artifact v2.1.1 does not have provenance: https://api.github.com/repos/optiopay/klar/releases/11216882","Warn: release artifact v2.1.0 does not have provenance: https://api.github.com/repos/optiopay/klar/releases/11026364"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1","Warn: containerImage not pinned by hash: Dockerfile:7: pin your Docker image by updating alpine:3.8 to alpine:3.8@sha256:2bb501e6173d9d006e56de5bce2720eb06396803300fe1687b58a7ff32bf4c14","Warn: goCommand not pinned by hash: Dockerfile:4","Warn: goCommand not pinned by hash: vendor/google.golang.org/grpc/vet.sh:19","Warn: goCommand not pinned by hash: vendor/google.golang.org/grpc/vet.sh:21","Info:   0 out of   2 containerImage dependencies pinned","Info:   0 out of   3 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T08:16:09.270Z","repository_id":45943470,"created_at":"2025-08-22T08:16:09.270Z","updated_at":"2025-08-22T08:16:09.270Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28539126,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T14:59:57.589Z","status":"ssl_error","status_checked_at":"2026-01-18T14:59:46.540Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["clair","docker-image","docker-registry","security","security-audit","severity-vulnerabilities"],"created_at":"2024-08-04T05:00:33.156Z","updated_at":"2026-01-18T15:11:17.732Z","avatar_url":"https://github.com/optiopay.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# Klar\nIntegration of Clair and Docker Registry (supports both Clair API v1 and v3)\n\nKlar is a simple tool to analyze images stored in a private or public  Docker registry for security vulnerabilities using Clair https://github.com/coreos/clair. Klar is designed to be used as an integration tool so it relies on enviroment variables. It's a single binary which requires no dependencies.\n\nKlar serves as a client which coordinates the image checks between the Docker registry and Clair.\n\n## Binary installation\n\nThe simplest way is to download the latest release (for OSX and Linux) from https://github.com/optiopay/klar/releases/ and put the binary in a folder in your `PATH` (make sure it has execute permission).\n\n## Installation from source code\n\nMake sure you have Go language compiler installed and configured https://golang.org/doc/install\n\nThen run\n\n    go get github.com/optiopay/klar\n\nmake sure your Go binary folder is in your `PATH` (e.g. `export PATH=$PATH:/usr/local/go/bin`)\n\n\n## Usage\n\nKlar process returns `0` if the number of detected high severity vulnerabilities in an image is less than or equal to a threshold (see below) and `1` if there were more. It will return `2` if an error has prevented the image from being analyzed.\n\nKlar can be configured via the following environment variables:\n\n* `CLAIR_ADDR` - address of Clair server. It has a form of `protocol://host:port` - `protocol` and `port` default to `http` and `6060` respectively and may be omitted. You can also specify basic authentication in the URL: `protocol://login:password@host:port`.\n\n* `CLAIR_OUTPUT` - severity level threshold, vulnerabilities with severity level higher than or equal to this threshold\nwill be outputted. Supported levels are `Unknown`, `Negligible`, `Low`, `Medium`, `High`, `Critical`, `Defcon1`.\nDefault is `Unknown`.\n\n* `CLAIR_THRESHOLD` - how many outputted vulnerabilities Klar can tolerate before returning `1`. Default is `0`.\n\n* `CLAIR_TIMEOUT` - timeout in minutes before Klar cancels the image scanning. Default is `1`\n\n* `DOCKER_USER` - Docker registry account name.\n\n* `DOCKER_PASSWORD` - Docker registry account password.\n\n* `DOCKER_TOKEN` - Docker registry account token. (Can be used in place of `DOCKER_USER` and `DOCKER_PASSWORD`)\n\n* `DOCKER_INSECURE` - Allow Klar to access registries with bad SSL certificates. Default is `false`. Clair will\nneed to be booted with `-insecure-tls` for this to work.\n\n* `DOCKER_TIMEOUT` - timeout in minutes when trying to fetch layers from a docker registry\n\n* `DOCKER_PLATFORM_OS` - The operating system of the Docker image. Default is `linux`. This only needs to be set if the image specified references a Docker ManifestList instead of a usual manifest.\n\n* `DOCKER_PLATFORM_ARCH` - The architecture the Docker image is optimized for. Default is `amd64`. This only needs to be set if the image specified references a Docker ManifestList instead of a usual manifest.\n\n* `REGISTRY_INSECURE` - Allow Klar to access insecure registries (HTTP only). Default is `false`.\n\n* `JSON_OUTPUT` - Output JSON, not plain text. Default is `false`.\n\n* `FORMAT_OUTPUT` - Output format of the vulnerabilities. Supported formats are `standard`, `json`, `table`. Default is `standard`. If `JSON_OUTPUT` is set to true, this option is ignored.\n\n* `WHITELIST_FILE` - Path to the YAML file with the CVE whitelist. Look at `whitelist-example.yaml` for the file format.\n\n* `IGNORE_UNFIXED` - Do not count vulnerabilities without a fix towards the threshold\n\nUsage:\n\n    CLAIR_ADDR=localhost CLAIR_OUTPUT=High CLAIR_THRESHOLD=10 DOCKER_USER=docker DOCKER_PASSWORD=secret klar postgres:9.5.1\n\n### Debug Output\nYou can enable more verbose output but setting `KLAR_TRACE` to true.\n* run `export KLAR_TRACE=true` to persist between runs.\n\n## Dockerized version\n\nKlar can be dockerized. Go to `$GOPATH/src/github.com/optiopay/klar` and build Klar in project root. If you are on Linux:\n\n    CGO_ENABLED=0 go build -a -installsuffix cgo .\n\nIf you are on Mac don't forget to build it for Linux:\n\n    GOOS=linux go build .\n\nTo build Docker image run in the project root (replace `klar` with fully qualified name if you like):\n\n    docker build -t klar .\n\nThen pass env vars as separate `--env` arguments, or create an env file and pass it as `--env-file` argument. For example save env vars as `my-klar.env`:\n\n    CLAIR_ADDR=localhost\n    CLAIR_OUTPUT=High\n    CLAIR_THRESHOLD=10\n    DOCKER_USER=docker\n    DOCKER_PASSWORD=secret\n\nThen run\n\n    docker run --env-file=my-klar.env klar postgres:9.5.1\n\n## Amazon ECR support\nThere is no permanent username/password for Amazon ECR, the credentials must be retrived using `aws ecr get-login` and they are valid for 12 hours. Here is a sample script which may be used to provide Klar with ECR credentials:\n\n    DOCKER_LOGIN=`aws ecr get-login --no-include-email`\n    PASSWORD=`echo $DOCKER_LOGIN | cut -d' ' -f6`\n    REGISTRY=`echo $DOCKER_LOGIN | cut -d' ' -f7 | sed \"s/https:\\/\\///\"`\n    DOCKER_USER=AWS DOCKER_PASSWORD=${PASSWORD} ./klar ${REGISTRY}/my-image\n\n## Google GCR support\nFor authentication against GCR (Google Cloud Registry), the easiest way is to use the [application default credentials](https://developers.google.com/identity/protocols/application-default-credentials). These only work when running Klar from GCP. The only requirement is the Google Cloud SDK.\n\n    DOCKER_USER=oauth2accesstoken\n    DOCKER_PASSWORD=\"$(gcloud auth application-default print-access-token)\"\n\nWith Docker:\n\n    DOCKER_USER=oauth2accesstoken\n    DOCKER_PASSWORD=\"$(docker run --rm google/cloud-sdk:alpine gcloud auth application-default print-access-token)\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptiopay%2Fklar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foptiopay%2Fklar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foptiopay%2Fklar/lists"}