• Stars
    star
    770
  • Rank 59,000 (Top 2 %)
  • Language
    Go
  • License
    MIT License
  • Created about 3 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

sensitive information protection toolkit

godlp

一、简介

为了保障企业的数据安全和隐私安全,godlp 提供了一系列针对敏感数据的识别和处置方案, 其中包括敏感数据识别算法,数据脱敏处理方式,业务自定义的配置选项和海量数据处理能力。 godlp 能够应用多种隐私合规标准,对原始数据进行分级打标、判断敏感级别和实施相应的脱敏处理。

In order to achieve data security and privacy security requirements for enterprises, godlp provides a serial of sensitive information finding and handling methods, including sensitive detection algorithm, de-identification APIs, business DIY configuration and the big data handling ability. Also, godlp is able to apply a variety of privacy compliance standers, do classification based on sensitive levels, and mask data based on rules.

二、关键能力

godlp 能够广泛支持结构化(JSON数据、KV数据、golang map)和非结构化数据(多语言字符串)。

1. 敏感数据自动发现

DLP 内置多种敏感数据识别规则,能对原始数据进行敏感类型识别,确保敏感信息能被妥善处理。

2. 敏感数据脱敏处理

DLP 支持多种脱敏算法,业务可以根据需求对敏感数据进行不同的脱敏处理。

3. 业务自定义配置选项

除默认的敏感信息识别和处理规则外,业务可以根据实际情况,配置自定义的YAML规则,DLP 能够根据传入的配置选项,完成相应的数据处理任务。

三、接入方式

go get github.com/bytedance/godlp@latest

示例代码在 mainrun/mainrun.go 文件中

在godlp代码根目录下输入以下命令可以进行编译和运行

make
make run
make test
make bench

API 描述

dlpheader定义了 godlp SDK需要的数据结构,常量定义等。godlp SDK主要提供了以下API进行敏感信息识别和脱敏。

  1. ApplyConfig(conf string) error
  • ApplyConfig by configuration content
  • 传入conf string 进行配置
  1. ApplyConfigFile(filePath string) error
  • ApplyConfigFile by config file path
  • 传入filePath 进行配置
  1. Detect(inputText string) ([]*DetectResult, error)
  • Detect string
  • 对string进行敏感信息识别
  1. DetectMap(inputMap map[string]string) ([]*DetectResult, error)
  • DetectMap detects KV map
  • 对map[string]string进行敏感信息识别
  1. DetectJSON(jsonText string) ([]*DetectResult, error)
  • DetectJSON detects json string
  • 对json string 进行敏感信息识别
  1. Deidentify(inputText string) (string, []*DetectResult, error)
  • Deidentify detects string firstly, then return masked string and results
  • 对string先识别,然后按规则进行打码
  1. DeidentifyMap(inputMap map[string]string) (map[string]string, []*DetectResult, error)
  • DeidentifyMap detects KV map firstly,then return masked map
  • 对map[string]string先识别,然后按规则进行打码
  1. ShowResults(resultArray []*DetectResult)
  • ShowResults print results in console
  • 打印识别结果
  1. Mask(inputText string, methodName string) (string, error)
  • Mask inputText following predefined method of MaskRules in config
  • 根据脱敏规则直接脱敏
  1. Close()
  • Close engine object, release memory of inner object
  • 关闭,释放内部变量
  1. GetVersion() string
  • Get Dlp SDK version string
  • 获取版本号
  1. RegisterMasker(maskName string, maskFunc func(string) (string, error)) error
  • Register DIY Masker
  • 注册自定义打码函数
  1. NewLogProcesser() logs.Processor
  • NewLogProcesser create a log processer for the package logs
  • 日志脱敏处理函数
  1. MaskStruct(inObj interface{}) (interface{}, error)
  • MaskStruct will mask a strcut object by tag mask info
  • 根据tag mask里定义的脱敏规则对struct object直接脱敏

四、规则文件

规则文件请见 conf.yml

config 文件以yaml格式为准,整体分为: Global,MaskRules,Rules 三个部分。其中:

  1. Global 包含影响DLP全局的一些配置项,例如API版本、禁用的规则ID、是否启用后端服务辅助判断。
  2. MaskRules 包含脱敏操作的配置,例如打码、替换等方式。
  3. Rules 包含识别和处理规则,其中一个识别过程包括 Detect, Filter 和 Verify 三个依次的过程, 处理需要引用上面定义的脱敏规则。

五、架构

