H: deny IPv6 link-local and metadata addresses by default Add fe80::/10, ::/128 and fd00:ec2::254/128 to the default deny_cidrs and sync config.example.toml, README and docs/consolidator.md
This commit is contained in:
1 parent
6e74d3d99b
commit
97c81f899c
6 files changed
+54
-5
No files matched your search
+22
-2
@@ -141,6 +141,17 @@ pub struct PeersConfig {
|
||||
pub peer: Vec<PeerConfig>,
|
||||
}
|
||||
|
||||
/// Refused by default: link-local and cloud metadata addresses in both
|
||||
/// families, plus the unspecified address. Private LAN ranges stay allowed,
|
||||
/// since that is where peers live.
|
||||
pub const DEFAULT_DENY_CIDRS: [&str; 5] = [
|
||||
"169.254.0.0/16",
|
||||
"0.0.0.0/8",
|
||||
"fe80::/10",
|
||||
"::/128",
|
||||
"fd00:ec2::254/128",
|
||||
];
|
||||
|
||||
impl Default for PeersConfig {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
@@ -154,7 +165,7 @@ impl Default for PeersConfig {
|
||||
max_response_bytes: 8 * 1024 * 1024,
|
||||
max_concurrent_per_peer: 4,
|
||||
max_concurrent_total: 16,
|
||||
deny_cidrs: vec!["169.254.0.0/16".into(), "0.0.0.0/8".into()],
|
||||
deny_cidrs: DEFAULT_DENY_CIDRS.iter().map(|c| c.to_string()).collect(),
|
||||
peer: Vec::new(),
|
||||
}
|
||||
}
|
||||
@@ -290,7 +301,16 @@ mod tests {
|
||||
assert_eq!(c.tcp_interval_secs, 10);
|
||||
assert_eq!(c.request_timeout_secs, 10);
|
||||
assert_eq!(c.max_response_bytes, 8 * 1024 * 1024);
|
||||
assert_eq!(c.deny_cidrs, vec!["169.254.0.0/16", "0.0.0.0/8"]);
|
||||
assert_eq!(
|
||||
c.deny_cidrs,
|
||||
vec![
|
||||
"169.254.0.0/16",
|
||||
"0.0.0.0/8",
|
||||
"fe80::/10",
|
||||
"::/128",
|
||||
"fd00:ec2::254/128",
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user