diff --git a/libdd-trace-obfuscation/src/ip_address.rs b/libdd-trace-obfuscation/src/ip_address.rs index fa627f4998..94084bbdc5 100644 --- a/libdd-trace-obfuscation/src/ip_address.rs +++ b/libdd-trace-obfuscation/src/ip_address.rs @@ -4,13 +4,15 @@ use regex::Regex; use std::{borrow::Cow, collections::HashSet, net::Ipv6Addr, sync::LazyLock}; -const ALLOWED_IP_ADDRESSES: [&str; 4] = [ +const ALLOWED_IP_ADDRESSES: [&str; 5] = [ // localhost "127.0.0.1", "::1", // link-local cloud provider metadata server addresses "169.254.169.254", "fd00:ec2::254", + // ECS task metadata + "169.254.170.2", ]; const PREFIX_REGEX_LITERAL: &str = r"^((?:dnspoll|ftp|file|http|https):/{2,3})"; @@ -195,6 +197,7 @@ mod tests { quantize_peer_ip_addresses("169.254.169.254"), "169.254.169.254" ); + assert_eq!(quantize_peer_ip_addresses("169.254.170.2"), "169.254.170.2"); // blocking cases assert_eq!(quantize_peer_ip_addresses(""), ""); assert_eq!(quantize_peer_ip_addresses("foo.dog"), "foo.dog");