You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/3-ssdlc.livemd
+31-1
Original file line number
Diff line number
Diff line change
@@ -57,14 +57,40 @@ Additionally, thought can be put into how you architect data flows with regards
57
57
58
58
### Description
59
59
60
-
Rate limiting restricts the number of requests that can be allowed in a certain time frame on a specific resource. Rate limiting can be implemented to protect against a variety of attacks or abuses:
60
+
While performing their designed operations, applications send traffic across networks, make client requests, generate server responses, and consume processing and memory capacity from the computing machines on which they are hosted. They often have components, like APIs that interact with data sources and services. Modern applications have a lot of things happening.
61
+
62
+
When building an application, it is necessary to consider approaches to manage the access and use of all relevant internal and external resources involved in the context of the application. This will help ensure the continued availablilty of the application and it's functionality for all legitimate users and entities. This is particularly important for applications that run critical infrastructure and other key services organizations rely on for business operations.
63
+
64
+
When resources are not well managed, applications become vulnerable to negative impacts in performance, unintentional service failures, and denial of service attacks, in which a malicious actor takes advantage of resource limitations to intentionally overwhelm and crash a system.
65
+
66
+
Implementing rate limiting is one security best practice that can help mitigate the ability of unlimited, undefined, or uncontrolled application input, to intentionally or inadvertently exahaust vital resources across all levels of application's context.
67
+
68
+
### Implementation Approaches
69
+
There are multiple approaches to implementing rate limiting within an application and in general the approach is based on at least one of the following problematic scenarios:
70
+
71
+
* Malicious actor-generated abusive traffic designed to force the application into a compromised state
72
+
* Malicious or legitimate users perform large load activites that requires significant processing power
73
+
* Malicious or legitimate users sending large number of queries, often repeatedly to the service
74
+
* Malicious or legitimate users sending large number of queries in a narrow timeframe
75
+
76
+
Rate limiting can be implemented to protect against a variety of attacks or abuses:
61
77
62
78
* Preventing Denial Of Service attacks (limiting the number of calls to expensive endpoints)
63
79
* Limiting brute force attempts (such as on one time codes and passwords)
64
80
* Programmatic abuse of services
65
81
66
82
### Prevention
67
83
84
+
Per OWASP, consider limits on the following (please see Rate Limiting References below):
85
+
86
+
* Execution timeouts
87
+
* Max allocable memory
88
+
* Number of file descriptors
89
+
* Number of processes
90
+
* Request payload size (e.g., uploads)
91
+
* Number of requests per client/resource
92
+
* Number of records per page to return in a single request response
93
+
68
94
When rate limiting a new action, begin by asking these questions:
69
95
70
96
* "What are the maximum number of calls to my action that a reasonable non-malicious user would feasibly make in a given time period?"
@@ -75,6 +101,10 @@ If the answer to one or more of those questions is yes, consider putting a limit
75
101
76
102
More often than not, rate limiting should be as specific as possible. For instance, it is better to add rate limiting on a single GraphQL type than to add a generic limit to the entire /GraphQL endpoint.
Sometimes known as the Principle of Minimal Privilege or the Principle of Least Authority, the Principle of Least Privilege (PoLP) means that every entity* is only strictly given the essential privileges needed to perform its requirement.
0 commit comments