Project

General

Profile

Actions

Bug #92098

closed

IpAnonymizationTask Bug

Added by Team Web Web over 3 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
scheduler
Target version:
-
Start date:
2020-08-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

In the IpAnonymizationTask (sys_log) it's possible to set the mask level, but the mask level is not respected in the $queryBuilder statement starting on line 103.

It produces the following SQL query:

SELECT * FROM `sys_log` WHERE (`tstamp` < 1589263965) AND (`IP` <> "") AND (`IP` IS NOT NULL) AND (`IP` NOT LIKE "%.0.0") AND (`IP` LIKE "%::")  ORDER BY uid ASC LIMIT 50

So it assumes that the configured mask level is always 2

$queryBuilder->expr()->notLike(
  $configuration['ipField'],
  $queryBuilder->createNamedParameter('%.0.0', \PDO::PARAM_STR)
 ),

With this statement already level 1 masked records are returned (e.g. 164.27.221.0), which have to be masked again and again.

So the right expression would be

$queryBuilder->expr()->notLike(
  $configuration['ipField'],
  $queryBuilder->createNamedParameter('%.0', \PDO::PARAM_STR)
 ),

Possible solution:

$maskLevelLikeExpr = '%.0.0';
if ($this->mask === 1) {
  $maskLevelLikeExpr = '%.0';
}

// ...
$queryBuilder->expr()->notLike(
  $configuration['ipField'],
  $queryBuilder->createNamedParameter($maskLevelLikeExpr, \PDO::PARAM_STR)
 ),

Maybe the expression for ipv6 addresses has to be changed too.

Kind regards, Wolfgang


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Bug #89788: Scheduler task for IP anonymization exclusionClosed2019-11-27

Actions
Has duplicate TYPO3 Core - Bug #92099: IpAnonymizationTask BugClosed2020-08-25

Actions
Actions #1

Updated by Riccardo De Contardi over 3 years ago

  • Has duplicate Bug #92099: IpAnonymizationTask Bug added
Actions #2

Updated by Guido Schmechel over 3 years ago

Thanks for reporting! This is already fixed with version 9: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62992

Since version 8 is no longer supported, a TYPO3 upgrade or manual patching will help you.

Actions #3

Updated by Guido Schmechel over 3 years ago

  • Related to Bug #89788: Scheduler task for IP anonymization exclusion added
Actions #4

Updated by Riccardo De Contardi over 3 years ago

  • Status changed from New to Closed

I think it is safe to close this issue, as it relates to version 8.7 which was marked unsupported in April 2020.

We encourage you to switch to a supported TYPO3 version; currently that’s v9 and v10. If you’re not able to update to one of these versions, consider opting for Extended Long Term Support, a special service provided by TYPO3 GmbH (https://typo3.com/products/extended-support).

If you think that this is the wrong decision please reopen it or ping me.

Thank you.

Actions

Also available in: Atom PDF