{"id":45311317,"url":"https://github.com/chatwork/akka-guard","last_synced_at":"2026-02-21T07:23:46.862Z","repository":{"id":33851963,"uuid":"150696081","full_name":"chatwork/akka-guard","owner":"chatwork","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-27T07:03:35.000Z","size":307,"stargazers_count":7,"open_issues_count":10,"forks_count":1,"subscribers_count":59,"default_branch":"main","last_synced_at":"2024-05-02T01:16:53.800Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Scala","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/chatwork.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":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2018-09-28T06:33:49.000Z","updated_at":"2022-05-03T03:15:17.000Z","dependencies_parsed_at":"2023-01-15T02:57:41.474Z","dependency_job_id":null,"html_url":"https://github.com/chatwork/akka-guard","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/chatwork/akka-guard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Fakka-guard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Fakka-guard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Fakka-guard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Fakka-guard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chatwork","download_url":"https://codeload.github.com/chatwork/akka-guard/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chatwork%2Fakka-guard/sbom","scorecard":{"id":274975,"data":{"date":"2025-08-11","repo":{"name":"github.com/chatwork/akka-guard","commit":"f5f532766b9a77ba87533cde94bfda365a83ceb8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"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/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"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":3,"reason":"Found 7/19 approved changesets -- score normalized to 3","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":0,"reason":"dangerous workflow patterns detected","details":["Warn: untrusted code checkout '${{ github.event.workflow_run.head_branch }}': .github/workflows/snapshot.yml:16"],"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":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bump-version.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/bump-version.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/bump-version.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/bump-version.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/bump-version.yml:42: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/bump-version.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:71: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:40: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:44: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/release.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/scala-steward.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/scala-steward.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/snapshot.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/snapshot.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/snapshot.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/snapshot.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/snapshot.yml:23: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/snapshot.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/snapshot.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/chatwork/akka-guard/snapshot.yml/main?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  15 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bump-version.yml:1","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Warn: no topLevel permission defined: .github/workflows/scala-steward.yml:1","Warn: no topLevel permission defined: .github/workflows/snapshot.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":"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: 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":"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":"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 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-17T14:12:13.457Z","repository_id":33851963,"created_at":"2025-08-17T14:12:13.457Z","updated_at":"2025-08-17T14:12:13.457Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29676198,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"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":[],"created_at":"2026-02-21T07:23:46.169Z","updated_at":"2026-02-21T07:23:46.851Z","avatar_url":"https://github.com/chatwork.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"# akka-guard\n\n[![Actions Status: CI](https://github.com/chatwork/akka-guard/workflows/CI/badge.svg)](https://github.com/chatwork/akka-guard/actions?query=workflow%3A\"CI\")\n[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.chatwork/akka-guard-core_2.13/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.chatwork/akka-guard-core_2.13)\n[![Scaladoc](http://javadoc-badge.appspot.com/com.chatwork/akka-guard-core_2.13.svg?label=scaladoc)](http://javadoc-badge.appspot.com/com.chatwork/akka-guard-core_2.13/com/chatwork/scala/ulid/index.html?javadocio=true)\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n\nThis Scala library is to protect against attack, typified by Brute-Force Attack.\n\n## Installation\n\nAdd the following to your sbt build (2.11.x, 2.12.x, 2.13.x).\n\n### Release Version\n\n```scala\nresolvers += Resolver.sonatypeRepo(\"releases\")\n\nlibraryDependencies += \"com.chatwork\" %% \"akka-guard-http-typed\" % \u003cversion\u003e\n```\n\nor classic is\n\n```scala\nresolvers += Resolver.sonatypeRepo(\"releases\")\n\nlibraryDependencies += \"com.chatwork\" %% \"akka-guard-http\" % \u003cversion\u003e\n```\n\n## How to use\n\n### Setting to SABConfig\n\nFirst, decide the setting value of Service Attack Blocker.\n\n```scala\nimport com.chatwork.akka.guard.typed.config.{ ExponentialBackoff, SABConfig}\n\nimport scala.concurrent.duration._\n\nval sabConfig: SABConfig =\n  SABConfig(\n    maxFailures = 5L,\n    failureDuration = 1 minute,\n    backoff = ExponentialBackoff(\n      minBackoff = 5 minutes,\n      maxBackoff = 1 hour,\n      randomFactor = 0.2\n    ),\n    guardResetTimeout = Some(1 hour)\n  )\n```\n\nor classic is\n\n```scala\nimport com.chatwork.akka.guard.{ ExponentialBackoff, SABConfig }\n\nimport scala.concurrent.duration._\n\nval sabConfig: SABConfig =\n  SABConfig(\n    maxFailures = 5L,\n    failureDuration = 1 minute,\n    backoff = ExponentialBackoff(\n      minBackoff = 5 minutes,\n      maxBackoff = 1 hour,\n      randomFactor = 0.2\n    ),\n    guardResetTimeout = Some(1 hour)\n  )\n```\n\n### Setting to ServiceAttackBlocker\n\nNext, setting to ServiceAttackBlocker.\n\n- `failedResponse`: If ServiceAttackBlocker is in the Open state, it will respond as a failed.\n- `isFailed`: which determines whether the response is unsuccessful or not.\n- `eventHandler`: Events in the Open and Closed states can be handled and used for log output, metrics, etc.\n\n```scala\nimport akka.actor.ActorSystem\nimport akka.http.scaladsl.model.{ HttpResponse, StatusCodes }\nimport akka.http.scaladsl.server.{ Directive0, RejectionHandler, RouteResult }\nimport com.chatwork.akka.guard.http.typed.ServiceAttackBlocker\nimport com.chatwork.akka.guard.http.typed.ServiceAttackBlockerDirectives._\nimport com.chatwork.akka.guard.typed.ID\nimport com.chatwork.akka.guard.typed.SABActor.SABStatus\nimport com.chatwork.akka.guard.typed.config.SABConfig\n\nimport scala.util.{ Success, Try }\n\nprivate def rejectionHandler: RejectionHandler = ???\n\nprivate val failedResponse: Try[ServiceAttackBlocker.R] = Success(\n  RouteResult.Complete(HttpResponse(status = StatusCodes.Forbidden))\n)\n\nprivate val isFailed: ServiceAttackBlocker.R =\u003e Boolean = {\n  case RouteResult.Complete(res) if res.status == StatusCodes.OK =\u003e false\n  case RouteResult.Rejected(rejections)                          =\u003e rejectionHandler(rejections).isDefined\n  case _                                                         =\u003e true\n}\n\nprivate val eventHandler: Option[(ID, SABStatus) =\u003e Unit] =\n  Some(\n    {\n      case (id, SABStatus.Open)   =\u003e println(s\"$id is open.\")\n      case (id, SABStatus.Closed) =\u003e println(s\"$id is closed.\")\n    }\n  )\n\ndef myServiceAttackBlocker(actorSystem: ActorSystem, sabConfig: SABConfig): String =\u003e Directive0 =\n  serviceAttackBlocker(\n    ServiceAttackBlocker(actorSystem, sabConfig)(failedResponse, isFailed, eventHandler)\n  )\n```\n\nor classic is\n\n```scala\nimport akka.actor.ActorSystem\nimport akka.http.scaladsl.model.{ HttpResponse, StatusCodes }\nimport akka.http.scaladsl.server.{ Directive0, RejectionHandler, RouteResult }\nimport com.chatwork.akka.guard.http.ServiceAttackBlocker\nimport com.chatwork.akka.guard.http.ServiceAttackBlockerDirectives._\nimport com.chatwork.akka.guard.{ ID, SABConfig, SABStatus }\n\nimport scala.util.{ Success, Try }\n\nprivate def rejectionHandler: RejectionHandler = ???\n\nprivate val failedResponse: Try[ServiceAttackBlocker.R] = Success(\n  RouteResult.Complete(HttpResponse(status = StatusCodes.Forbidden))\n)\n\nprivate val isFailed: ServiceAttackBlocker.R =\u003e Boolean = {\n  case RouteResult.Complete(res) if res.status == StatusCodes.OK =\u003e false\n  case RouteResult.Rejected(rejections)                          =\u003e rejectionHandler(rejections).isDefined\n  case _                                                         =\u003e true\n}\n\nprivate val eventHandler: Option[(ID, SABStatus) =\u003e Unit] =\n  Some(\n    {\n      case (id, SABStatus.Open)   =\u003e println(s\"$id is open.\")\n      case (id, SABStatus.Closed) =\u003e println(s\"$id is closed.\")\n    }\n  )\n\ndef myServiceAttackBlocker(actorSystem: ActorSystem, sabConfig: SABConfig): String =\u003e Directive0 =\n  serviceAttackBlocker(\n    ServiceAttackBlocker(actorSystem, sabConfig)(failedResponse, isFailed, eventHandler)\n  )\n```\n\n### Routing Example\n\n```scala\nimport akka.http.scaladsl.server.Directives._\nimport akka.http.scaladsl.server.Route\n\nval route: Route =\n  extractActorSystem { system =\u003e\n    path(\"login\" / Segment) { id =\u003e\n      myServiceAttackBlocker(system, sabConfig)(id) {\n        complete(\"success\")\n      }\n    }\n  }\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatwork%2Fakka-guard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchatwork%2Fakka-guard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchatwork%2Fakka-guard/lists"}