godlp 以 Engine 结构为主,通过Engine对象来实现 EngineAPI 接口,直接实现的接口以sdk.go,sdkdeidentify.go,sdkdetect.gosdkmask.go为主。对于deidentify和mask操作,会继续调用子目录下的detector,mask子模块。

5.1 文件说明

  1. sdk.go: 实现EngineAPI接口中业务无关的API,例如Close()

  2. sdk_test.go: 单元测试用例。

  3. sdkconfig.go: 实现配置相关的接口,例如ApplyConfig()

  4. sdkdeidentify.go: 实现脱敏相关的接口。

  5. sdkdetect.go: 实现敏感信息检测接口。

  6. sdkinternal.go: 实现 Engine 对象的内部函数。

  7. sdkmask.go: 实现直接打码的接口。

  8. conf.yml: 内置的默认配置文件,含DLP维护的规则。

  9. bindata.go: go generate生成的数据文件,包含conf.yml

5.2 子目录说明

  1. conf: 实现DlpConf结构,处理配置文件。

  2. detector: 敏感信息检测逻辑的内部实现。

  3. errlist: 报错信息列表。

  4. mask: 直接脱敏的内部实现。

  5. util: 辅助功能实现。

  6. dlpheader: dlp sdk 定义的接口头文件。

六、致谢

DLP项目从立项开始,一路走来,离不开其中辛苦付出的开发同学们,这里向为DLP写下代码的同学,致以最诚挚的感谢,以下同学排名不分先后。

  • 丁保增 负责DLP1.0 识别信息验证模块。
  • 王聪 负责DLP1.0 官网、JSON识别处理等模块、多个项目接入。
  • 王赛 负责DLP1.0 去标识模块。
  • 苏宁宁 负责DLP1.0 性能准确率测试。
  • 王帅 负责DLP1.0 API头文件。
  • 鲁云飞 负责DLP1.0 AI模块、NLP服务。
  • 石岚 负责DLP1.0 AI模块,大数据处理API模块,发版等。
  • 黄勇辉 负责DLP1.0 AI模块,优化更新了大量规则。
  • 张宇鹏 参与DLP1.0 AI模块。
  • 李赛南 参与DLP1.0 AI模块。
  • 王珩 负责DLP1.0 保格式加密、保顺序加密模块。
  • 夏世文 负责DLP1.0 性能优化、规则代码实现、主要完成了多个项目的合作开发工作。
  • 罗同龙 为DLP2.0 提交了log处理性能优化的PR。
  • 乔鑫 负责DLP2.0 服务端代码、SDK性能优化、技术实现。
  • 杨经宇 负责DLP1.0 和 2.0的整体项目。

More Repositories

1

IconPark

🍎Transform an SVG icon into multiple themes, and generate React icons,Vue icons,svg icons
TypeScript
8,298
star
2

xgplayer

A HTML5 video player with a parser that saves traffic
JavaScript
8,260
star
3

sonic

A blazingly fast JSON serializing & deserializing library
Assembly
6,870
star
4

monoio

Rust async runtime based on io-uring.
Rust
3,864
star
5

byteps

A high performance and generic framework for distributed DNN training
Python
3,603
star
6

lightseq

LightSeq: A High Performance Library for Sequence Processing and Generation
C++
3,193
star
7

ByteX

ByteX is a bytecode plugin platform based on Android Gradle Transform API and ASM. 字节码插件开发平台
Java
2,865
star
8

Elkeid

Elkeid is an open source solution that can meet the security requirements of various workloads such as hosts, containers and K8s, and serverless. It is derived from ByteDance's internal best practices.
Go
2,226
star
9

AlphaPlayer

AlphaPlayer is a video animation engine.
Java
2,181
star
10

scene

Android Single Activity Framework compatible with Fragment.
Java
2,097
star
11

bhook

🔥 ByteHook is an Android PLT hook library which supports armeabi-v7a, arm64-v8a, x86 and x86_64.
C
2,073
star
12

flutter_ume

UME is an in-app debug kits platform for Flutter. Produced by Flutter Infra team of ByteDance
Dart
2,053
star
13

terarkdb

A RocksDB compatible KV storage engine with better performance
C++
2,044
star
14

btrace

🔥🔥 btrace(AKA RheaTrace) is a high performance Android trace tool which is based on Perfetto, it support to define custom events automatically during building apk and using bhook to provider more native events like Render/Binder/IO etc.
Kotlin
1,913
star
15

gopkg

