{"id":36743733,"url":"https://github.com/gunnargrosch/failure-azurefunctions","last_synced_at":"2026-01-12T12:30:53.825Z","repository":{"id":39947707,"uuid":"241484966","full_name":"gunnargrosch/failure-azurefunctions","owner":"gunnargrosch","description":"Module for failure injection into Azure Functions","archived":false,"fork":false,"pushed_at":"2023-01-07T20:58:39.000Z","size":636,"stargazers_count":2,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-27T05:29:48.629Z","etag":null,"topics":["azure","azurefunctions","chaos","chaosengineering","failure","failure-injection"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gunnargrosch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-02-18T22:53:33.000Z","updated_at":"2020-10-23T23:26:57.000Z","dependencies_parsed_at":"2023-02-08T01:47:01.763Z","dependency_job_id":null,"html_url":"https://github.com/gunnargrosch/failure-azurefunctions","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/gunnargrosch/failure-azurefunctions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnargrosch%2Ffailure-azurefunctions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnargrosch%2Ffailure-azurefunctions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnargrosch%2Ffailure-azurefunctions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnargrosch%2Ffailure-azurefunctions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gunnargrosch","download_url":"https://codeload.github.com/gunnargrosch/failure-azurefunctions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gunnargrosch%2Ffailure-azurefunctions/sbom","scorecard":{"id":449461,"data":{"date":"2025-08-11","repo":{"name":"github.com/gunnargrosch/failure-azurefunctions","commit":"352f715d7e742fd20f18a510fbf4987fd52fee4b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.3,"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":"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":"Code-Review","score":0,"reason":"Found 0/21 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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"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"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 11 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"}},{"name":"Vulnerabilities","score":0,"reason":"34 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-m5vv-6r4h-3vj9","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4","Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-wpg7-2c88-r8xv","Warn: Project is vulnerable to: GHSA-pq67-2wwv-3xjx","Warn: Project is vulnerable to: GHSA-8cj5-5rvv-wf4v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-cf4h-3jhx-xvhq","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-h6q6-9hqw-rwfv","Warn: Project is vulnerable to: GHSA-5fg8-2547-mr8q","Warn: Project is vulnerable to: GHSA-crh6-fp67-6883"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T07:47:47.223Z","repository_id":39947707,"created_at":"2025-08-19T07:47:47.223Z","updated_at":"2025-08-19T07:47:47.223Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338977,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["azure","azurefunctions","chaos","chaosengineering","failure","failure-injection"],"created_at":"2026-01-12T12:30:53.762Z","updated_at":"2026-01-12T12:30:53.819Z","avatar_url":"https://github.com/gunnargrosch.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Failure injection for Azure Functions - failure-azurefunctions\n\n## Description\n\n`failure-azurefunctions` is a small Node module for injecting failure into Azure Functions (https://azure.microsoft.com/en-us/services/functions/). It offers a simple failure injection wrapper for your Azure Function handler where you then can choose to inject failure by setting the `failureMode` to `latency`, `exception`, `denylist`, `diskspace` or `statuscode`. You control your failure injection using Key Vault.\n\n## How to install\n\n1. Install `failure-azurefunctions` module using NPM.\n```bash\nnpm install failure-azurefunctions\n```\n2. Add the module to your Azure function code.\n```js\nconst failureAzureFunctions = require('failure-azurefunctions')\n```\n3. Wrap your handler.\n```js\nexports.handler = failureAzureFunctions(async (event, context) =\u003e {\n  ...\n})\n```\n4. Create a resource group and key vault (or skip to use existing one).\n```bash\naz group create --name \u003cresource-group-name\u003e -l \"EastUS\"\naz keyvault create --name \u003cyour-unique-keyvault-name\u003e -g \u003cresource-group-name\u003e\n```\n5. Create a service principal.\n```bash\naz ad sp create-for-rbac --sdk-auth\n```\n6. Give the service principal access to your key vault\n```bash\naz keyvault set-policy -n \u003cyour-unique-keyvault-name\u003e --spn \u003cclientId-of-your-service-principal\u003e --secret-permissions delete get list set --key-permissions decrypt encrypt get list unwrapKey wrapKey\n```\n7. Create a secret in Key Vault.\n```json\n{\"isEnabled\": false, \"failureMode\": \"latency\", \"rate\": 1, \"minLatency\": 100, \"maxLatency\": 400, \"exceptionMsg\": \"Exception message!\", \"statusCode\": 404, \"diskSpace\": 100, \"denylist\": [\"*.documents.azure.com\"]}\n```\n```bash\naz keyvault secret set --name \u003cyour-secret-name\u003e --vault-name \u003cyour-unique-keyvault-name\u003e --value \"{\\`\"isEnabled\\`\": false, \\`\"failureMode\\`\": \\`\"latency\\`\", \\`\"rate\\`\": 1, \\`\"minLatency\\`\": 100, \\`\"maxLatency\\`\": 400, \\`\"exceptionMsg\\`\": \\`\"Exception message!\\`\", \\`\"statusCode\\`\": 404, \\`\"diskSpace\\`\": 100, \\`\"denylist\\`\": [\\`\"*.documents.azure.com\\`\"]}\"\n```\n8. Add environment variables to your Azure Function with values from above.\n```bash\nAZURE_CLIENT_ID=\u003cyour-clientID\u003e\nAZURE_CLIENT_SECRET=\u003cyour-clientSecret\u003e\nAZURE_TENANT_ID=\u003cyour-tenantId\u003e\nKEY_VAULT_NAME=\u003cyour-unique-keyvault-name\u003e\nFAILURE_INJECTION_PARAM=\u003cyour-secret-name\u003e\n```\n```bash\naz functionapp config appsettings set --name \u003cfunction-app-name\u003e \\\n--resource-group \u003cresource-group-name\u003e --settings AZURE_CLIENT_ID=\u003cyour-clientID\u003e AZURE_CLIENT_SECRET=\u003cyour-clientSecret\u003e AZURE_TENANT_ID=\u003cyour-tenantId\u003e KEY_VAULT_NAME=\u003cyour-unique-keyvault-name\u003e FAILURE_INJECTION_PARAM=\u003cyour-secret-name\u003e\n```\n9. Try it out!\n\n## Usage\n\nEdit the values of your secret in Key Vault to use the failure injection module.\n\n* `isEnabled: true` means that failure is injected into your Azure function.\n* `isEnabled: false` means that the failure injection module is disabled and no failure is injected.\n* `failureMode` selects which failure you want to inject. The options are `latency`, `exception` or `statuscode` as explained below.\n* `rate` controls the rate of failure. 1 means that failure is injected on all invocations and 0.5 that failure is injected on about half of all invocations.\n* `minLatency` and `maxLatency` is the span of latency in milliseconds injected into your function when `failureMode` is set to `latency`.\n* `exceptionMsg` is the message thrown with the exception created when `failureMode` is set to `exception`.\n* `statusCode` is the status code returned by your function when `failureMode` is set to `statuscode`.\n* `diskSpace` is size in MB of the file created in tmp when `failureMode` is set to `diskspace`.\n* `denylist` is an array of regular expressions, if a connection is made to a host matching one of the regular expressions it will be blocked.\n\n## Example\n\nIn the subfolder `example` is a simple function which can be installed in Azure and used for test.\n\n## Notes\n\nInspired by Yan Cui's articles on latency injection for AWS Lambda (https://hackernoon.com/chaos-engineering-and-aws-lambda-latency-injection-ddeb4ff8d983) and Adrian Hornsby's chaos injection library for Python (https://github.com/adhorn/aws-lambda-chaos-injection/).\n\n## Changelog\n\n### 2020-10-23 v0.3.1\n\n* Change mitm mode back to connect to fix issue with all connections being blocked.\n\n### 2020-08-24 v0.3.0\n\n* Changed mitm mode from connect to connection for quicker enable/disable of failure injection.\n* Renamed block list failure injection to denylist (breaking change for that failure mode).\n* Updated dependencies.\n\n### 2020-02-28 v0.2.0\n\n* Fixed Key Vault integration.\n* Added simple example.\n* Updated documentation.\n\n### 2020-02-21 v0.0.1\n\n* Initial release\n\n## Contributors\n\n**Gunnar Grosch** - [GitHub](https://github.com/gunnargrosch) | [Twitter](https://twitter.com/gunnargrosch) | [LinkedIn](https://www.linkedin.com/in/gunnargrosch/)\n\n**Jason Barto** - [GitHub](https://github.com/jpbarto) | [Twitter](https://twitter.com/Jason_Barto) | [LinkedIn](https://www.linkedin.com/in/jasonbarto)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunnargrosch%2Ffailure-azurefunctions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgunnargrosch%2Ffailure-azurefunctions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgunnargrosch%2Ffailure-azurefunctions/lists"}