Many updates
This commit is contained in:
@@ -18,7 +18,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
["/.env", "/.git", "/wp-admin"].each do |path|
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: path,
|
||||
@@ -45,7 +45,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
3.times do |i|
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
@@ -71,7 +71,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
paths.each do |path|
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: path,
|
||||
@@ -95,7 +95,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
2.times do
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
@@ -114,7 +114,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
# Old event (outside lookback window)
|
||||
old_event = Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: 10.minutes.ago,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
@@ -125,7 +125,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
2.times do
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.git",
|
||||
@@ -154,7 +154,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
3.times do
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
@@ -173,7 +173,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
3.times do
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
@@ -198,7 +198,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
3.times do
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
@@ -216,7 +216,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
# Create event with invalid IP
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: "invalid-ip",
|
||||
request_path: "/.env",
|
||||
@@ -235,7 +235,7 @@ class PathScannerDetectorJobTest < ActiveJob::TestCase
|
||||
3.times do
|
||||
Event.create!(
|
||||
project: @project,
|
||||
event_id: SecureRandom.uuid,
|
||||
request_id: SecureRandom.uuid,
|
||||
timestamp: Time.current,
|
||||
ip_address: ip,
|
||||
request_path: "/.env",
|
||||
|
||||
Reference in New Issue
Block a user