Saturday, April 20, 2024
HomePHPTake away Delicate Data from Laravel Apps

Take away Delicate Data from Laravel Apps


Laravel Scrubber is a Laravel package deal to wash delicate info that breaks operational safety insurance policies from being leaked on accident or not by builders.

You need to use this package deal in a number of methods:

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

1Log::data('some message', [

2 'context' => 'accidental',

3 'leak_of' => [

4 'jwt' => '<insert jwt token here>'

5 ]

6]);

7 

8// testing.INFO: some message {"context":"unintended","leak_of":{"jwt": '**redacted**'}}

9 

10Log::data('<insert jwt token right here>');

11 

12// testing.INFO: **redacted**

Second, you should use the scrubber on to course of information in an array and mark it as redacted:

1Scrubber::processMessage([

2 'context' => 'accidental',

3 'leak_of' => [

4 'jwt' => '<insert jwt token here>'

5 ]

6]);

7 

8// [

9// "context" => "accidental"

10// "leak_of" => [

11// "jwt" => "**redacted**"

12// ]

13// ];

14 

15Scrubber::processMessage('<insert jwt token right here>');

16// **redacted**

This package deal additionally offers customization choices, similar to configuring the substitute message when information is scrubbed (the default is **redacted**). You too can prolong the package deal by including customized regex scrubbers.

You can begin with Laravel Scrubber by trying out the venture on GitHub at YorCreative/Laravel-Scrubber.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments