primait/veil
primait/veil has 51 GitHub stars and 4 forks. GitHot measured 0 in 7 days. Last checked 2026-11-10 21:13 UTC. Last push 2026-11-02.
Rust derive macro for redacting sensitive data in std::fmt::Debug
측정된 스타 증가
- in 24h
- 업데이트 지연
- in 7 days
- 0
- in 15 days
- 기록 수집 중
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalA derive macro that implements std::fmt::Debug for a struct or enum variant, with certain fields redacted.
The purpose of this macro is to allow for easy, configurable and efficient redaction of sensitive data in structs and enum variants. This can be used to hide sensitive data in logs or anywhere where personal data should not be exposed or stored.
Usage
Add to your Cargo.toml:
[dependencies]
veil = "0.3.0"
Usage documentation can be found here.
Example
The example is explained in detail here.
#[derive(Redact)]
struct CreditCard {
#[redact(partial)]
number: String,
#[redact]
expiry: String,
#[redact(fixed = 3)]
cvv: String,
#[redact(partial)]
cardholder_name: String,
}
#[derive(Redact)]
#[redact(all, variant)]
enum CreditCardIssuer {
MasterCard,
Visa,
AmericanExpress,
}
#[derive(Redact)]
#[redact(all, partial)]
struct Vehicle {
license_plate: String,
make: String,
model: String,
color: String,
}
#[derive(Debug)]
struct Policy {
id: Uuid,
name: String,
description: String,
}
#[derive(Redact)]
enum InsuranceStatus {
#[redact(all, partial)]
Insured {
#[redact(fixed = 12)]
policy: Policy,
policy_started: String,
policy_expires: String,
#[redact(skip)]
payment_card: CreditCard,
#[redact(skip)]
vehicles: Vec<Vehicle>,
},
Uninsured {
policies_available: Vec<Policy>,
},
}
Environmental Awareness
In testing environments it may be useful to disable redaction entirely. You can globally disable Veil's redaction behavior at runtime by enabling the non-default feature flag toggle and:
- Setting the
VEIL_DISABLE_REDACTIONenvironment variable to "1", "true" or "on" (case insensitive).
OR
- Calling the
veil::disablefunction. See this example.
These are only checked ONCE for security purposes.
관련 프로젝트 살펴보기
trimstray/the-book-of-secret-knowledge
영감을 주는 목록, 매뉴얼, 치트시트, 블로그, 팁, 원라이너, CLI/웹 도구 등을 모은 컬렉션.
257,462 스타Hack-with-Github/Awesome-Hacking
해커, 펜테스터, 보안 연구자를 위한 다양한 Awesome 목록 모음.
125,103 스타swisskyrepo/PayloadsAllTheThings
웹 애플리케이션 보안과 모의 침투 테스트/CTF에 유용한 페이로드 및 우회 방법 목록.
82,542 스타caddyserver/caddy
빠르고 확장 가능한 멀티플랫폼 HTTP/1-2-3 웹 서버이며, 자동 HTTPS를 지원합니다
78,935 스타