{"id":37086191,"url":"https://github.com/imsweb/cconf","last_synced_at":"2026-01-14T10:36:30.746Z","repository":{"id":65507620,"uuid":"422439934","full_name":"imsweb/cconf","owner":"imsweb","description":"Multi-sourced (and optionally encrypted) configuration management.","archived":false,"fork":false,"pushed_at":"2025-10-13T15:37:39.000Z","size":192,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-04T17:41:07.697Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imsweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2021-10-29T04:18:57.000Z","updated_at":"2025-10-13T15:37:43.000Z","dependencies_parsed_at":"2025-08-09T04:05:40.290Z","dependency_job_id":"8ebf9829-ee58-4f5f-b240-6e2ea76e1ff6","html_url":"https://github.com/imsweb/cconf","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/imsweb/cconf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fcconf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fcconf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fcconf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fcconf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imsweb","download_url":"https://codeload.github.com/imsweb/cconf/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imsweb%2Fcconf/sbom","scorecard":{"id":486459,"data":{"date":"2025-08-11","repo":{"name":"github.com/imsweb/cconf","commit":"4a17feaf18aca2c8a54182b0484eb35b9babfdf1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/26 approved changesets -- score normalized to 0","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":"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":"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/publish.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/publish.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/test.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/imsweb/cconf/test.yml/main?enable=pin","Info:   0 out of   5 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction 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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" 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":"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/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 '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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-19T17:56:53.787Z","repository_id":65507620,"created_at":"2025-08-19T17:56:53.787Z","updated_at":"2025-08-19T17:56:53.787Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28417666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T10:25:19.714Z","status":"ssl_error","status_checked_at":"2026-01-14T10:22:49.371Z","response_time":107,"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":[],"created_at":"2026-01-14T10:36:30.072Z","updated_at":"2026-01-14T10:36:30.736Z","avatar_url":"https://github.com/imsweb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cconf\n\n`cconf` is a library for reading configuration from various sources (such as environment\nvariables, environment files, and environment directories) and optionally encrypting\nsensitive configurations. Sensitive configuration values are encrypted using\n[Fernet](https://cryptography.io/en/latest/fernet/) tokens, which provide authenticated\ncrypography and the ability to specify a maximum valid lifetime (`ttl`).\n\n\n## Installation\n\n`pip install cconf`\n\n\n## Usage\n\nBy default, there is a `config` singleton set up to read configuration from the process\nenvironment variables (`os.environ`):\n\n```python\nfrom cconf import config\n\nDEBUG = config(\"DEBUG\", False, cast=bool)\n```\n\nYou can add to the list of configuration sources (this will still read from `os.environ`\nfirst):\n\n```python\nfrom cconf import config\n\nconfig.file(\"/path/to/.env\")\nconfig.dir(\"/path/to/envdir\")\n```\n\nOr you may want to set the configuration sources (and their order) manually. The\nfollowing will try `envdir` first, followed by `.env`.\n\n```python\nfrom cconf import config\n\nconfig.setup(\"/path/to/envdir\", \"/path/to/.env\")\n```\n\nYou can also specify sources that have `keys`, which can be the path to a file with\n`Fernet` keys, one per line, or a list of `str|bytes` keys that will be converted to\n`Fernet` keys:\n\n```python\nfrom cconf import config, EnvDir, EnvFile, HostEnv\n\nconfig.setup(\n    EnvDir(\"/path/to/envdir\", keys=\"/path/to/envdir.keys\"),\n    EnvFile(\"/path/to/.env\", keys=\"/path/to/env.keys\"),\n    HostEnv(keys=[\"WQ6g4VBia1fNCuVCrsX5VvGUWYlHssUJLshONLsivhc=\"]),\n)\n```\n\n## Encrypting Sensitive Data\n\nAny configuration value can be marked as `sensitive`, meaning it must be encrypted (or\nbase64-encoded if not using `Fernet` keys) and will never be read from a plaintext\nsource.\n\n```python\nfrom cconf import config, Secret\n\nconfig.file(\"/path/to/.env\", keys=\"/path/to/secret.key\")\n\n# This SECRET_KEY is only valid for 24 hours.\nSECRET_KEY = config(\"SECRET_KEY\", sensitive=True, cast=Secret, ttl=86400)\n```\n\nSetting a `ttl` will ensure the encrypted value is no older than that number of seconds.\nValues older than `ttl` will emit a warning and return `undefined`. You may set a\ndefault value for a `sensitive` config value, but a warning will be emitted.\n\nTo get started, you can use the `cconf` CLI tool to generate a new `Fernet` key, then\nuse that key to encrypt some data:\n\n```\n% cconf genkey \u003e secret.key\n% cconf encrypt --keyfile secret.key secretdata\n```\n\nIf you've already generated a key and configured the sources with that key in your\nsettings file, you may also pass `-c/--config` to `cconf`:\n\n```\n% cconf -c myapp.settings encrypt secretdata\n```\n\nThis will encrypt the string `secretdata` using all encrypted sources in your config,\nand output them along with the source they're encrypted for. You must add this data to\nyour configuration files manually, `cconf` makes no attempt to write to these files for\nyou.\n\n\n## Key and File Policies\n\nA source may specify a key file policy (`keys=cconf.KeyFile(name, policy=...)`) which\nperforms additional checks when opening the key file. By default `KeyFile.policy` is\nset to `cconf.UserOnly`, which checks that the key file is owned by the current user,\nand has no permissions granted to group or other users (i.e. `600` mode).\n\nSimilarly, `EnvFile` and `EnvDir` sources accept a `policy` argument (which defaults to\n`None`) that will perform policy checks when opening the environment files. You may set\nthis to `cconf.UserOnly` or `cconf.UserOrGroup`, or write your own policy. A policy is\nsimply a function that takes a single `path` argument and raises `cconf.PolicyError` if\nthe file should not be opened.\n\n\n## Checking Configuration\n\nThe `cconf` CLI tool includes a `check` command which will print out a list of\nconfiguration variables it knows about, grouped by the source. For instance, running it\nagainst the `tests.settings.prod` module of a local checkout will produce something that\nlooks like this:\n\n```\n% python -m cconf.cli -c tests.settings.prod check\nEnvFile(/Users/dcwatson/Projects/cconf/tests/envs/prod)\n    HOSTNAME\n        'prodhost'\n    USERNAME\n        'produser'\n    API_KEY\n        'prodkey'\nEnvDir(/Users/dcwatson/Projects/cconf/tests/envdirs/prod)\n    PASSWORD\n        'cc0nfRul3z!'\n(Default)\n    DEBUG\n        'false'\n```\n\n## Warnings\n\n`cconf` will emit warnings (specifically `ConfigWarning`, a subclass of `UserWarning`)\nin certain cases:\n\n* A config value was marked as `sensitive`, but the value extracted from the\n  configuration source has either expired (if a `ttl` was specified), or is improperly\n  encrypted (wrong key, plaintext, etc.)\n* A config value was marked as `sensitive`, but was not found in any of the sources and\n  a default value is being used.\n* A config key was not found in any of the sources, and there is no default value\n  specified. In this case, `undefined` is returned and a warning is emitted.\n\nYou may choose to silence these warnings, or promote them to exceptions using Python's\n`warnings` module:\n\n```python\nimport warnings\nfrom cconf import ConfigWarning\n\n# Silence all ConfigWarnings.\nwarnings.simplefilter(\"ignore\", ConfigWarning)\n\n# Raise ConfigWarnings as exceptions.\nwarnings.simplefilter(\"error\", ConfigWarning)\n```\n\n\n## Django Integration\n\n`cconf` includes a single management command that wraps the `cconf` CLI tool. To use it,\nadd `cconf` to your `INSTALLED_APPS` setting, then run `manage.py config`. Being a\nmanagement command means your settings are already imported, so you don't need to\nconstantly pass `-c myproject.settings` to the `cconf` CLI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsweb%2Fcconf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimsweb%2Fcconf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimsweb%2Fcconf/lists"}