Universal Utilities for Go
Go
1,704
star
16

android-inline-hook

🔥 ShadowHook is an Android inline hook library which supports thumb, arm32 and arm64.
C
1,660
star
17

bitsail

BitSail is a distributed high-performance data integration engine which supports batch, streaming and incremental scenarios. BitSail is widely used to synchronize hundreds of trillions of data every day.
Java
1,627
star
18

go-tagexpr

An interesting go struct tag expression syntax for field validation, etc.
Go
1,470
star
19

GiantMIDI-Piano

Python
1,431
star
20

appshark

Appshark is a static taint analysis platform to scan vulnerabilities in an Android app.
Kotlin
1,363
star
21

AabResGuard

The tool of obfuscated aab resources.(Android app bundle资源混淆工具)
Java
1,307
star
22

piano_transcription

Python
1,247
star
23

CodeLocator

Kotlin
1,163
star
24

BoostMultiDex

BoostMultiDex is a solution for quickly loading multiple dex files on low Android version devices (4.X and below, SDK <21).
Java
1,106
star
25

music_source_separation

Python
1,039
star
26

Fastbot_Android

Fastbot(2.0) is a model-based testing tool for modeling GUI transitions to discover app stability problems
C++
1,031
star
27

SALMONN

SALMONN: Speech Audio Language Music Open Neural Network
Python
1,000
star
28

memory-leak-detector

C
919
star
29

fedlearner

A multi-party collaborative machine learning framework
Python
892
star
30

monolith

ByteDance's Recommendation System
Python
844
star
31

sonic-cpp

A fast JSON serializing & deserializing library, accelerated by SIMD.
C++
811
star
32

MVDream

Multi-view Diffusion for 3D Generation
Python
744
star
33

res-adapter

Official implementation of "ResAdapter: Domain Consistent Resolution Adapter for Diffusion Models".
Python
724
star
34

bytemd

ByteMD v1 repository
TypeScript
679
star
35

tailor

C
669
star
36

ibot

iBOT 🤖: Image BERT Pre-Training with Online Tokenizer (ICLR 2022)
Jupyter Notebook
663
star
37

RealRichText

A Tricky Solution for Implementing Inline-Image-In-Text Feature in Flutter.
Dart
658
star
38

guide

A new feature guide component by react 🧭
TypeScript
651
star
39

mockey

a simple and easy-to-use golang mock library
Go
622
star
40

magic-microservices

Make Web Components easier and powerful!😘
TypeScript
570
star
41

Fastbot_iOS

About Fastbot(2.0) is a model-based testing tool for modeling GUI transitions to discover app stability problems
Objective-C
553
star
42

flow-builder

A highly customizable streaming flow builder.
TypeScript
526
star
43

MVDream-threestudio

3D generation code for MVDream
Python
473
star
44

effective_transformer

Running BERT without Padding
C++
457
star
45

ByteTransformer

optimized BERT transformer inference on NVIDIA GPU. https://arxiv.org/abs/2210.03052
C++
449
star
46

Next-ViT

Python
426
star
47

matxscript

A high-performance, extensible Python AOT compiler.
C++
408
star
48

byteir

A model compilation solution for various hardware
MLIR
362
star
49

syllepsis

Syllepsis is an out-of-the-box rich text editor.
TypeScript
355
star
50

uss

This is the PyTorch implementation of the Universal Source Separation with Weakly labelled Data.
Python
324
star
51

OMGD

Online Multi-Granularity Distillation for GAN Compression (ICCV2021)
Python
323
star
52

neurst

Neural end-to-end Speech Translation Toolkit
Python
298
star
53

danmu.js

HTML5 danmu (danmaku) plugin for any DOM element
JavaScript
292
star
54

vArmor

vArmor is a cloud native container sandbox system based on AppArmor/BPF/Seccomp. It also includes multiple built-in protection rules that are ready to use out of the box.
Go
263
star
55

particle-sfm

ParticleSfM: Exploiting Dense Point Trajectories for Localizing Moving Cameras in the Wild. ECCV 2022.
C++
263
star
56

CloudShuffleService

Cloud Shuffle Service(CSS) is a general purpose remote shuffle solution for compute engines, including Spark/Flink/MapReduce.
Java
245
star
57

lynx-llm

paper: https://arxiv.org/abs/2307.02469 page: https://lynx-llm.github.io/
Python
227
star
58

g3

Enterprise-oriented Generic Proxy Solutions
Rust
227
star
59

xgplayer-vue

