{"id":43901469,"url":"https://github.com/leocomelli/secrets-init","last_synced_at":"2026-02-06T18:55:00.017Z","repository":{"id":36959315,"uuid":"442273980","full_name":"leocomelli/secrets-init","owner":"leocomelli","description":"A simple CLI that reads secrets from Secrets Manager and can be used as an init container","archived":false,"fork":false,"pushed_at":"2023-12-18T08:39:01.000Z","size":184,"stargazers_count":0,"open_issues_count":8,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-16T01:19:46.103Z","etag":null,"topics":["gcp","go","initcontainer","kubernetes"],"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/leocomelli.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-27T21:09:03.000Z","updated_at":"2023-01-31T19:24:15.000Z","dependencies_parsed_at":"2024-06-21T11:46:32.396Z","dependency_job_id":"0bcb35c1-a809-41ba-b024-6ab990686ee0","html_url":"https://github.com/leocomelli/secrets-init","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":0.3928571428571429,"last_synced_commit":"6c49cd0606ff9ead09e4c6412bd296a733f8490f"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/leocomelli/secrets-init","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocomelli%2Fsecrets-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocomelli%2Fsecrets-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocomelli%2Fsecrets-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocomelli%2Fsecrets-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leocomelli","download_url":"https://codeload.github.com/leocomelli/secrets-init/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leocomelli%2Fsecrets-init/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29172628,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-06T16:33:35.550Z","status":"ssl_error","status_checked_at":"2026-02-06T16:33:30.716Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["gcp","go","initcontainer","kubernetes"],"created_at":"2026-02-06T18:54:59.332Z","updated_at":"2026-02-06T18:55:00.002Z","avatar_url":"https://github.com/leocomelli.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# secrets-init\n\nThis is a simple CLI that reads secrets from Secrets Manager. It's a perfect \"init\" container in Kubernetes, it can create a file on a shared volume so the other containers can use that file. secrets-init can filter one or more secrets by name using a regular expression, it also parses the secret content as plain text or json.\n\n## CLI\n\n```sh\n./secrets-init \\\n    --provider YOUR_CLOUD_PROVIDER \\\n    --project YOUR_PROJECT_ID \\\n    --filter YOUR_FILTER \\\n    --data-parser json\n```\n\n### Example\n\nGiven a secret called `myapp` with the content below:\n\n```json\n{\n  \"username\": \"root\",\n  \"password\": \"s3cr3t\",\n  \"host\": \"localhost\",\n  \"port\": \"5432\"\n}\n\n```\n\nRunning secrets-init with the flags:\n\n```bash\n./secrets-init \\\n    --provider gcp \\\n    --project myproject \\\n    --filter=^myapp*\" \\\n    --data-parser json\n```\n\nOutput:\n\n```bash\nexport MYAPP_PASSWORD=\"s3cr3t\"\nexport MYAPP_HOST=\"localhost\"\nexport MYAPP_PORT=\"5432\"\nexport MYAPP_USERNAME=\"root\"\n```\n## Init container\n\nCheck the examples directory\n\n- [GCP](https://github.com/leocomelli/secrets-init/blob/main/examples/gcp.yml)\n- [AWS](https://github.com/leocomelli/secrets-init/blob/main/examples/aws.yml)\n\n\n## Providers\n\n- [x] Google Cloud Platform\n- [x] AWS\n- [ ] Azure\n\n## Filter\n\nUse the flag `--filter` to filter one or more secrets, a regular expression should be provided ([regexp/syntax](https://pkg.go.dev/regexp/syntax)).\n\n## Parser\n\nUse the flag `--data-parser` to parse the secret content. There are two predefined parsers, the default is `plaintext` the other one is `json`. Both parses are associated with a template to render the output.\n\n* **plaintext:** `export {{ .Name  | ToUpper }}=\"{{ .Data }}`, where `Name` is the secret name and `Data` is the full content.\n* **json:** `export {{ .Name  | ToUpper }}_{{ .ContentKey | ToUpper }}=\"{{ .ContentValue }}`, where `Name` is the secret name, `ContentKey`/`ContentValue` are the key and value of each json property. \n\nBut when necessary, the template can be reset ([text/template](https://pkg.go.dev/text/template)). Use the flag `--template`, for example, to generate an output file in key/value format.\n\n```bash\n--template {{ .Name | ToLower }}_{{.ContentKey | ToLower }}={{ .ContentValue }}\n```\n\n## Output\n\nUse the `--output` to write output file to a specific path, `stdout` if it is empty.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocomelli%2Fsecrets-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleocomelli%2Fsecrets-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleocomelli%2Fsecrets-init/lists"}