directoryscanner

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 6 Imported by: 0

README

directoryscanner

Go Report Card Go GitHub license

A simple go module for scanning directories for sensitive information (or really anything you want)

How to Use

import ds "github.com/audrey-morrisette/directoryscanner"
...
ds.Scan(".")

Scan() returns a slice of strings containing all findings from the given directory

TODO:

  • Add simpler way to add new items to scan for
  • Performance Improvements

Documentation

Overview

Package directoryscanner provides simple directory scanning functionality for sensitive data

Index

Constants

This section is empty.

Variables

View Source
var CompiledRegexes = map[string][]*regexp.Regexp{
	"Credit Card":   {regexp.MustCompile("^(?:4[0-9]{12}(?:[0-9]{3})?|[25][1-7][0-9]{14}|6(?:011|5[0-9][0-9])[0-9]{12}|3[47][0-9]{13}|3(?:0[0-5]|[68][0-9])[0-9]{11}|(?:2131|1800|35\\d{3})\\d{11})$")},
	"SSN":           {regexp.MustCompile("(^\\d{3}-?\\d{2}-?\\d{4}$|^XXX-XX-XXXX$)")},
	"Word Password": {regexp.MustCompile("password")},
	"Word Username": {regexp.MustCompile("username")},
	"Email":         {regexp.MustCompile("^[\\w\\.=-]+@[\\w\\.-]+\\.[\\w]{2,3}$")},
}

CompiledRegexes ... Accessible outside the module so users can add (or remove) whatever they want

Functions

func Find

func Find(path string, dataTypes ...string) ([]string, error)

Find ... begins at the specified path (path) and recursively searches all directories acceptable arguments for variatic function: "Credit Card", "SSN", "Word Password", "Word Username", "Email"

func Scan

func Scan(path string) ([]string, error)

Scan ... begins at the specified path (path) and recursively searches all directories

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL