Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantmimani committed Nov 11, 2021
1 parent d502512 commit db00e32
Showing 1 changed file with 3 additions and 27 deletions.
30 changes: 3 additions & 27 deletions docs/source/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,41 +277,17 @@ Entropy Limiting

Entropy scans can produce a high number of false positives such as git SHAs or md5
digests. To avoid these false positives, enable ``exclude-entropy-patterns``. Exclusions
apply to any strings flagged by entropy checks.
apply to any strings flagged by entropy checks. This option is not available on the command line,
and must be specified in your config file.

For example, if ``docs/README.md`` contains a git SHA, this would be flagged by entropy.
To exclude this, add ``docs/.*\.md$::^[a-zA-Z0-9]{40}$`` to ``exclude-entropy-patterns``.

.. code-block:: sh
> tartufo ... --exclude-entropy-patterns "docs/.*\.md$::^[a-zA-Z0-9]{40}$"
.. code-block:: toml
[tool.tartufo]
exclude-entropy-patterns = [
# format: "{file regex}::{entropy pattern}"
"docs/.*\.md$::^[a-zA-Z0-9]{40}$", # exclude all git SHAs in the docs directory
]
.. warning::
.. versionchanged:: 2.9.0
As of version 2.9.0, the above specification style has been deprecated, and
will be removed in version 3.0. The new style uses a TOML `array of tables`_
as shown below.

Note that this new syntax is not available on the command line, and must be
specified in your config file.

Here is an example of how you might exclude SHA hashes in your docs, as well as
hashes for GitHub Actions in your workflows:
To exclude this, add an entry to ``exclude-entropy-patterns`` in the config file.

.. code-block:: toml
[tool.tartufo]
exclude-entropy-patterns = [
{path-pattern = 'docs/.*\.md$', pattern = '^[a-zA-Z0-9]$', reason = 'exclude all git SHAs in the docs'},
{path-pattern = '\.github/workflows/.*\.yml', pattern = 'uses: .*@[a-zA-Z0-9]{40}', reason = 'GitHub Actions'}
]
Thanks to the magic of TOML, you could also split these out into their own tables
Expand Down

0 comments on commit db00e32

Please sign in to comment.