File tree Expand file tree Collapse file tree
agent_api/src/main/java/dev/aikido/agent_api/storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99import java .util .ArrayList ;
1010import java .util .HashSet ;
1111import java .util .List ;
12- import java .util .regex .Pattern ;
1312
1413import static dev .aikido .agent_api .helpers .IPListBuilder .createIPList ;
1514import static dev .aikido .agent_api .vulnerabilities .ssrf .IsPrivateIP .isPrivateIp ;
@@ -94,7 +93,7 @@ public BlockedResult isIpBlocked(String ip) {
9493 }
9594
9695 // Check for blocked ip addresses
97- for (ParsedFirewallLists .Match match : firewallLists .matchBlockedIps (ip )) {
96+ for (ParsedFirewallLists .Match match : firewallLists .matchBlockedIps (ip )) {
9897 // when a blocking match is found, set blocked result if it hasn't been set already.
9998 if (match .block () && !blockedResult .blocked ()) {
10099 blockedResult = new BlockedResult (true , match .description ());
@@ -113,9 +112,10 @@ public void updateBlockedLists(ReportingApi.APIListsResponse res) {
113112 */
114113 public boolean isBlockedUserAgent (String userAgent ) {
115114 boolean blocked = false ;
116- for (ParsedFirewallLists .Match match : this .firewallLists .matchBlockedUserAgents (userAgent )) {
115+ for (ParsedFirewallLists .Match match : this .firewallLists .matchBlockedUserAgents (userAgent )) {
117116 if (match .block ()) {
118117 blocked = true ;
118+ break ;
119119 }
120120 }
121121
You can’t perform that action at this time.
0 commit comments