Repository navigation
Expand file tree
/
Copy pathbuild.rs
More file actions
49 lines (48 loc) · 2.79 KB
/
Copy pathbuild.rs
File metadata and controls
49 lines (48 loc) · 2.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
//! Build-time safety warnings for feature combinations that deserve attention.
fn main() {
if std::env::var_os("CARGO_FEATURE_ALLOW_SHA1_ACKNOWLEDGED").is_some() {
println!(
"cargo:warning=Legacy SHA-1 cryptographic selectors are enabled, including Transit and PKCS#11 OAEP. Prefer SHA-256 or stronger."
);
}
if std::env::var_os("CARGO_FEATURE_TLS12_ACKNOWLEDGED").is_some() {
println!(
"cargo:warning=TLS 1.2 support has been acknowledged. TLS 1.3 remains the default and is strongly preferred for high-security OpenBao deployments."
);
}
if std::env::var_os("CARGO_FEATURE_SENSITIVE_HTTP_TEST_ONLY").is_some() {
println!(
"cargo:warning=DANGER: sensitive-http-test-only disables HTTPS enforcement for sensitive loopback requests. Never include this feature in production builds."
);
}
if std::env::var_os("CARGO_FEATURE_MEMORY_LOCK").is_some() {
println!(
"cargo:warning=memory-lock makes authenticated Client token construction fail closed unless sanitization establishes OS-locked mapped storage with random corruption-detection canaries. Canaries are not an attacker-resistant integrity boundary. Other SecretString/SecretVec values and HTTP/TLS/kernel buffers are not automatically locked; verify custody transfers, host limits, swap policy, and failure handling."
);
}
if std::env::var_os("CARGO_FEATURE_OIDC_GET_CALLBACK_ACKNOWLEDGED").is_some() {
println!(
"cargo:warning=OIDC GET protocol support is enabled. Credentials or correlation values enter URL and HTTP-stack buffers; enforce query-free access logging."
);
}
if std::env::var_os("CARGO_FEATURE_IDENTITY_TEMPLATE_OVERRIDES_ACKNOWLEDGED").is_some() {
println!(
"cargo:warning=DANGER: OpenBao identity-template delimiter overrides are enabled. Only use trusted identity metadata and separately audit ACL paths, PKI names, and SSH principals."
);
}
if std::env::var_os("CARGO_FEATURE_WORKFLOW_TRACE").is_some() {
println!(
"cargo:warning=DANGER: workflow-trace can return the OpenBao token and complete intermediate workflow values. Never log trace responses."
);
}
if std::env::var_os("CARGO_FEATURE_UNAUTHENTICATED_WORKFLOWS").is_some() {
println!(
"cargo:warning=Unauthenticated workflow execution is enabled. Audit server configuration, every exposed workflow, and rate limiting before deployment."
);
}
if std::env::var_os("CARGO_FEATURE_DEV_BOOTSTRAP").is_some() {
println!(
"cargo:warning=DANGER: dev-bootstrap can initialize an uninitialized OpenBao server reached through a loopback tunnel or proxy. Use only with disposable development instances."
);
}
}