synthetic-sensitive-data-in-source-code-n300
收藏资源简介:
该数据集是一个合成数据集,包含300个源代码和配置文件片段,其中嵌入了硬编码的机密信息(如API密钥、密码、连接字符串、PII、内部URL等)以及私钥/密钥库。每个样本至少包含一个敏感发现(无干净的负样本),版本1.2确保在multi_secret类别中标记了所有存在的机密(完整真实标注)。数据集涵盖7个类别:api_key(55个)、password_secret(50个)、connection_string(45个)、pii(45个)、internal_url(40个)、multi_secret(35个)、private_key_keystore(30个),涉及Python、JavaScript、Java、C#、Kotlin、Go、Bash、env、YAML、JSON等多种编程语言。每条记录包含:id(样本ID,格式SDS-####)、category(主要类别)、language(片段语言)、code_text(原始代码/配置,作为模型输入)、sensitive_count(标记的机密数量)、finding_types(机密类型,以|分隔,CSV格式)、sensitive_findings(真实标注列表,仅JSON格式)。数据集旨在用于机密/PII检测基准测试、本地掩码和反向掩码评估,以及LLM中的提示/代码泄漏实验(特别针对OWASP LLM02——敏感信息泄露)。所有值均为合成/伪造,使用种子42可完全重现,每个样本平均机密数约为1.29。数据集包含多种格式文件:JSON、CSV、Excel(含土耳其语变体)以及统计文件。
This is a synthetic dataset containing 300 source code and configuration file snippets embedded with hard-coded sensitive information, including API keys, passwords, connection strings, PII, internal URLs, and private keys/keystores. Each sample contains at least one sensitive finding, with no clean negative samples. Version 1.2 of the dataset ensures full ground truth annotation for all existing secrets in the multi_secret category. The dataset covers 7 categories: api_key (55 samples), password_secret (50 samples), connection_string (45 samples), pii (45 samples), internal_url (40 samples), multi_secret (35 samples), and private_key_keystore (30 samples), spanning multiple programming and configuration languages including Python, JavaScript, Java, C#, Kotlin, Go, Bash, env files, YAML, and JSON. Each record includes the following fields: id (sample ID in the format SDS-####), category (primary category), language (language of the snippet), code_text (raw code/configuration for model input), sensitive_count (number of annotated secrets), finding_types (secret types separated by | in CSV format), and sensitive_findings (list of ground truth secrets formatted exclusively in JSON). This dataset is intended for secrets/PII detection benchmarking, local masking and reverse masking evaluations, as well as prompt/code leakage experiments in LLMs, specifically targeting OWASP LLM02: Sensitive Data Exposure. All values within the dataset are synthetic or fabricated, and full reproducibility can be achieved using seed 42. The average number of secrets per sample is approximately 1.29. The dataset includes files in multiple formats: JSON, CSV, Excel (with a Turkish language variant), and statistical files.
数据集概述:合成源代码敏感数据(N=300)
基本信息
- 名称:Synthetic Sensitive Data in Source Code (N=300)
- 规模:300 条样本(n<1K)
- 许可证:MIT
- 语言:英文、代码(Python、JavaScript、Java、C#、Kotlin、Go、Bash、env、YAML、JSON)
- 任务类别:文本分类、其他
- 标签:安全、密钥、PII、LLM、OWASP、合成、源代码、掩码
内容与设计
- 包含 300 条源代码/配置文件片段,每一条都至少包含一个硬编码密钥或 PII(无干净负样本)。
- 所有值均为合成/虚构数据,不可视为真实凭据。
- 版本 1.2 中,
multi_secret(及相关)样本会标注code_text中每一个出现的密钥(完整 ground truth)。
类别分布(N=300)
| 类别 | 数量 |
|---|---|
api_key |
55 |
password_secret |
50 |
connection_string |
45 |
pii |
45 |
internal_url |
40 |
multi_secret |
35 |
private_key_keystore |
30 |
数据文件
| 文件 | 描述 |
|---|---|
synthetic_sensitive_data_in_source_code_n300.json |
完整记录 + ground-truth sensitive_findings |
synthetic_sensitive_data_in_source_code_n300.csv |
扁平视图(` |
| ` 转义) | |
synthetic_sensitive_data_in_source_code_n300_excel.csv |
Excel 友好(逗号 + BOM) |
synthetic_sensitive_data_in_source_code_n300_tr.csv |
土耳其语 Excel(分号 + BOM) |
synthetic_sensitive_data_in_source_code_n300.xlsx |
Excel 工作簿 |
dataset_stats.json |
分布摘要 |
数据字段(Schema)
id— 样本 ID(SDS-####)category— 主要类别language— 片段语言code_text— 原始代码/配置(模型输入)sensitive_count— 标注的密钥数量finding_types— 密钥类型,以|连接(CSV)sensitive_findings— ground-truth 列表(仅 JSON)
预期用途
- 密钥 / PII 检测基准测试
- 本地掩码及反向掩码评估
- LLM 中的提示 / 代码泄漏实验
附加说明
- 完全合成,可通过
seed=42复现 - 每个样本平均约含 1.29 个密钥
- OWASP 对齐在数据集级别(LLM02),无逐行 OWASP 列
- 非生产环境漏洞语料库
- 引用请参考 Nisa Nur Efendioğlu 的相关论文/学位论文工作




