Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
ISPConfig 3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Helmo
ISPConfig 3
Commits
bb0a6589
Commit
bb0a6589
authored
7 years ago
by
Till Brehm
Browse files
Options
Downloads
Patches
Plain Diff
Implemented
#4903
Extend IDS system to allow different settings for clients and admin
parent
f93c9548
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
interface/lib/classes/ids.inc.php
+21
-3
21 additions, 3 deletions
interface/lib/classes/ids.inc.php
security/security_settings.ini
+12
-4
12 additions, 4 deletions
security/security_settings.ini
with
33 additions
and
7 deletions
interface/lib/classes/ids.inc.php
+
21
−
3
View file @
bb0a6589
...
@@ -118,7 +118,25 @@ class ids {
...
@@ -118,7 +118,25 @@ class ids {
$impact
=
$ids_result
->
getImpact
();
$impact
=
$ids_result
->
getImpact
();
if
(
$impact
>=
$security_config
[
'ids_log_level'
])
{
// Choose level from security config
if
(
$app
->
auth
->
is_admin
())
{
// User is admin
$ids_log_level
=
$security_config
[
'ids_admin_log_level'
];
$ids_warn_level
=
$security_config
[
'ids_admin_warn_level'
];
$ids_block_level
=
$security_config
[
'ids_admin_block_level'
];
}
elseif
(
is_array
(
$_SESSION
[
's'
][
'user'
])
&&
$_SESSION
[
's'
][
'user'
][
'userid'
]
>
0
)
{
// User is Client or Reseller
$ids_log_level
=
$security_config
[
'ids_user_log_level'
];
$ids_warn_level
=
$security_config
[
'ids_user_warn_level'
];
$ids_block_level
=
$security_config
[
'ids_user_block_level'
];
}
else
{
// Not logged in
$ids_log_level
=
$security_config
[
'ids_anon_log_level'
];
$ids_warn_level
=
$security_config
[
'ids_anon_warn_level'
];
$ids_block_level
=
$security_config
[
'ids_anon_block_level'
];
}
if
(
$impact
>=
$ids_log_level
)
{
$ids_log
=
ISPC_ROOT_PATH
.
'/temp/ids.log'
;
$ids_log
=
ISPC_ROOT_PATH
.
'/temp/ids.log'
;
if
(
!
is_file
(
$ids_log
))
touch
(
$ids_log
);
if
(
!
is_file
(
$ids_log
))
touch
(
$ids_log
);
...
@@ -132,11 +150,11 @@ class ids {
...
@@ -132,11 +150,11 @@ class ids {
}
}
if
(
$impact
>=
$
security_config
[
'
ids_warn_level
'
]
)
{
if
(
$impact
>=
$ids_warn_level
)
{
$app
->
log
(
"PHP IDS Alert."
.
$ids_result
,
2
);
$app
->
log
(
"PHP IDS Alert."
.
$ids_result
,
2
);
}
}
if
(
$impact
>=
$
security_config
[
'
ids_block_level
'
]
)
{
if
(
$impact
>=
$ids_block_level
)
{
$app
->
error
(
"Possible attack detected. This action has been logged."
,
''
,
true
,
2
);
$app
->
error
(
"Possible attack detected. This action has been logged."
,
''
,
true
,
2
);
}
}
...
...
This diff is collapsed.
Click to expand it.
security/security_settings.ini
+
12
−
4
View file @
bb0a6589
...
@@ -19,10 +19,18 @@ password_reset_allowed=yes
...
@@ -19,10 +19,18 @@ password_reset_allowed=yes
session_regenerate_id
=
yes
session_regenerate_id
=
yes
[ids]
[ids]
ids_enabled
=
no
ids_anon_enabled
=
yes
ids_log_level
=
1
ids_anon_log_level
=
1
ids_warn_level
=
5
ids_anon_warn_level
=
5
ids_block_level
=
100
ids_anon_block_level
=
10
ids_user_enabled
=
yes
ids_user_log_level
=
1
ids_user_warn_level
=
10
ids_user_block_level
=
50
ids_admin_enabled
=
no
ids_admin_log_level
=
1
ids_admin_warn_level
=
5
ids_admin_block_level
=
100
sql_scan_enabled
=
yes
sql_scan_enabled
=
yes
sql_scan_action
=
warn
sql_scan_action
=
warn
apache_directives_scan_enabled
=
yes
apache_directives_scan_enabled
=
yes
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment