{"id":23465780,"url":"https://github.com/natrontech/gcp-mysql-backup","last_synced_at":"2026-05-18T03:31:12.418Z","repository":{"id":238830099,"uuid":"797689745","full_name":"natrontech/gcp-mysql-backup","owner":"natrontech","description":"A simple container image to create gcp mysql backups","archived":false,"fork":false,"pushed_at":"2026-01-27T15:26:32.000Z","size":164,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-28T02:09:04.685Z","etag":null,"topics":["backup","gcp","mysql"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/natrontech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":"SECURITY-INSIGHTS.yml","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-05-08T10:26:45.000Z","updated_at":"2026-01-27T15:26:36.000Z","dependencies_parsed_at":"2024-12-24T11:39:31.586Z","dependency_job_id":"6319a875-60d1-4a9b-a87f-741a2150e6e0","html_url":"https://github.com/natrontech/gcp-mysql-backup","commit_stats":null,"previous_names":["natrontech/gcp-mysql-backup"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/natrontech/gcp-mysql-backup","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fgcp-mysql-backup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fgcp-mysql-backup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fgcp-mysql-backup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fgcp-mysql-backup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/natrontech","download_url":"https://codeload.github.com/natrontech/gcp-mysql-backup/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/natrontech%2Fgcp-mysql-backup/sbom","scorecard":{"id":1236786,"data":{"date":"2025-09-02T09:25:57Z","repo":{"name":"github.com/natrontech/gcp-mysql-backup","commit":"baacf626dba07c6b4cf92c0522dbc7019e55aed3"},"scorecard":{"version":"v5.2.1","commit":"ab2f6e92482462fe66246d9e32f642855a691dc1"},"score":7.7,"checks":[{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#code-review"}},{"name":"Dependency-Update-Tool","score":10,"reason":"update tool detected","details":["Info: detected update tool: Dependabot: .github/dependabot.yml:1"],"documentation":{"short":"Determines if the project uses a dependency update tool.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dependency-update-tool"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#dangerous-workflow"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#security-policy"}},{"name":"Maintained","score":8,"reason":"10 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":10,"reason":"GitHub workflow tokens follow principle of least privilege","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/release.yml:28","Info: jobLevel 'actions' permission set to 'read': .github/workflows/release.yml:100","Info: jobLevel permissions set to 'read-all': .github/workflows/release.yml:118","Info: found token with 'none' permissions: .github/workflows/release.yml:1","Info: topLevel permissions set to 'read-all': .github/workflows/scorecard.yml:18"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#token-permissions"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":8,"reason":"dependency not pinned by hash detected -- score normalized to 8","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating google/cloud-sdk:alpine to google/cloud-sdk:alpine@sha256:253042fdbc296fb29b6013c376c0403083e71a090b6541c88f1fd289be97707d","Info:   5 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   9 out of   9 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage 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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#pinned-dependencies"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#vulnerabilities"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:23"],"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#packaging"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#license"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#sast"}},{"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/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'main'","Info: 'force pushes' disabled on branch 'main'","Warn: 'branch protection settings apply to administrators' is disabled on branch 'main'","Warn: 'stale review dismissal' is disabled on branch 'main'","Warn: required approving review count is 1 on branch 'main'","Warn: codeowners review is not required on branch 'main'","Warn: 'last push approval' is disabled on branch 'main'","Warn: no status checks found to merge onto branch 'main'","Info: PRs are required in order to make changes on branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#signed-releases"}},{"name":"Contributors","score":6,"reason":"project has 2 contributing companies or organizations -- score normalized to 6","details":["Info: found contributions from: berner fachhochschule, natrontech"],"documentation":{"short":"Determines if the project has a set of contributors from multiple organizations (e.g., companies).","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#contributors"}},{"name":"CI-Tests","score":0,"reason":"0 out of 15 merged PRs checked by a CI test -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project runs tests before pull requests are merged.","url":"https://github.com/ossf/scorecard/blob/ab2f6e92482462fe66246d9e32f642855a691dc1/docs/checks.md#ci-tests"}}]},"last_synced_at":"2025-09-02T11:09:59.242Z","repository_id":238830099,"created_at":"2025-09-02T11:09:59.242Z","updated_at":"2025-09-02T11:09:59.242Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33163708,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"online","status_checked_at":"2026-05-18T02:00:06.436Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["backup","gcp","mysql"],"created_at":"2024-12-24T11:37:00.712Z","updated_at":"2026-05-18T03:31:12.412Z","avatar_url":"https://github.com/natrontech.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MySQL Backup Docker Container\n\n[![license](https://img.shields.io/github/license/natrontech/gcp-mysql-backup)](https://github.com/natrontech/gcp-mysql-backup/blob/main/LICENSE)\n[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/natrontech/gcp-mysql-backup/badge)](https://securityscorecards.dev/viewer/?uri=github.com/natrontech/gcp-mysql-backup)\n[![release](https://img.shields.io/github/v/release/natrontech/gcp-mysql-backup)](https://github.com/natrontech/gcp-mysql-backup/releases)\n[![SLSA 3](https://slsa.dev/images/gh-badge-level3.svg)](https://slsa.dev)\n\nThis Docker container is designed to backup MySQL databases and upload the backups to Google Cloud Storage. It also handles the management of a Cloud SQL Proxy connection to securely connect to Google Cloud SQL instances without exposing them publicly.\n\n## Features\n\n- **Database Backups**: Supports backing up multiple databases configured via environment variables.\n- **Google Cloud Storage**: Automatically uploads database backups to a specified GCS bucket.\n- **Cloud SQL Proxy Management**: Manages the lifecycle of a Cloud SQL Proxy connection to secure database access.\n\n## Prerequisites\n\n- A Google Cloud account with a configured GCS bucket.\n- Access to a Google Cloud SQL instance or any MySQL server.\n- Docker installed on your machine or Kubernetes cluster.\n\n## Configuration\n\n### Environment Variables\n\nThis container relies on several environment variables for operation:\n\n- `MYSQL_HOST` (**Required**): The hostname of the MySQL server.\n- `MYSQL_USER` (**Required**): The username for the MySQL database.\n- `MYSQL_PASSWORD` (**Required**): The password for the MySQL database (recommended to use Kubernetes secrets for Kubernetes deployments).\n- `MYSQL_DATABASES` (**Required**): Comma-separated list of databases to backup.\n- `GCS_BUCKET` (**Required**): The Google Cloud Storage bucket for storing backups.\n- `GCS_BUCKET_DIR` (**Required**): The directory within the GCS bucket to store backups.\n- `MYSQL_PORT` (**Required**): The port on which the MySQL server or proxy is accessible (default 3306).\n- `PROXY_QUIT_URL` (**Required**): URL to send the quit command to the Cloud SQL Proxy.\n\n### Volumes\n\n- `/backup`: The directory where database dumps are temporarily stored before being uploaded to GCS.\n\n## Usage\n\n### Running Locally\n\nTo run the Docker container locally:\n\n```sh\ndocker run -e MYSQL_HOST='your-mysql-host' -e MYSQL_PORT='3306' -e MYSQL_USER='user' -e MYSQL_PASSWORD='password' \\\n-e MYSQL_DATABASES='db1,db2' -e GCS_BUCKET='your-gcs-bucket' \\\n-e PROXY_QUIT_URL='http://localhost:9091/quitquitquit' \\\n-v your-local-backup-dir:/backup \\\nyour-docker-image\n```\n\n### Deployment in Kubernetes\n\nCreate a read-only mysql user for the databases you want to backup:\n\n```sql\nCREATE USER 'backup'@'%' IDENTIFIED BY 'password';\nGRANT SELECT, LOCK TABLES ON *.* TO 'backup'@'%';\n```\n\nDeploy this container in a Kubernetes cluster as part of a CronJob. Refer to the [deployment](./deployment/) directory for a Kubernetes deployment example.\n\n```sh\nkubectl apply -k deployment/\n```\n\n### GCP Service Account \u0026 IAM Role\n\nSet up a service account in GCP and assign necessary roles for Cloud SQL and GCS access:\n\n```sh\ngcloud iam service-accounts create cloudsql-backup-sa --display-name \"Cloud SQL Backup Service Account\"\n\ngcloud projects add-iam-policy-binding your-project-id \\\n--member serviceAccount:cloudsql-backup-sa@your-project-id.iam.gserviceaccount.com \\\n--role roles/cloudsql.client\n\ngcloud projects add-iam-policy-binding your-project-id \\\n--member serviceAccount:cloudsql-backup-sa@your-project-id.iam.gserviceaccount.com \\\n--role roles/storage.objectAdmin\n```\n\nBind this service account to your Kubernetes service account:\n\n```sh\ngcloud iam service-accounts add-iam-policy-binding \\\n--role roles/iam.workloadIdentityUser \\\n--member \"serviceAccount:your-project-id.svc.id.goog[your-namespace/your-service-account]\"\n```\n\n## Release\n\nEach release of the application includes the container images. \n\nThe release workflow creates provenance for its builds using the [SLSA standard](https://slsa.dev), which conforms to the [Level 3 specification](https://slsa.dev/spec/v1.2/build-track-basics#build-l3). Each artifact can be verified using the `slsa-verifier` or `cosign` tool (see [Release verification](SECURITY.md#release-verification)).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatrontech%2Fgcp-mysql-backup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnatrontech%2Fgcp-mysql-backup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnatrontech%2Fgcp-mysql-backup/lists"}