Skip to content

Commit 1a90bd8

Browse files
Merge pull request #108 from AikidoSec/rename-to-aikido-block
Rename AIKIDO_BLOCKING to AIKIDO_BLOCK
2 parents 16ad60b + ba5ad50 commit 1a90bd8

File tree

29 files changed

+101
-101
lines changed

29 files changed

+101
-101
lines changed

agent_api/src/main/java/dev/aikido/agent_api/helpers/env/BlockingEnv.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package dev.aikido.agent_api.helpers.env;
22

33
public class BlockingEnv extends BooleanEnv {
4-
private static final String environmentName = "AIKIDO_BLOCKING";
4+
private static final String environmentName = "AIKIDO_BLOCK";
55
private static final boolean defaultValue = false;
66

77
public BlockingEnv() {

agent_api/src/test/java/collectors/FileCollectorTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public void setup() {
3030
}
3131

3232
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
33-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
33+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
3434
@Test
3535
public void testStrings() {
3636
isPathTraversalAttack("/etc/home/../../test.txt.js");
@@ -42,7 +42,7 @@ public void testStrings() {
4242
}
4343

4444
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
45-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
45+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
4646
@Test
4747
public void testPaths() {
4848
isPathTraversalAttack(filePath1);
@@ -53,7 +53,7 @@ public void testPaths() {
5353
}
5454

5555
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
56-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
56+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
5757
@Test
5858
public void testStringArrays() {
5959
isPathTraversalAttack(new String[]{"/etc/home/../../test.txt.js"});
@@ -65,7 +65,7 @@ public void testStringArrays() {
6565
}
6666

6767
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
68-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
68+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
6969
@Test
7070
public void testFileURIs() throws URISyntaxException {
7171
isPathTraversalAttack(new URI("file:///etc/home/../../test.txt.js"));
@@ -79,7 +79,7 @@ public void testFileURIs() throws URISyntaxException {
7979
}
8080

8181
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
82-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
82+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
8383
@Test
8484
public void testNotRecognizedObjects() throws MalformedURLException {
8585
isNotPathTraversalAttack(true);
@@ -104,7 +104,7 @@ public void isNotPathTraversalAttack(Object filePath) {
104104
}
105105

106106
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
107-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
107+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
108108
@Test
109109
public void testMaxRecursion() {
110110
isPathTraversalAttack(new Object[]{new Object[]{"/etc/home/../../test.txt.js"}}); // Depth of 1

agent_api/src/test/java/collectors/HostnameCollectorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public SampleContextObject() {
8989
}
9090

9191
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
92-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "1")
92+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "1")
9393
@Test
9494
public void testHostnameSameWithContextAsAttack() {
9595
ThreadCacheObject myThreadCache = mock(ThreadCacheObject.class);

agent_api/src/test/java/collectors/URLCollectorTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private void setContextAndLifecycle(String url) {
3333
}
3434

3535
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
36-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
36+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
3737
@Test
3838
public void testNewUrlConnectionWithPort() throws IOException {
3939
setContextAndLifecycle("");
@@ -46,7 +46,7 @@ public void testNewUrlConnectionWithPort() throws IOException {
4646
}
4747

4848
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
49-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
49+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
5050
@Test
5151
public void testNewUrlConnectionWithHttp() throws IOException {
5252
setContextAndLifecycle("");
@@ -58,7 +58,7 @@ public void testNewUrlConnectionWithHttp() throws IOException {
5858
}
5959

6060
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
61-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
61+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
6262
@Test
6363
public void testNewUrlConnectionHttps() throws IOException {
6464
setContextAndLifecycle("");
@@ -70,7 +70,7 @@ public void testNewUrlConnectionHttps() throws IOException {
7070
}
7171

7272
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
73-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
73+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
7474
@Test
7575
public void testNewUrlConnectionFaultyProtocol() throws IOException {
7676
setContextAndLifecycle("");

agent_api/src/test/java/helpers/ShouldBlockHelperTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public class ShouldBlockHelperTest {
1111

1212
@Test
1313
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "")
14-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
14+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
1515
public void testWithInvalidAikidoTokenTrue() {
1616
assertTrue(ShouldBlockHelper.shouldBlock());
1717
}
1818

1919
@Test
2020
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "")
21-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "false")
21+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "false")
2222
public void testWithInvalidAikidoTokenFalse() {
2323
assertFalse(ShouldBlockHelper.shouldBlock());
2424
}

agent_api/src/test/java/vulnerabilities/ScannerTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ void testScanForGivenVulnerability_ContextIsNull() {
8181

8282
// Disable IPC :
8383
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "improper-access-token")
84-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
84+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
8585
@Test
8686
void testScanSafeSQLCode() {
8787
// Safe :
@@ -98,7 +98,7 @@ void testScanSafeSQLCode() {
9898

9999
// Disable IPC :
100100
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "improper-access-token")
101-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
101+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
102102
@Test
103103
void testBypassedIPs() {
104104
// Thread cache does not force any protection off :
@@ -131,7 +131,7 @@ void testBypassedIPs() {
131131

132132
// Disable IPC :
133133
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "improper-access-token")
134-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
134+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
135135
@Test
136136
void testForceProtectionOff() {
137137
// Thread cache does not force any protection off :
@@ -156,7 +156,7 @@ void testForceProtectionOff() {
156156
}
157157

158158
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "improper-access-token")
159-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
159+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
160160
@Test
161161
void testDoesNotRunWithContextNull() {
162162
Context.set(null);
@@ -166,7 +166,7 @@ void testDoesNotRunWithContextNull() {
166166
}
167167

168168
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "improper-access-token")
169-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
169+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
170170
@Test
171171
void TestStillThrowsWithThreadCacheUndefined() {
172172
ThreadCache.set(null);

agent_api/src/test/java/wrappers/ApacheHttpClientTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ private void setContextAndLifecycle(String url) {
3939
}
4040

4141
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
42-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
42+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
4343
@Test
4444
public void testSSRFLocalhostValid() throws Exception {
4545
setContextAndLifecycle("http://localhost:5000");
@@ -67,7 +67,7 @@ public void testSSRFLocalhostValid() throws Exception {
6767
}
6868

6969
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
70-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
70+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
7171
@Test
7272
public void testSSRFWithoutPort() throws Exception {
7373
setContextAndLifecycle("http://localhost:80");
@@ -78,7 +78,7 @@ public void testSSRFWithoutPort() throws Exception {
7878
}
7979

8080
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
81-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
81+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
8282
@Test
8383
public void testSSRFWithoutPortAndWithoutContext() throws Exception {
8484
setContextAndLifecycle("http://localhost:80");
@@ -89,7 +89,7 @@ public void testSSRFWithoutPortAndWithoutContext() throws Exception {
8989
}
9090

9191
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
92-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
92+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
9393
@Test
9494
public void testSSRFWithoutPortAndWithoutThreadCache() throws Exception {
9595
setContextAndLifecycle("http://localhost:80");

agent_api/src/test/java/wrappers/FileReaderWriterTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private void setContextAndLifecycle(String url) {
3434
}
3535

3636
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
37-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
37+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
3838
@Test
3939
public void testFileReader() throws Exception {
4040
setContextAndLifecycle("../file.txt");
@@ -57,7 +57,7 @@ public void testFileReader() throws Exception {
5757
}
5858

5959
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
60-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
60+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
6161
@Test
6262
public void testFileWriter() throws Exception {
6363
setContextAndLifecycle("../file.txt");

agent_api/src/test/java/wrappers/FileWrapperTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private void setContextAndLifecycle(String url) {
3333
}
3434

3535
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token-2")
36-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
36+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
3737
@Test
3838
public void testPathTraversalString() throws Exception {
3939
setContextAndLifecycle("../file.txt");

agent_api/src/test/java/wrappers/HttpURLConnectionRedirectTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ private void setContextAndLifecycle(String url) {
4040
}
4141

4242
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
43-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
43+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
4444
@Test
4545
public void testSrrfTest() {
4646
setContextAndLifecycle(SSRF_TEST);
@@ -60,7 +60,7 @@ public void testSrrfTest() {
6060
}
6161

6262
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
63-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
63+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
6464
@Test
6565
public void testSrrfTestTwice() {
6666
setContextAndLifecycle(SSRF_TEST_TWICE);
@@ -79,7 +79,7 @@ public void testSrrfTestTwice() {
7979
}
8080

8181
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
82-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
82+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
8383
@Test
8484
public void testSrrfTestDomain() {
8585
setContextAndLifecycle(SSRF_TEST_DOMAIN);
@@ -98,7 +98,7 @@ public void testSrrfTestDomain() {
9898
}
9999

100100
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
101-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
101+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
102102
@Test
103103
public void testSrrfTestDomainTwice() {
104104
setContextAndLifecycle(SSRF_TEST_DOMAIN_TWICE);
@@ -117,7 +117,7 @@ public void testSrrfTestDomainTwice() {
117117
}
118118

119119
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
120-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
120+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
121121
@Test
122122
public void testSsrfCrossDomain() {
123123
setContextAndLifecycle(CROSS_DOMAIN_TEST);
@@ -136,7 +136,7 @@ public void testSsrfCrossDomain() {
136136
}
137137

138138
@SetEnvironmentVariable(key = "AIKIDO_TOKEN", value = "invalid-token")
139-
@SetEnvironmentVariable(key = "AIKIDO_BLOCKING", value = "true")
139+
@SetEnvironmentVariable(key = "AIKIDO_BLOCK", value = "true")
140140
@Test
141141
public void testSsrfCrossDomainTwice() {
142142
setContextAndLifecycle(CROSS_DOMAIN_TEST_DOMAIN_TWICE);

0 commit comments

Comments
 (0)