From 24bbdcf4723bcc09e8c5d37a9a448b31f5b5bd5a Mon Sep 17 00:00:00 2001 From: kyteinsky Date: Wed, 1 Jul 2026 02:29:47 +0530 Subject: [PATCH 1/2] feat: add millisecond hint to the bruteforce command output Signed-off-by: kyteinsky --- core/Command/Security/BruteforceAttempts.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/Command/Security/BruteforceAttempts.php b/core/Command/Security/BruteforceAttempts.php index 32f68773ac687..61e33b49a5a91 100644 --- a/core/Command/Security/BruteforceAttempts.php +++ b/core/Command/Security/BruteforceAttempts.php @@ -60,6 +60,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int (string)$input->getArgument('action'), ), ]; + if ($input->getOption('output') === 'plain') { + $data['delay'] = $data['delay'] . ' ms'; + } $this->writeArrayInOutputFormat($input, $output, $data); From 738f2371240a28c29797e7cda80d1ef4f79672b0 Mon Sep 17 00:00:00 2001 From: kyteinsky Date: Wed, 1 Jul 2026 02:31:15 +0530 Subject: [PATCH 2/2] feat: add option "interval" to the security:bruteforce:attempts command Signed-off-by: kyteinsky --- core/Command/Security/BruteforceAttempts.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/core/Command/Security/BruteforceAttempts.php b/core/Command/Security/BruteforceAttempts.php index 61e33b49a5a91..6297d28ba9bc5 100644 --- a/core/Command/Security/BruteforceAttempts.php +++ b/core/Command/Security/BruteforceAttempts.php @@ -12,6 +12,7 @@ use OCP\Security\Bruteforce\IThrottler; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; class BruteforceAttempts extends Base { @@ -37,12 +38,20 @@ protected function configure(): void { InputArgument::OPTIONAL, 'Only count attempts for the given action', ) + ->addOption( + 'interval', + null, + InputOption::VALUE_REQUIRED, + 'Interval in hours to count attempts for (max 48)', + 12, + ) ; } #[\Override] protected function execute(InputInterface $input, OutputInterface $output): int { $ip = $input->getArgument('ipaddress'); + $interval = (float)$input->getOption('interval'); if (!filter_var($ip, FILTER_VALIDATE_IP)) { $output->writeln('"' . $ip . '" is not a valid IP address'); @@ -54,6 +63,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int 'attempts' => $this->throttler->getAttempts( $ip, (string)$input->getArgument('action'), + $interval, ), 'delay' => $this->throttler->getDelay( $ip,