pub enum PolicyConfigOptions {
None,
InternalOnly,
ExternalOnlyV1,
ExternalOnlyLatest,
}Expand description
Preset blocking strategies used when constructing an AntiSSRFPolicy.
These options configure sensible defaults. You can further customize the
policy after creation via AntiSSRFPolicy methods.
Variants§
None
No restrictions. All IP addresses, protocols, and headers are allowed.
Use this variant when you intend to configure every rule manually or when you only need the library for CIDR parsing and domain validation.
InternalOnly
Block all external IPs unless explicitly allowlisted.
Sets deny_all_unspecified_ips
to true. Any IP address that is not in the allowlist is denied.
This is suitable for services that should only talk to a known set of
internal or partner endpoints.
ExternalOnlyV1
Block known dangerous IP ranges (V1 list).
Populates the denylist with crate::ip_address_ranges::RECOMMENDEDV1,
which includes:
- Azure IMDS (
169.254.169.254/32) - Azure WireServer (
168.63.129.16/32) - Loopback, link-local, multicast, RFC 1918 private ranges, CGNAT, and more
Also enables add_xff_header.
External public IPs (e.g. 8.8.8.8) remain allowed.
ExternalOnlyLatest
Alias for ExternalOnlyV1.
Reserved for forward compatibility. When a future version introduces a new recommended blocklist, this variant will automatically map to it.
Trait Implementations§
Source§impl Clone for PolicyConfigOptions
impl Clone for PolicyConfigOptions
Source§fn clone(&self) -> PolicyConfigOptions
fn clone(&self) -> PolicyConfigOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PolicyConfigOptions
Source§impl Debug for PolicyConfigOptions
impl Debug for PolicyConfigOptions
impl Eq for PolicyConfigOptions
Source§impl PartialEq for PolicyConfigOptions
impl PartialEq for PolicyConfigOptions
Source§fn eq(&self, other: &PolicyConfigOptions) -> bool
fn eq(&self, other: &PolicyConfigOptions) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for PolicyConfigOptions
Auto Trait Implementations§
impl Freeze for PolicyConfigOptions
impl RefUnwindSafe for PolicyConfigOptions
impl Send for PolicyConfigOptions
impl Sync for PolicyConfigOptions
impl Unpin for PolicyConfigOptions
impl UnsafeUnpin for PolicyConfigOptions
impl UnwindSafe for PolicyConfigOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.