Skip to content

Commit

Permalink
v0.9.3
Browse files Browse the repository at this point in the history
* user graph on /event plot
* clickable countries on svg map
* improve /blacklist management
* index.php in all subdirs to prevent directory listing
* force utf-8 sensor input
  • Loading branch information
arina-tirreno committed Feb 3, 2025
1 parent b9bfa22 commit 90b5806
Show file tree
Hide file tree
Showing 135 changed files with 504 additions and 65 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Tirreno Changelog

## Tirreno v0.9.3

* user graph on /event plot
* clickable countries on svg map
* improve /blacklist management
* index.php in all subdirs to prevent directory listing
* force utf-8 sensor input

## Tirreno v0.9.2

* XSS vulnerability patch
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ The idea for Tirreno arose from a challenge: an online platform was in need of a

While building Tirreno, we concentrated on **privacy**, **trust**, and true **sovereignty**. As a result, we have built Tirreno in a secure and independent manner. The application does not have a long list of development dependencies, nor does it rely on heavy frameworks. This approach minimizes the potential attack surface.

### Why the name Tirreno?
### Why the name tirreno?

History suggests that the Tyrrhenian people may have lived in Tuscany and eastern Switzerland as far back as 800 BC. The term "Tyrrhenian” became more commonly associated with the Etruscans, and it is from them that the Tyrrhenian Sea derives its name — a name still in use today. This name is believed to be an exonym, possibly meaning “tower”.

While working on the logo, we conducted our own historical study and traced mentions of 'tirreno' back to the 15th-century printed edition of the Vulgate (the Latin Bible). We kept it lowercase to stay true to the original — quite literally, by the book.

The tirreno wordmark, positioned beyond a horizon line, as a metaphor for the constant evolution of the cybersecurity landscape and our commitment to staying ahead of these never-ending changes.
The tirreno wordmark, positioned beyond a horizon line, as a metaphor for the constant evolution of the fraud landscape and our commitment to staying ahead of change.

## Links

Expand Down
18 changes: 5 additions & 13 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
Release song: https://youtu.be/8hYgxwmHbxA
Release song: https://youtu.be/bcxnbfRYM-g

Important security update: tirreno v0.9.2.
Tirreno is announcing version v0.9.3.

Today, we received a report from IT security expert Sandro Bauer regarding
an XSS vulnerability in Tirreno. After receiving the report, we confirmed
receipt and immediately reproduced the problem, developing a patch the same
day. Briefly, the XSS vulnerability potentially allows attackers to post
malicious scripts by sending them through a payload. However, it's important
to clarify that the Tirreno platform does not directly receive user event data,
as it must come from the main web application, which we expect to be trustworthy.
Another aspect that makes it difficult to exploit this vulnerability is the
truncation of all data displayed in the dashboard.

The Tirreno team highly appreciates Sandro's report and help in maintaining Tirreno's application security.
This update improves visualization of the 'events' graph by introducing user correlation vs.
events for the selected time period, makes countries on maps clickable, improves sensor
security by enforcing UTF-8 encoding, and includes some minor fixes.
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Api/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Blacklist/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Bot/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Bots/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Context/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Countries/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Country/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Data/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Devices/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Domain/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Domains/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Emails/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Enrichment/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Events/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Home/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/IP/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/IPs/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/ISP/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/ISPs/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Logbook/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/ManualCheck/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Payloads/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Phones/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Resource/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Resources/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/ReviewQueue/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Rules/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Search/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Settings/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Totals/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
2 changes: 1 addition & 1 deletion app/Controllers/Admin/User/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public function addToBlacklistQueue(int $accountId, bool $fraud): void {
}
}