Vue component for xgplayer, a HTML5 video player with a parser that saves traffic
JavaScript
219
star
60

DEADiff

[CVPR 2024] Official implementation of "DEADiff: An Efficient Stylization Diffusion Model with Disentangled Representations"
Python
209
star
61

flux

A fast communication-overlapping library for tensor parallelism on GPUs.
C++
201
star
62

trace-irqoff

Interrupts-off or softirqs-off latency tracer
C
195
star
63

ParaGen

ParaGen is a PyTorch deep learning framework for parallel sequence generation.
Python
186
star
64

ByteMLPerf

AI Accelerator Benchmark focuses on evaluating AI Accelerators from a practical production perspective, including the ease of use and versatility of software and hardware.
Python
181
star
65

MoMA

MoMA: Multimodal LLM Adapter for Fast Personalized Image Generation
Jupyter Notebook
177
star
66

AWERTL

An non-invasive iOS framework for quickly adapting Right-To-Left style UI
Objective-C
175
star
67

Bytedance-UnionAD

Ruby
170
star
68

keyhouse

Keyhouse is a skeleton of general-purpose Key Management System written in Rust.
Rust
163
star
69

react-model

The next generation state management library for React
TypeScript
162
star
70

LargeBatchCTR

Large batch training of CTR models based on DeepCTR with CowClip.
Python
162
star
71

ic_flow_platform

IFP (ic flow platform) is an integrated circuit design flow platform, mainly used for IC process specification management and data flow contral.
Python
154
star
72

DanmakuRenderEngine

DanmakuRenderEngine is a lightweight and scalable Android danmaku library. 轻量级高扩展安卓弹幕渲染引擎
Kotlin
149
star
73

primus

Java
148
star
74

diat

A CLI tool to help with diagnosing Node.js processes basing on inspector.
JavaScript
146
star
75

coconut_cvpr2024

Jupyter Notebook
143
star
76

Hammer

An efficient toolkit for training deep models.
Python
138
star
77

ns-x

An easy-to-use, flexible network simulator library in Go.
Go
116
star
78

pv3d

Python
113
star
79

fc-clip

This repo contains the code for our paper Convolutions Die Hard: Open-Vocabulary Segmentation with Single Frozen Convolutional CLIP
Python
109
star
80

RLFN

Winner of runtime track in NTIRE 2022 challenge on Efficient Super-Resolution
Python
106
star
81

DCFrame

DCFrame is a Swift UI collection framework, which can easily create complex UI.
Swift
100
star
82

trace-noschedule

Trace noschedule thread
C
99
star
83

decoupleQ

A quantization algorithm for LLM
Cuda
99
star
84

tar-wasm

A faster experimental wasm-based tar implementation for browsers.
Rust
95
star
85

TWIST

Official codes: Self-Supervised Learning by Estimating Twin Class Distribution
Python
95
star
86

magic-portal

⚡ A blazing fast micro-component and micro-frontend solution uses web-components under the hood.
TypeScript
91
star
87

xgplayer-react

React component for xgplayer, a HTML5 video player with a parser that saves traffic
JavaScript
84
star
88

fe-foundation

UI Foundation for React Hooks and Vue Composition Api
TypeScript
80
star
89

nnproxy

Scalable NameNode RPC Proxy for HDFS Federation
Java
79
star
90

dbatman

Go
74
star
91

Elkeid-HUB

Elkeid HUB is a rule/event processing engine maintained by the Elkeid Team that supports streaming/offline (not yet supported by the community edition) data processing. The original intention is to solve complex data/event processing and external system linkage requirements through standardized rules.
Python
74
star
92

FreeSeg

Python
69
star
93

pull_to_refresh

Flutter pull_to_refresh widget
Dart
67
star
94

Jeddak-DPSQL

DPSQL (Privacy Protection SQL Query Service) - This project is a microservice Middleware located between the database engine ( Hive , Clickhouse , etc.) and the application system. It provides transparent SQL query result desensitization capabilities.
Python
62
star
95

terark-zip

A data structure and algorithm library built for TerarkDB
C++
62
star
96

trace-runqlat

C
61
star
97

ipmb

An interprocess message bus system built in Rust.
Rust
60
star
98

X-Portrait

Source code for the SIGGRAPH 2024 paper "X-Portrait: Expressive Portrait Animation with Hierarchical Motion Attention"
Python
59
star
99

kernel

ByteDance kernel for use on cloud.
C
57
star
100

scroll_kit

Dart
56
star