question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is that possible to define a rule at runtime to consider all IPs for a specific Endpoint?

See original GitHub issue

I want to define a rule at runtime to consider all IPs and a specific Endpoint.I mean something like putting * for IP. How can I do that?

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
djarviscommented, Sep 23, 2019

After peeking at the source I was able to get by with what I needed by using the client rate limit policy instead of the IP one and naming the Client Id rule “anon”:

    "ClientRateLimitPolicies": {
    "ClientRules": [

      {
        "ClientId": "anon",
        "Rules": [
          {
            "Endpoint": "*",
            "Period": "1m",
            "Limit": 10
          }
        ]
      }

    ]
  }

Then I am able to update the one rule at runtime and it affects all clients globally without having any ClientId header.

        public async Task PutRateLimit([FromBody] RateLimitRule rule)
        {
            var p = new ClientRateLimitPolicy()
            {
                ClientId = "*",
                Rules = new List<RateLimitRule> { rule }
            };
            await _clientPolicyStore.SetAsync(_rateLimitOptions.CurrentValue.ClientPolicyPrefix + "_anon", p);
            
        }
1reaction
cristipufucommented, Sep 23, 2019

Guys this is an open source repository. Feel free to contribute

Read more comments on GitHub >

github_iconTop Results From Across the Web

Azure Integration Runtime IP addresses - Azure Data Factory
In this article. Azure Integration Runtime IP addresses: Specific regions; Known issue with Azure Storage; Next steps. APPLIES TO: Azure Data ...
Read more >
Configure IP firewall rules for Azure SQL Databases
By default, once we create a new Azure logical SQL Server, the server-level firewall blocks all connections to the public endpoint.
Read more >
AccessControl policy | Apigee Edge
The Access Control policy lets you allow or deny access to your APIs by specific IP addresses. Video: Watch a short video to...
Read more >
Ports, IP Addresses, and Hostnames to Allow
These tables show you the ports or IP addresses and hostnames to add to your allowlists to allow communication between the agent and...
Read more >
Create a detection rule | Elastic Security Solution [8.9]
Issue an error stating the machine learning job was not running when the rule executed. Threshold: Searches the defined indices and creates a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found