Выполнение шага 5:
• Updated Plan
└ Продолжаю итерацию 5 как отдельный рабочий срез поверх текущих SSH credentials.
□ Добавить модель/миграцию/repository для host_scans и покрыть repository тестами
□ Добавить SSH command runner и LinuxHostScanner с whitelist read-only команд
□ Подключить controller/routes/UI для запуска deep scan и просмотра результата
□ Прогнать проверки и зафиксировать ограничения Docker-верификации
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Domovoy\Services\Security;
|
||||
|
||||
use Defuse\Crypto\Crypto;
|
||||
|
||||
class CredentialVault
|
||||
{
|
||||
private string $password;
|
||||
|
||||
public function __construct(string $keyMaterial)
|
||||
{
|
||||
if (trim($keyMaterial) === '') {
|
||||
throw new \InvalidArgumentException('ENCRYPTION_KEY is required');
|
||||
}
|
||||
|
||||
$this->password = $keyMaterial;
|
||||
}
|
||||
|
||||
public function encrypt(string $plainText): string
|
||||
{
|
||||
return Crypto::encryptWithPassword($plainText, $this->password);
|
||||
}
|
||||
|
||||
public function decrypt(string $cipherText): string
|
||||
{
|
||||
return Crypto::decryptWithPassword($cipherText, $this->password);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user