FRED™
3.0
FRED™: Framework for Rapid and Easy Development
|
Public Member Functions | |
clientConfig () | |
addBan ($reason, $delay=null) | |
Add a ban reason to the registry. More... | |
bruteForceDelay ($result, $reason=null, $delay=null) | |
Add a brute force reason to the registry. More... | |
unBan ($addr) | |
Unban a client's IP address. More... | |
server ($name) | |
Perform a server check. More... | |
purge ($days=null) | |
Purge the ban registration files. More... | |
check ($ignore=null, $expected=false) | |
Perform all security checks. More... | |
Public Member Functions inherited from Component | |
__construct ($fred, $config=null) | |
__destruct () | |
clientConfig () | |
Public configuration. More... | |
config ($key, $default=null) | |
Retrieve a config value. More... | |
ping () | |
Ping function. More... | |
filemtime ($filename) | |
Filemtime with session cache. More... | |
component ($name) | |
Get a component (local or default). More... | |
components (... $names) | |
Get multiple components in an array. More... | |
Public Member Functions inherited from Thing | |
propertyExists ($property) | |
Check if a property exists (public or published). More... | |
constants ($prefix=null) | |
Return all constants. More... | |
get ($key) | |
Get one or more properties. More... | |
set ($key, $value=null) | |
Set one or more properties. More... | |
__get ($key) | |
__set ($key, $value) | |
Data Fields | |
$proxies = [] | |
Proxy white-list (key = proxy IP-address (optionally in CIDR notation), value = header to use. More... | |
$allowlist = [] | |
IP-addresses (key; CIDR notation; seperate with semi-colon) to exclude from certain checks. More... | |
$blocklist = [] | |
IP-addresses to ban anyhow (array of IP-address, optionally in CIDR notation). More... | |
$ext = '.ban' | |
Extension for ban registration file. More... | |
$defaultPurgeDays = 14 | |
Default number of days after which a ban file will be purged. More... | |
$defaultDelay = 3600 | |
Default time (seconds) a ban reason stays in the registry. More... | |
$bruteForceDelay = 10 | |
Default time (seconds) a brute force check stays in the registry. More... | |
$banCount = 5 | |
Number of registrations that will get you banned. More... | |
$server = [] | |
Server checks configuration (key = name, value = config as assoc.array). More... | |
Data Fields inherited from Component | |
$filemtimeTtl = 0 | |
Data Fields inherited from Thing | |
const | HIDDEN = 0 |
Property is hidden. More... | |
const | READABLE = 1 |
Property is readable. More... | |
const | WRITEABLE = 2 |
Property is writeable. More... | |
const | READWRITE = 3 |
Property is readable and writeable. More... | |
Protected Member Functions | |
filename ($addr) | |
hasBan () | |
countBan () | |
writeBan ($reason, $time) | |
getBanned () | |
getChecks () | |
getFilename () | |
getPath () | |
getRemoteAddr () | |
Protected Member Functions inherited from Component | |
init () | |
done () | |
getSession () | |
Protected Member Functions inherited from Thing | |
publish ($property, $visibility=self::READABLE) | |
Publish a property (or hide it again). More... | |
configure ($config) | |
Configure the object. More... | |
_get ($key) | |
Default getter if no specific setter is defined, and the property is also not published (readable). More... | |
_set ($key, $value) | |
Default setter if no specific setter is defined, and the property is also not published (writeable). More... | |
Protected Attributes | |
$_path = null | |
Path to store the ban registration files (temp path if empty). More... | |
$_checks = null | |
Available checks (key = name, value = \Rsi\Fred\Security\Check). More... | |
$_remoteAddr = null | |
True IP-address of the client client (optionally behind a white-listed proxy). More... | |
$_filename = null | |
$_banned = null | |
Protected Attributes inherited from Component | |
$_fred = null | |
$_config = null | |
$_name = null | |
$_components = [] | |
Local components (key = component name, value = component). More... | |
$_session = null | |
Protected Attributes inherited from Thing | |
$_published = [] | |
Published properties (key = name of property, value = visibility). More... | |
Definition at line 5 of file Security.php.
addBan | ( | $reason, | |
$delay = null |
|||
) |
Add a ban reason to the registry.
string | $reason | Name of reason. |
int | $delay | Time (seconds) the reason should stay in the registry (empty = use default). |
Definition at line 53 of file Security.php.
bruteForceDelay | ( | $result, | |
$reason = null , |
|||
$delay = null |
|||
) |
Add a brute force reason to the registry.
bool | $result | Whether the request was OK or not (only negative results get registered; however, positive results with a non-empty registry will be delayed too - this prevents attackers from interrupting a request after a small amount of time). |
string | $reason | Name of reason. |
int | $delay | Time (seconds) the reason should stay in the registry (empty = default). |
Definition at line 74 of file Security.php.
check | ( | $ignore = null , |
|
$expected = false |
|||
) |
Perform all security checks.
array | bool | $ignore | Checks to ignore (true = all). |
bool | $expected | True if this is an expected call. |
Definition at line 117 of file Security.php.
clientConfig | ( | ) |
Definition at line 26 of file Security.php.
|
protected |
Definition at line 40 of file Security.php.
|
protected |
Definition at line 32 of file Security.php.
|
protected |
Definition at line 157 of file Security.php.
|
protected |
Definition at line 179 of file Security.php.
|
protected |
Definition at line 190 of file Security.php.
|
protected |
Definition at line 195 of file Security.php.
|
protected |
Definition at line 200 of file Security.php.
|
protected |
Definition at line 36 of file Security.php.
purge | ( | $days = null | ) |
Purge the ban registration files.
int | $days | Number of days after which a file should be purged (defaultPurgeDays when null) |
Definition at line 104 of file Security.php.
server | ( | $name | ) |
Perform a server check.
string | $name | Name of the check. |
Definition at line 93 of file Security.php.
unBan | ( | $addr | ) |
Unban a client's IP address.
string | $addr |
Definition at line 83 of file Security.php.
|
protected |
Definition at line 44 of file Security.php.
|
protected |
Definition at line 24 of file Security.php.
|
protected |
|
protected |
Definition at line 23 of file Security.php.
|
protected |
Path to store the ban registration files (temp path if empty).
Definition at line 19 of file Security.php.
|
protected |
True IP-address of the client client (optionally behind a white-listed proxy).
Definition at line 22 of file Security.php.
$allowlist = [] |
IP-addresses (key; CIDR notation; seperate with semi-colon) to exclude from certain checks.
Definition at line 9 of file Security.php.
$banCount = 5 |
Number of registrations that will get you banned.
Definition at line 16 of file Security.php.
$blocklist = [] |
IP-addresses to ban anyhow (array of IP-address, optionally in CIDR notation).
Definition at line 11 of file Security.php.
$bruteForceDelay = 10 |
Default time (seconds) a brute force check stays in the registry.
Definition at line 15 of file Security.php.
$defaultDelay = 3600 |
Default time (seconds) a ban reason stays in the registry.
Definition at line 14 of file Security.php.
$defaultPurgeDays = 14 |
Default number of days after which a ban file will be purged.
Definition at line 13 of file Security.php.
$ext = '.ban' |
Extension for ban registration file.
Definition at line 12 of file Security.php.
$proxies = [] |
Proxy white-list (key = proxy IP-address (optionally in CIDR notation), value = header to use.
Definition at line 7 of file Security.php.
$server = [] |
Server checks configuration (key = name, value = config as assoc.array).
Definition at line 17 of file Security.php.