PHP code example of yorcreative / laravel-scrubber
1. Go to this page and download the library: Download yorcreative/laravel-scrubber library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
yorcreative / laravel-scrubber example snippets
return [
'redaction' => '**redacted**', // Define what you want to overwrite detected information with?
'secret_manager' => [
'key' => '44mfXzhGl4IiILZ844mfXzhGl4IiILZ8', // key for cipher to use
'cipher' => 'AES-256-CBC',
'enabled' => false, // Do you want this enabled?
'providers' => [
'gitlab' => [
'enabled' => false,
'project_id' => env('GITLAB_PROJECT_ID', ''),
'token' => env('GITLAB_TOKEN', ''),
'host' => 'https://gitlab.com',
'keys' => ['*'], // * will grab all the secrets, if you want specific variables
// define the keys in an array
],
],
],
'regex_loader' => ['*'] // Opt-in to specific regex classes OR
namespace App\Scrubber\RegexCollection;
use YorCreative\Scrubber\Interfaces\RegexCollectionInterface;
class TestRegex implements RegexCollectionInterface
{
public function getPattern(): string
{
/**
* @note return a regex pattern to detect a specific piece of sensitive data.
*/
return '(?<=basic) [a-zA-Z0-9=:\\+\/-]{5,100}';
}
public function getTestableString(): string
{
/**
* @note return a string that can be used to verify the regex pattern provided.
*/
return 'basic f9Iu+YwMiJEsQu/vBHlbUNZRkN/ihdB1sNTU';
}
public function getReplacementValue(): string
{
/**
* @note return a string that replaces the regex pattern provided.
*/
return config('scrubber.redaction');
}
public function isSecret(): bool
{
return false;
}
}