Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for retrieving the IP address from the X-Forwarded-For header, for Access/Rate Limit rules #1488

Merged
merged 2 commits into from
Feb 11, 2025

Conversation

Badgerati
Copy link
Owner

Description of the Change

Adds support to New-PodeLimitIPComponent so it can can retrieve the IP address from the X-Forwarded-For header - useful for IIS, or any other proxy you're site might be running behind.

You'll need to specify -Location 'XForwardedFor', otherwise it'll use the Remote Address IP by default.

When using the XFF header, Pode will use the leftmost IP by default - typically the originating client IP. You can also specify the rightmost, or all IPs, if required.

Related Issue

Resolves #1375

Examples

Add-PodeLimitAccessRule -Name 'Example' -Action Deny -Component @(
    New-PodeLimitIPComponent -IP '10.0.1.0/16' -Location 'XForwardedFor'
)

@Badgerati Badgerati added this to the 2.12.0 milestone Feb 11, 2025
@Badgerati Badgerati self-assigned this Feb 11, 2025
@Badgerati Badgerati merged commit a236a1a into develop Feb 11, 2025
17 checks passed
@Badgerati Badgerati deleted the ISsue-1375 branch February 11, 2025 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use of Add-PodeAccessRule together with IIS
1 participant