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

Allow or block requests by IP address #38

Open
Kaliumhexacyanoferrat opened this issue Nov 28, 2019 · 0 comments
Open

Allow or block requests by IP address #38

Kaliumhexacyanoferrat opened this issue Nov 28, 2019 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Kaliumhexacyanoferrat
Copy link
Owner

Kaliumhexacyanoferrat commented Nov 28, 2019

As the operator of a web application, I would like to restrict access to a known set of IP addresses so that unauthorized access is blocked.

Example

var content = Layout.Create(...);

var response = Content.From(Resource.FromString("Don't you dare"));

var access = Access.Create()
                   .Rule(AccessRule.BlockIP("91.8.20.0", response))
                   .Rule(AccessRule.BlockIPs(...))
                   .Rule(AccessRule.AllowIP(...));

content.Add(access);

Acceptance criteria

  • The functionality is implemented as a concern in the security module
  • Requests can be blocked (blacklist) or allowed (whitelist) by IP address (or range)
  • The handler returns the given content alongside with a AccessDenied status code if the request is blocked
  • If no content is given, a default error page is rendered to inform the user
  • The framework is open for additional access rules in the future (e.g. geoblocking, behavior-based, ...)
  • Acceptance tests are written for this functionality
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat added enhancement New feature or request good first issue Good for newcomers labels Nov 28, 2019
@Kaliumhexacyanoferrat Kaliumhexacyanoferrat changed the title Allow or block requests by IP and/or region Allow or block requests by IP address Nov 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant