From 1a0dbc9684ddd3f6227a09346c63c1c5e789bd4d Mon Sep 17 00:00:00 2001 From: Stefan Esser Date: Thu, 13 Feb 2014 10:39:30 +0100 Subject: Tests for suhosin.log.use-x-forwarded-for --- tests/logging/use_x_forwarded_for_off.phpt | 23 ++++++++++++++++++++++ .../use_x_forwarded_for_off_no_remote_addr.phpt | 18 +++++++++++++++++ tests/logging/use_x_forwarded_for_on.phpt | 23 ++++++++++++++++++++++ .../use_x_forwarded_for_on_no_x_forwarded.phpt | 18 +++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 tests/logging/use_x_forwarded_for_off.phpt create mode 100644 tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt create mode 100644 tests/logging/use_x_forwarded_for_on.phpt create mode 100644 tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt (limited to 'tests') diff --git a/tests/logging/use_x_forwarded_for_off.phpt b/tests/logging/use_x_forwarded_for_off.phpt new file mode 100644 index 0000000..6b31d53 --- /dev/null +++ b/tests/logging/use_x_forwarded_for_off.phpt @@ -0,0 +1,23 @@ +--TEST-- +Testing: suhosin.log.use-x-forwarded-for=Off +--SKIPIF-- + +--INI-- +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.log.syslog=0 +suhosin.executor.func.blacklist=max +suhosin.log.use-x-forwarded-for=Off +--ENV-- +return << +--EXPECTF-- +Warning: max() has been disabled for security reasons in %s on line 2 +ALERT - function within blacklist called: max() (attacker '101.102.103.104', file '%s', line 2) \ No newline at end of file diff --git a/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt b/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt new file mode 100644 index 0000000..bd4c72b --- /dev/null +++ b/tests/logging/use_x_forwarded_for_off_no_remote_addr.phpt @@ -0,0 +1,18 @@ +--TEST-- +Testing: suhosin.log.use-x-forwarded-for=Off (without REMOTE_ADDR set) +--SKIPIF-- + +--INI-- +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.log.syslog=0 +suhosin.executor.func.blacklist=max +suhosin.log.use-x-forwarded-for=Off +--FILE-- + +--EXPECTF-- +Warning: max() has been disabled for security reasons in %s on line 2 +ALERT - function within blacklist called: max() (attacker 'REMOTE_ADDR not set', file '%s', line 2) \ No newline at end of file diff --git a/tests/logging/use_x_forwarded_for_on.phpt b/tests/logging/use_x_forwarded_for_on.phpt new file mode 100644 index 0000000..5f37ca9 --- /dev/null +++ b/tests/logging/use_x_forwarded_for_on.phpt @@ -0,0 +1,23 @@ +--TEST-- +Testing: suhosin.log.use-x-forwarded-for=On +--SKIPIF-- + +--INI-- +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.log.syslog=0 +suhosin.executor.func.blacklist=max +suhosin.log.use-x-forwarded-for=On +--ENV-- +return << +--EXPECTF-- +Warning: max() has been disabled for security reasons in %s on line 2 +ALERT - function within blacklist called: max() (attacker '1.2.3.4', file '%s', line 2) \ No newline at end of file diff --git a/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt b/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt new file mode 100644 index 0000000..aea6e06 --- /dev/null +++ b/tests/logging/use_x_forwarded_for_on_no_x_forwarded.phpt @@ -0,0 +1,18 @@ +--TEST-- +Testing: suhosin.log.use-x-forwarded-for=On (without X-Forwarded-For set) +--SKIPIF-- + +--INI-- +suhosin.log.sapi=0 +suhosin.log.stdout=255 +suhosin.log.script=0 +suhosin.log.syslog=0 +suhosin.executor.func.blacklist=max +suhosin.log.use-x-forwarded-for=On +--FILE-- + +--EXPECTF-- +Warning: max() has been disabled for security reasons in %s on line 2 +ALERT - function within blacklist called: max() (attacker 'X-FORWARDED-FOR not set', file '%s', line 2) \ No newline at end of file -- cgit v1.3