aikido-zen 1.0.2-aarch64-linux

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. checksums.yaml +7 -0
  2. data/.aikido +6 -0
  3. data/.ruby-version +1 -0
  4. data/.simplecov +32 -0
  5. data/.standard.yml +3 -0
  6. data/LICENSE +674 -0
  7. data/README.md +148 -0
  8. data/Rakefile +67 -0
  9. data/benchmarks/README.md +22 -0
  10. data/benchmarks/rails7.1_benchmark.js +1 -0
  11. data/benchmarks/rails7.1_sql_injection.js +102 -0
  12. data/docs/banner.svg +202 -0
  13. data/docs/config.md +133 -0
  14. data/docs/proxy.md +10 -0
  15. data/docs/rails.md +112 -0
  16. data/docs/troubleshooting.md +62 -0
  17. data/lib/aikido/zen/actor.rb +146 -0
  18. data/lib/aikido/zen/agent/heartbeats_manager.rb +66 -0
  19. data/lib/aikido/zen/agent.rb +181 -0
  20. data/lib/aikido/zen/api_client.rb +145 -0
  21. data/lib/aikido/zen/attack.rb +217 -0
  22. data/lib/aikido/zen/attack_wave/helpers.rb +457 -0
  23. data/lib/aikido/zen/attack_wave.rb +88 -0
  24. data/lib/aikido/zen/background_worker.rb +52 -0
  25. data/lib/aikido/zen/cache.rb +91 -0
  26. data/lib/aikido/zen/capped_collections.rb +86 -0
  27. data/lib/aikido/zen/collector/event.rb +238 -0
  28. data/lib/aikido/zen/collector/hosts.rb +30 -0
  29. data/lib/aikido/zen/collector/routes.rb +71 -0
  30. data/lib/aikido/zen/collector/sink_stats.rb +95 -0
  31. data/lib/aikido/zen/collector/stats.rb +122 -0
  32. data/lib/aikido/zen/collector/users.rb +32 -0
  33. data/lib/aikido/zen/collector.rb +223 -0
  34. data/lib/aikido/zen/config.rb +312 -0
  35. data/lib/aikido/zen/context/rack_request.rb +27 -0
  36. data/lib/aikido/zen/context/rails_request.rb +47 -0
  37. data/lib/aikido/zen/context.rb +145 -0
  38. data/lib/aikido/zen/detached_agent/agent.rb +79 -0
  39. data/lib/aikido/zen/detached_agent/front_object.rb +41 -0
  40. data/lib/aikido/zen/detached_agent/server.rb +78 -0
  41. data/lib/aikido/zen/detached_agent.rb +2 -0
  42. data/lib/aikido/zen/errors.rb +107 -0
  43. data/lib/aikido/zen/event.rb +116 -0
  44. data/lib/aikido/zen/helpers.rb +24 -0
  45. data/lib/aikido/zen/internals.rb +123 -0
  46. data/lib/aikido/zen/libzen-v0.1.48-aarch64-linux.so +0 -0
  47. data/lib/aikido/zen/middleware/allowed_address_checker.rb +26 -0
  48. data/lib/aikido/zen/middleware/attack_wave_protector.rb +46 -0
  49. data/lib/aikido/zen/middleware/context_setter.rb +26 -0
  50. data/lib/aikido/zen/middleware/fork_detector.rb +23 -0
  51. data/lib/aikido/zen/middleware/middleware.rb +11 -0
  52. data/lib/aikido/zen/middleware/rack_throttler.rb +50 -0
  53. data/lib/aikido/zen/middleware/request_tracker.rb +197 -0
  54. data/lib/aikido/zen/outbound_connection.rb +62 -0
  55. data/lib/aikido/zen/outbound_connection_monitor.rb +23 -0
  56. data/lib/aikido/zen/package.rb +22 -0
  57. data/lib/aikido/zen/payload.rb +50 -0
  58. data/lib/aikido/zen/rails_engine.rb +53 -0
  59. data/lib/aikido/zen/rate_limiter/breaker.rb +61 -0
  60. data/lib/aikido/zen/rate_limiter/bucket.rb +76 -0
  61. data/lib/aikido/zen/rate_limiter/result.rb +31 -0
  62. data/lib/aikido/zen/rate_limiter.rb +50 -0
  63. data/lib/aikido/zen/request/heuristic_router.rb +115 -0
  64. data/lib/aikido/zen/request/rails_router.rb +92 -0
  65. data/lib/aikido/zen/request/schema/auth_discovery.rb +86 -0
  66. data/lib/aikido/zen/request/schema/auth_schemas.rb +54 -0
  67. data/lib/aikido/zen/request/schema/builder.rb +121 -0
  68. data/lib/aikido/zen/request/schema/definition.rb +107 -0
  69. data/lib/aikido/zen/request/schema/empty_schema.rb +28 -0
  70. data/lib/aikido/zen/request/schema.rb +87 -0
  71. data/lib/aikido/zen/request.rb +88 -0
  72. data/lib/aikido/zen/route.rb +96 -0
  73. data/lib/aikido/zen/runtime_settings/endpoints.rb +78 -0
  74. data/lib/aikido/zen/runtime_settings/ip_set.rb +36 -0
  75. data/lib/aikido/zen/runtime_settings/protection_settings.rb +62 -0
  76. data/lib/aikido/zen/runtime_settings/rate_limit_settings.rb +47 -0
  77. data/lib/aikido/zen/runtime_settings.rb +66 -0
  78. data/lib/aikido/zen/scan.rb +75 -0
  79. data/lib/aikido/zen/scanners/path_traversal/helpers.rb +68 -0
  80. data/lib/aikido/zen/scanners/path_traversal_scanner.rb +64 -0
  81. data/lib/aikido/zen/scanners/shell_injection/helpers.rb +159 -0
  82. data/lib/aikido/zen/scanners/shell_injection_scanner.rb +65 -0
  83. data/lib/aikido/zen/scanners/sql_injection_scanner.rb +94 -0
  84. data/lib/aikido/zen/scanners/ssrf/dns_lookups.rb +27 -0
  85. data/lib/aikido/zen/scanners/ssrf/private_ip_checker.rb +97 -0
  86. data/lib/aikido/zen/scanners/ssrf_scanner.rb +266 -0
  87. data/lib/aikido/zen/scanners/stored_ssrf_scanner.rb +55 -0
  88. data/lib/aikido/zen/scanners.rb +7 -0
  89. data/lib/aikido/zen/sink.rb +118 -0
  90. data/lib/aikido/zen/sinks/action_controller.rb +85 -0
  91. data/lib/aikido/zen/sinks/async_http.rb +80 -0
  92. data/lib/aikido/zen/sinks/curb.rb +113 -0
  93. data/lib/aikido/zen/sinks/em_http.rb +83 -0
  94. data/lib/aikido/zen/sinks/excon.rb +118 -0
  95. data/lib/aikido/zen/sinks/file.rb +153 -0
  96. data/lib/aikido/zen/sinks/http.rb +93 -0
  97. data/lib/aikido/zen/sinks/httpclient.rb +95 -0
  98. data/lib/aikido/zen/sinks/httpx.rb +78 -0
  99. data/lib/aikido/zen/sinks/kernel.rb +33 -0
  100. data/lib/aikido/zen/sinks/mysql2.rb +31 -0
  101. data/lib/aikido/zen/sinks/net_http.rb +101 -0
  102. data/lib/aikido/zen/sinks/patron.rb +103 -0
  103. data/lib/aikido/zen/sinks/pg.rb +72 -0
  104. data/lib/aikido/zen/sinks/resolv.rb +62 -0
  105. data/lib/aikido/zen/sinks/socket.rb +85 -0
  106. data/lib/aikido/zen/sinks/sqlite3.rb +46 -0
  107. data/lib/aikido/zen/sinks/trilogy.rb +31 -0
  108. data/lib/aikido/zen/sinks/typhoeus.rb +78 -0
  109. data/lib/aikido/zen/sinks.rb +36 -0
  110. data/lib/aikido/zen/sinks_dsl.rb +250 -0
  111. data/lib/aikido/zen/synchronizable.rb +24 -0
  112. data/lib/aikido/zen/system_info.rb +80 -0
  113. data/lib/aikido/zen/version.rb +10 -0
  114. data/lib/aikido/zen/worker.rb +87 -0
  115. data/lib/aikido/zen.rb +303 -0
  116. data/lib/aikido-zen.rb +3 -0
  117. data/placeholder/.gitignore +4 -0
  118. data/placeholder/README.md +11 -0
  119. data/placeholder/Rakefile +75 -0
  120. data/placeholder/lib/placeholder.rb.template +3 -0
  121. data/placeholder/placeholder.gemspec.template +20 -0
  122. data/tasklib/bench.rake +94 -0
  123. data/tasklib/libzen.rake +133 -0
  124. data/tasklib/wrk.rb +88 -0
  125. metadata +214 -0