if (!$apiKey->skip_blacklist_sync && !$inQueue && $fraud) {
if (!$inQueue && $fraud) {
$accountOperationQueueModel->add($accountId, $apiKey->id);
}

Expand Down
3 changes: 3 additions & 0 deletions app/Controllers/Admin/User/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/UserDetails/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Users/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/Watchlist/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Admin/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/Pages/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Controllers/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 1 addition & 2 deletions app/Crons/BlacklistQueueHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,8 @@ protected function processItem(array $item): void {

$model = new \Models\ApiKeys();
$model->getKeyById($item['key']);
$skipBlacklistSync = $model->skip_blacklist_sync;

$errorMessage = $skipBlacklistSync ? $this->sendBlacklistReportPostRequest($creator, $hashes) : '';
$errorMessage = $model->skip_blacklist_sync ? $this->sendBlacklistReportPostRequest($creator, $hashes) : '';
if (strlen($errorMessage) > 0) {
// Log error to database
\Utils\Logger::log('Fraud enrichment API curl error', $errorMessage);
Expand Down
9 changes: 8 additions & 1 deletion app/Crons/SynchroniseBlacklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,15 @@ public function synchroniseBlacklist(): void {

// use different access keys for email lists grouped by apiKey
foreach ($groupedEmails as $key => $items) {
$subscriptionKey = $model->getKeyById($key)->token;
$keyModel = $model->getKeyById($key);
if ($keyModel->skip_blacklist_sync) {
$this->log(sprintf('Skip synchronising blacklist for key %s.', strval($key)));
continue;
}

$subscriptionKey = $keyModel->token;
if ($subscriptionKey === null) {
$this->log(sprintf('Skip synchronising blacklist for key %s due to missing subscription key.', strval($key)));
continue;
}

Expand Down
3 changes: 3 additions & 0 deletions app/Crons/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Dictionary/en/Additional/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Dictionary/en/Pages/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Dictionary/en/Parts/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Dictionary/en/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Dictionary/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Interfaces/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Api/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
6 changes: 4 additions & 2 deletions app/Models/Chart/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,17 @@ public function getData(int $apiKey): array {

$ox = array_column($data, 'ts');
$l1 = array_column($data, 'event_count');
$l2 = array_column($data, 'users_count');

return $this->addEmptyDays([$ox, $l1]);
return $this->addEmptyDays([$ox, $l1, $l2]);
}

private function getFirstLine(int $apiKey): array {
$query = (
'SELECT
EXTRACT(EPOCH FROM date_trunc(:resolution, event.time + :offset))::bigint AS ts,
COUNT(event.id) AS event_count
COUNT(event.id) AS event_count,
COUNT(DISTINCT event.account) AS users_count
FROM
event
Expand Down
3 changes: 3 additions & 0 deletions app/Models/Chart/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Context/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Enrichment/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Base/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
6 changes: 6 additions & 0 deletions app/Models/Grid/Blacklist/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,10 @@ public function __construct(int $apiKey) {
public function getAllBlacklistedItems(): array {
return $this->getGrid();
}

protected function convertTimeToUserTimezone(array &$result): void {
$fields = ['created'];

$this->translateTimeZones($result, $fields);
}
}
3 changes: 3 additions & 0 deletions app/Models/Grid/Blacklist/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Bots/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Countries/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Devices/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Domains/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Emails/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Events/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Ips/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Isps/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Logbook/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Payloads/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Phones/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Resources/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/ReviewQueue/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/Users/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
3 changes: 3 additions & 0 deletions app/Models/Grid/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

//
4 changes: 2 additions & 2 deletions app/Models/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public function updateTotalsByEntityIds(array $ids, int $apiKey, bool $force = f
"UPDATE event_ip
SET
total_visit = COALESCE(sub.total_visit, 0),
shared = COALESCE(sub.shared, 0),
shared = COALESCE(sub.shared, 1),
updated = date_trunc('milliseconds', now())
FROM (
SELECT
Expand Down Expand Up @@ -257,7 +257,7 @@ public function updateTotalsByAccountIds(array $ids, int $apiKey): int {
"UPDATE event_ip
SET
total_visit = COALESCE(sub.total_visit, 0),
shared = COALESCE(sub.shared, 0),
shared = COALESCE(sub.shared, 1),
updated = date_trunc('milliseconds', now())
FROM (
SELECT
Expand Down
Loading

0 comments on commit 90b5806

Please sign in to comment.