• Reading time ~ 1 min
  • 10.09.2022

Laravel Scrubber is a Laravel package to scrub sensitive information that breaks operational security policies from being leaked on accident or not by developers.

You can use this package in a few ways:

First, this package detects log messages and context patterns and scrubs them:

Log::info('some message', [
    'context' => 'accidental',
    'leak_of' => [
        'jwt' => '<insert jwt token here>'
    ]
]);
 
// testing.INFO: some message {"context":"accidental","leak_of":{"jwt": '**redacted**'}}
 
Log::info('<insert jwt token here>');
 
// testing.INFO: **redacted**

Second, you can use the scrubber directly to process data in an array and mark it as redacted:

Scrubber::processMessage([
    'context' => 'accidental',
    'leak_of' => [
        'jwt' => '<insert jwt token here>'
    ]
]);
 
// [
//     "context" => "accidental"
//     "leak_of" => [
//         "jwt" => "**redacted**"
//     ]
// ];
 
Scrubber::processMessage('<insert jwt token here>');
// **redacted**

This package also provides customization options, such as configuring the replacement message when data is scrubbed (the default is **redacted**). You can also extend the package by adding custom regex scrubbers.

You can start with Laravel Scrubber by checking out the project on GitHub at YorCreative/Laravel-Scrubber.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297