data/README.md ADDED
@@ -0,0 +1,148 @@
1
+ ![Zen by Aikido for Ruby](./docs/banner.svg)
2
+
3
+ # Zen, in-app firewall for Ruby | by Aikido
4
+
5
+ [![Gem Version](https://badge.fury.io/rb/aikido-zen.svg?icon=si%3Arubygems&style=flat)](https://badge.fury.io/rb/aikido-zen)
6
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)
7
+ [![Unit tests](https://github.com/AikidoSec/firewall-ruby/actions/workflows/main.yml/badge.svg)](https://github.com/AikidoSec/firewall-ruby/actions/workflows/main.yml)
8
+ [![Release](https://github.com/AikidoSec/firewall-ruby/actions/workflows/release.yml/badge.svg)](https://github.com/AikidoSec/firewall-ruby/actions/workflows/release.yml)
9
+ [![codecov](https://codecov.io/gh/AikidoSec/firewall-ruby/graph/badge.svg?token=X0MLST7S15)](https://codecov.io/gh/AikidoSec/firewall-ruby)
10
+
11
+ Zen, your in-app firewall for peace of mind - at runtime.
12
+
13
+ Zen by Aikido is an embedded Web Application Firewall that autonomously protects Ruby apps against common and critical attacks.
14
+
15
+ It protects your Ruby apps by preventing user input containing dangerous strings, which allow injection, pollution, and path traversal attacks. It runs on the same server as your Ruby app for simple [installation](#installation) and zero maintenance.
16
+
17
+ ## Features
18
+
19
+ Zen will autonomously protect your Ruby applications against:
20
+
21
+ * 🛡️ [SQL injection attacks](https://www.aikido.dev/blog/the-state-of-sql-injections)
22
+ * 🛡️ [Server-side request forgery (SSRF)](https://github.com/AikidoSec/firewall-node/blob/main/docs/ssrf.md)
23
+ * 🛡️ [Command injection attacks](https://www.aikido.dev/blog/command-injection-in-2024-unpacked)
24
+ * 🛡️ [Path traversal attacks](https://www.aikido.dev/blog/path-traversal-in-2024-the-year-unpacked)
25
+ * 🛡️ [NoSQL injection attacks](https://www.aikido.dev/blog/web-application-security-vulnerabilities) (coming soon)
26
+ * 🛡️ [Attack waves](https://help.aikido.dev/zen-firewall/zen-features/attack-wave-protection)
27
+
28
+ Zen operates autonomously on the same server as your Ruby app to:
29
+
30
+ * ✅ Secure your app like a classic web application firewall (WAF), but with none of the infrastructure or cost
31
+ * ✅ Rate limit specific API endpoints by IP or by user
32
+ * ✅ Allow you to block specific users manually
33
+
34
+ ## Supported libraries and frameworks
35
+
36
+ Zen for Ruby 2.7+ is compatible with:
37
+
38
+ ### Web frameworks
39
+
40
+ * ✅ [Ruby on Rails](docs/rails.md) 7.x, 8.x
41
+
42
+ ### Database drivers
43
+
44
+ * ✅ [`sqlite3`](https://github.com/sparklemotion/sqlite3-ruby) 1.x, 2.x
45
+ * ✅ [`pg`](https://github.com/ged/ruby-pg) 1.x
46
+ * ✅ [`mysql2`](https://github.com/brianmario/mysql2) 0.x
47
+ * ✅ [`trilogy`](https://github.com/trilogy-libraries/trilogy) 2.x
48
+
49
+ ### ORMs and query builders
50
+
51
+ See list above for supported database drivers.
52
+
53
+ * ✅ [ActiveRecord](https://github.com/rails/rails)
54
+ * ✅ [Sequel](https://github.com/jeremyevans/sequel)
55
+
56
+ ### HTTP clients
57
+
58
+ * ✅ [`net-http`](https://github.com/ruby/net-http)
59
+ * ✅ [`http.rb`](https://github.com/httprb/http) 1.x, 2.x, 3.x, 4.x, 5.x
60
+ * ✅ [`httpx`](https://gitlab.com/os85/httpx) 1.x (1.1.3+)
61
+ * ✅ [`httpclient`](https://github.com/nahi/httpclient) 2.x, 3.x
62
+ * ✅ [`excon`](https://github.com/excon/excon) 0.x (0.50.0+), 1.x
63
+ * ✅ [`curb`](https://github.com/taf2/curb) 0.x (0.2.3+), 1.x
64
+ * ✅ [`patron`](https://github.com/toland/patron) 0.x (0.6.4+)
65
+ * ✅ [`typhoeus`](https://github.com/typhoeus/typhoeus) 0.x (0.5.0+), 1.x
66
+ * ✅ [`async-http`](https://github.com/socketry/async-http) 0.x (0.70.0+)
67
+ * ✅ [`em-http-request`](https://github.com/igrigorik/em-http-request) 1.x
68
+
69
+ ## Installation
70
+
71
+ We recommend testing Zen locally or on staging before deploying to production.
72
+
73
+ ```sh
74
+ bundle add aikido-zen
75
+ ```
76
+
77
+ or, if not using bundler:
78
+
79
+ ```sh
80
+ gem install aikido-zen
81
+ ```
82
+
83
+ For framework specific instructions, check out our docs:
84
+
85
+ * [Ruby on Rails](docs/rails.md)
86
+
87
+ ## Reporting to your Aikido Security dashboard
88
+
89
+ > Aikido is your no nonsense application security platform. One central system that scans your source code & cloud, shows you what vulnerabilities matter, and how to fix them - fast. So you can get back to building.
90
+
91
+ Zen is a new product by Aikido. Built for developers to level up their security. While Aikido scans, get Zen for always-on protection.
92
+
93
+ You can use some of Zen's features without Aikido, of course. Peace of mind is just a few lines of code away.
94
+
95
+ But you will get the most value by reporting your data to Aikido.
96
+
97
+ You will need an Aikido account and a token to report events to Aikido. If you don't have an account, you can [sign up for free](https://app.aikido.dev/login).
98
+
99
+ Here's how:
100
+
101
+ * [Log in to your Aikido account](https://app.aikido.dev/login).
102
+ * Go to [Zen](https://app.aikido.dev/runtime/services).
103
+ * Go to apps.
104
+ * Click on **Add app**.
105
+ * Choose a name for your app.
106
+ * Click **Generate token**.
107
+ * Copy the token.
108
+ * Set the token as an environment variable, `AIKIDO_TOKEN`, using [dotenv](https://github.com/bkeepers/dotenv) or another method of your choosing.
109
+
110
+ ## Running in production (blocking) mode
111
+
112
+ By default, Zen will only detect and report attacks to Aikido.
113
+
114
+ To block requests, set the `AIKIDO_BLOCK` environment variable to `true`.
115
+
116
+ See [Reporting to Aikido](#reporting-to-your-aikido-security-dashboard) to learn how to send events to Aikido.
117
+
118
+ ## Additional configuration
119
+
120
+ [Configure Zen using environment variables for authentication, mode settings, debugging, and more.](https://help.aikido.dev/doc/configuration-via-env-vars/docrSItUkeR9)
121
+
122
+ ## License
123
+
124
+ This program is offered under a commercial and under the AGPL license. You can be released from the requirements of the AGPL license by purchasing a commercial license. Buying such a license is mandatory as soon as you develop commercial activities involving the Zen software without disclosing the source code of your own applications.
125
+
126
+ For more information, please contact Aikido Security at this address: support@aikido.dev or create an account at https://app.aikido.dev.
127
+
128
+ ## Benchmarks
129
+
130
+ We run a benchmark on every commit to ensure Zen has a minimal impact on your application's performance.
131
+
132
+ See [benchmarks](benchmarks)
133
+
134
+ ## Bug bounty program
135
+
136
+ Our bug bounty program is public and can be found by all registered Intigriti users at: https://app.intigriti.com/researcher/programs/aikido/aikidozenbeta
137
+
138
+ ## Contributing
139
+
140
+ See [CONTRIBUTING.md](.github/CONTRIBUTING.md) for more information.
141
+
142
+ ## Code of Conduct
143
+
144
+ See [CODE_OF_CONDUCT.md](.github/CODE_OF_CONDUCT.md) for more information.
145
+
146
+ ## Security
147
+
148
+ See [SECURITY.md](.github/SECURITY.md) for more information.
data/Rakefile ADDED
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "minitest/test_task"
5
+ require "standard/rake"
6
+ require "rake/clean"
7
+
8
+ load "tasklib/libzen.rake"
9
+ load "tasklib/bench.rake"
10
+
11
+ desc "Run all benchmarks"
12
+ task bench: "bench:default"
13
+
14
+ namespace :build do
15
+ desc "Ensure Gemfile.lock is up-to-date"
16
+ task "update_gem_lockfile" do
17
+ sh "bundle check >/dev/null || bundle"
18
+ end
19
+ end
20
+ task build: ["build:update_gem_lockfile", "libzen:download:all"]
21
+
22
+ # Build all the native gems as well
23
+ Rake::Task["build"].enhance(["libzen:gems"])
24
+
25
+ # rake release wants to tag the commit and push the tag, but we run the release
26
+ # workflow after creating the tag, and so we don't need another one.
27
+ Rake::Task["release:source_control_push"].clear
28
+ task "release:source_control_push" do
29
+ # do nothing
30
+ end
31
+
32
+ # Push all the native gems before the libzen-less one.
33
+ task "release:rubygem_push" => "libzen:release"
34
+
35
+ Pathname.glob("sample_apps/*").select(&:directory?).each do |dir|
36
+ namespace :build do
37
+ desc "Ensure Gemfile.lock is up-to-date in the #{dir.basename} sample app"
38
+ task "update_#{dir.basename}_lockfile" do
39
+ Dir.chdir(dir) { sh "bundle check >/dev/null || bundle" }
40
+ end
41
+ end
42
+
43
+ task build: "build:update_#{dir.basename}_lockfile"
44
+ end
45
+
46
+ Minitest::TestTask.create do |test_task|
47
+ test_task.test_globs = FileList["test/**/{test_*,*_test}.rb"]
48
+ .exclude("test/e2e/**/*.rb")
49
+ end
50
+ task test: "libzen:download:current"
51
+
52
+ Pathname.glob("test/e2e/*").select(&:directory?).each do |dir|
53
+ namespace :e2e do
54
+ desc "Run e2e tests for the #{dir.basename} sample app"
55
+ task dir.basename do
56
+ Dir.chdir(dir) do
57
+ sh "rake ci:setup"
58
+ sh "rake test"
59
+ end
60
+ end
61
+ end
62
+
63
+ desc "Run all e2e tests"
64
+ task e2e: "e2e:#{dir.basename}"
65
+ end
66
+
67
+ task default: %i[test standard]
@@ -0,0 +1,22 @@
1
+ # Benchmarking Zen for Ruby
2
+
3
+ We use [WRK](https://github.com/wg/wrk) & [Grafana K6](https://k6.io) for these.
4
+
5
+ WRK benchmarks are only requesting a URL (`/benchmark`). In case you want to add more
6
+ of those test, you have to code them in the file `tasklib/bench.rake`.
7
+
8
+ K6 tests are defined in `benchmarks` folder. They are a javascript file, with calls
9
+ to different endpoints.
10
+
11
+ In order to run a benchmarks against a single application, run the following
12
+ from the root of the project:
13
+
14
+ ```
15
+ $ BUNDLE_GEMFILE=./sample_apps/{app}/Gemfile bundle exec rake bench:{app}:(k6|wrk)_run
16
+ ```
17
+
18
+ For example, for the WRK of `rails7.1_benchmark` application:
19
+
20
+ ```
21
+ $ BUNDLE_GEMFILE=./sample_apps/rails7.1_benchmark/Gemfile bundle exec rake bench:rails7.1_benchmark:wrk_run
22
+ ```
@@ -0,0 +1 @@
1
+ rails7.1_sql_injection.js
@@ -0,0 +1,102 @@
1
+ import http from "k6/http";
2
+ import {Trend} from "k6/metrics";
3
+
4
+ const HTTP = {
5
+ withZen: {
6
+ get: (path, ...args) => http.get("http://localhost:3001" + path, ...args),
7
+ post: (path, ...args) => http.post("http://localhost:3001" + path, ...args)
8
+ },
9
+ withoutZen: {
10
+ get: (path, ...args) => http.get("http://localhost:3002" + path, ...args),
11
+ post: (path, ...args) => http.post("http://localhost:3002" + path, ...args)
12
+ }
13
+ };
14
+
15
+ function test(name, fn) {
16
+ const withZen = fn(HTTP.withZen);
17
+ const withoutZen = fn(HTTP.withoutZen);
18
+ const timeWithZen = withZen.timings.duration;
19
+ const timeWithoutZen = withoutZen.timings.duration;
20
+
21
+ tests[name].delta.add(timeWithZen - timeWithoutZen);
22
+ tests[name].overhead.add(100 * (timeWithZen - timeWithoutZen) / timeWithoutZen)
23
+
24
+ tests[name].with_zen.add(timeWithZen);
25
+ tests[name].without_zen.add(timeWithoutZen);
26
+ }
27
+
28
+ function buildTestTrends(prefix) {
29
+ return {
30
+ delta: new Trend(`${prefix}_delta`),
31
+ with_zen: new Trend(`${prefix}_with_zen`),
32
+ without_zen: new Trend(`${prefix}_without_zen`),
33
+ overhead: new Trend(`${prefix}_overhead`)
34
+ };
35
+ }
36
+
37
+ const tests = {
38
+ test_post_page_with_json_body: buildTestTrends("test_post_page_with_json_body"),
39
+ test_get_page_without_attack: buildTestTrends("test_get_page_without_attack")
40
+ };
41
+
42
+ export const options = {
43
+ vus: 1, // Number of virtual users
44
+ duration: "60s",
45
+ thresholds: {
46
+ http_req_failed: ["rate==0"], // We are marking the attacks as expected, so we should have no errors.
47
+ test_post_page_with_json_body_delta: ["med<10"],
48
+ test_get_page_without_attack_delta: ["med<10"]
49
+ }
50
+ };
51
+
52
+ const headers = {
53
+ Authorization:
54
+ "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.Bw8sSk3kdnT9d803kqqE_LZJzY1PzMl5cbmuanQKxrI",
55
+ Accept:
56
+ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
57
+ "Accept-Language": "en-US,en;q=0.9",
58
+ Dnt: "1",
59
+ Priority: "u=0, i",
60
+ "Sec-Ch-Ua":
61
+ '"Not)A;Brand";v="99", "Google Chrome";v="127", "Chromium";v="127"',
62
+ "Sec-Ch-Ua-Arch": '"arm"',
63
+ "Sec-Ch-Ua-Bitness": '"64"',
64
+ "Sec-Ch-Ua-Full-Version-List":
65
+ '"Not)A;Brand";v="99.0.0.0", "Google Chrome";v="127.0.6533.72", "Chromium";v="127.0.6533.72"',
66
+ "Sec-Ch-Ua-Mobile": "?0",
67
+ "Sec-Ch-Ua-Model": '""',
68
+ "Sec-Ch-Ua-Platform": '"macOS"',
69
+ "Sec-Ch-Ua-Platform-Version": '"14.5.0"',
70
+ "Sec-Ch-Ua-Wow64": "?0",
71
+ "Sec-Fetch-Dest": "document",
72
+ "Sec-Fetch-Mode": "navigate",
73
+ "Sec-Fetch-Site": "cross-site",
74
+ "Sec-Fetch-User": "?1",
75
+ "Sec-Gpc": "1",
76
+ "Upgrade-Insecure-Requests": "1",
77
+ "User-Agent":
78
+ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36",
79
+ };
80
+
81
+ const expectAttack = http.expectedStatuses(200, 500);
82
+
83
+ export default function () {
84
+ test("test_post_page_with_json_body",
85
+ (http) => http.post("/cats",
86
+ JSON.stringify({cat: {name: "Féline Dion"}}),
87
+ {
88
+ headers: {
89
+ ...headers,
90
+ "Content-Type": "application/json",
91
+ "Accept": "application/json"
92
+ }
93
+ })
94
+ )
95
+
96
+ test("test_get_page_without_attack",
97
+ (http) => http.get("/cats/count",
98
+ {
99
+ headers: headers
100
+ })
101
+ )
102
+ }