[−][src]Struct rusty_hogs::SecretScanner
Contains helper functions and the map of regular expressions that are used to find secrets
The main object that provides the "secret scanning" functionality. The regex_map
field
provides all the regular expressions that the secret scanner will look for.
Use get_matches(line: [u8])
to perform a regex.find_iter()
for each regular expression in
regex_map
. get_matches
will return another
BTreeMap
where the key is
the name of the regular expression and the value is a
Matches
object.
Fields
regex_map: BTreeMap<String, Regex>
pretty_print: bool
output_path: Option<String>
Methods
impl SecretScanner
[src]
pub fn set_logging(verbose_level: u64)
[src]
Helper function to set global logging level
pub fn matches<'a, 'b: 'a>(
&'a self,
line: &'b [u8]
) -> BTreeMap<&'a String, Matches>
[src]
&'a self,
line: &'b [u8]
) -> BTreeMap<&'a String, Matches>
Scan a byte array for regular expression matches, returns a BTreeMap
of Matches
for each
regular expression.
pub fn entropy_findings(line: &[u8]) -> Vec<String>
[src]
Scan a byte array for arbitrary hex sequences and base64 sequences. Will return a list of matches for those sequences with a high amount of entropy, potentially indicating a private key.
pub fn output_findings<T: Serialize + Eq + Hash>(&self, findings: &HashSet<T>)
[src]
Helper function that takes a HashSet of serializable structs and outputs them as JSON
Side effect: May write to the file-system based on self.output_path
Trait Implementations
impl Clone for SecretScanner
[src]
fn clone(&self) -> SecretScanner
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SecretScanner
[src]
impl Default for SecretScanner
[src]
impl Display for SecretScanner
[src]
impl Eq for SecretScanner
[src]
impl Hash for SecretScanner
[src]
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SecretScanner> for SecretScanner
[src]
Auto Trait Implementations
impl !RefUnwindSafe for SecretScanner
impl Send for SecretScanner
impl Sync for SecretScanner
impl Unpin for SecretScanner
impl !UnwindSafe for SecretScanner
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> Typeable for T where
T: Any,
T: Any,