HaveIBeenPwned/PwnedPasswordsAzureFunction

GitHub: HaveIBeenPwned/PwnedPasswordsAzureFunction

该项目提供了运行在 Azure Functions 上的 Pwned Passwords API 实现,利用 k-匿名模型安全地验证密码是否已遭泄露。

Stars: 820 | Forks: 50

HIBP Logo

Pwned Passwords - Azure Function


Continuous Integration Build Publish Test Results

APIs for the k-anonymity Pwned Passwords implementation
Visit Pwned Passwords · View Pwned Passwords API · Report an Issue

## 目录 - [关于](#about-pwned-passwords-%2D-azure-function) - [贡献](#getting-started-with-contributions) - [前置条件](#prerequisites) - [本地运行](#running-locally) - [待办事项](#to%2Ddo-list) - [许可证](#license) ## 关于 Pwned Passwords - Azure Function 此仓库包含 Pwned Passwords Azure Function 的代码——该 Web 端点直接与 Azure Blob Storage 交互,使用固定的五位长度 SHA-1 前缀来检索 Pwned Passwords 的 SHA-1 哈希值,以匿名化请求。有关 k-anonymity 模型和 Pwned Passwords 的更多详细信息,请查看 Troy Hunt 的博客文章[此处](https://www.troyhunt.com/ive-just-launched-pwned-passwords-version-2/)。Pwned Passwords Cloudflare Worker 可以在[这里](https://github.com/HaveIBeenPwned/PwnedPasswordsCloudflareWorker)找到。 ## 贡献指南 欢迎任何人为此项目做出贡献。 请确保您首先阅读我们的[行为准则](/CODE_OF_CONDUCT.md)。 ### 前置条件 建议使用 [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/)、[VS Code](https://code.visualstudio.com/) 或 [JetBrains Rider](https://www.jetbrains.com/rider) 来开发 Pwned Passwords Azure Function。您还需要安装 [.NET 5.0 SDK](https://dotnet.microsoft.com/download/dotnet/5.0)。 安装您选择的 IDE 后,请确保安装相关的 Azure Functions 扩展。 - 对于 Visual Studio 2019,请确保已安装 [Azure Development workload](https://docs.microsoft.com/en-us/azure/azure-functions/functions-create-your-first-function-visual-studio#prerequisites)。如果尚未安装,请使用 Visual Studio Installer 进行安装(说明可在[此处](https://docs.microsoft.com/en-us/dotnet/azure/configure-visual-studio)找到)。 - 对于 VS Code,请使用 VS Code 的 [Azure Functions](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azurefunctions) 扩展。 - 对于 JetBrains Rider,请安装 [Azure Toolkit](https://plugins.jetbrains.com/plugin/11220-azure-toolkit-for-rider),并确保从设置中安装 Azure Functions 核心工具(*Tools \| Azure \| Functions*)。 您还需要一个 Azure Storage 模拟器来进行 Azure Blob Storage 的本地模拟: - [Azure Storage Emulator](https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator) (Windows) - [Azurite](https://github.com/Azure/Azurite) (Windows, macOS, Linux) ### 本地运行 您应该在 Functions 项目中配置一个 `local.settings.json` 文件,用于保存 `PwnedPasswordsConnectionString`、`BlobContainerName`、`TableStorageName` 和 `MetadataTableStorageName` 的 Configuration Manager 值。请确保**不要**提交此文件(它在 Functions 项目中被 Git 忽略)。 `local.settings.json` 应包含以下正确配置的值: ``` { "IsEncrypted": false, "Values": { "AzureWebJobsStorage": "", "BlobContainerName": "", "TableStorageName": "" } } ``` 使用 cURL 等工具或 Web 浏览器,您可以访问本地运行的 Azure Functions 端点,通常地址为 `http://localhost:7071`。 ``` curl -X GET http://localhost:7071/range/21BD1 ``` ## 待办事项 - [x] 可接收 SHA-1/NTLM/流行度数据的经过身份验证的端点 - [x] 将 SHA-1 提取到 Azure Blob Storage 中——追加到文件或更新计数值 - [ ] 将 SHA-1/NTLM 哈希添加到可下载语料库中——这应该每月更新 - [ ] 必须使语料库或 blob 存储文件对应的 Cloudflare 缓存项失效——对于缓存项,这不应超过每天一次 开源 Pwned Passwords Azure Function 的全部宗旨是为了促进 Pwned Passwords 项目的进一步开发。此待办事项列表取自[宣布开源 Pwned Passwords 的博客文章](https://www.troyhunt.com/pwned-passwords-open-source-in-the-dot-net-foundation-and-working-with-the-fbi/)。 ## 维护者 此仓库目前由 [@TroyHunt](https://github.com/troyhunt) 维护。 ## 许可证 此项目已在 BSD 3-clause 许可证下发布。更多信息可以通过查看许可证[这里](LICENSE)找到。
标签:API, API 接口, Azure Function, DNS解析, Have I Been Pwned, k-anonymity, MITRE, Pwned Passwords, 云函数, 哈希, 多人体追踪, 密码安全, 密码强度检测, 开源项目, 网络安全, 网络安全, 隐私保护, 隐私保护