Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Update #449

Merged
merged 8 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ Options:
Check the names of files being scanned as
well as their contents. [default: scan-
filenames]
-of, --output-format [json|compact|text]
-of, --output-format [json|compact|text|report]
Specify the format in which the output needs
to be generated `--output-format
json/compact/text`. Either `json`, `compact`
or `text` can be specified. If not provided
`text` or `report` can be specified. If not provided
(default) the output will be generated in
`text` format.
-od, --output-dir DIRECTORY If specified, all issues will be written out
Expand Down
8 changes: 6 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# It appears sphinx generates scripts with relative #! strings that get confused
# easily. Try to coerce them to do the right thing
REAL := python $(shell which $(SPHINXBUILD))

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(REAL) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(REAL) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
50 changes: 0 additions & 50 deletions docs/source/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,28 +70,13 @@ body of what was found and determine that for yourself. But let's say that this
really is okay, and we want tell ``tartufo`` to ignore this issue in future
scans. To do this, you can add it to your config file.

.. code-block:: toml

[tool.tartufo]
exclude-signatures = [
"2a3cb329b81351e357b09f1b97323ff726e72bd5ff8427c9295e6ef68226e1d1",
]

Done! This particular issue will no longer show up in your scan results.

As of version 3.0, a new format for specifying exclusion signatures has been added.

.. code-block:: toml

[tool.tartufo]
exclude-signatures = [
{signature = "2a3cb329b81351e357b09f1b97323ff726e72bd5ff8427c9295e6ef68226e1d1", reason = "reason for exclusion"},
]

.. note::

Currently both formats of signature exclusions are supported. However, only `TOML`_ `array of tables`_ format
will be supported in future versions.

.. _limiting-scans-by-paths:

Expand All @@ -107,37 +92,6 @@ Python Regular Expressions (regex) and the `--include-path-patterns` and
creation of new secrets if future files don't match an existing include
rule. We recommend only using fine-grained exclude patterns instead.

.. code-block:: toml

[tool.tartufo]
include-path-patterns = [
'src/',
'gradle/',
# regexes must match the entire path, but can use python's regex syntax
# for case-insensitive matching and other advanced options
'(.*/)?id_[rd]sa$',
# Single quoted strings in TOML don't require escapes for `\` in regexes
'(?i).*\.(properties|conf|ini|txt|y(a)?ml)$',
]
exclude-path-patterns = [
'(.*/)?\.classpath$',
'.*\.jmx$',
'(.*/)?test/(.*/)?resources/',
]

The filter expressions can also be specified as command line arguments.
Patterns specified like this are merged with any patterns specified
in the config file:

.. code-block:: sh

> tartufo \
--include-path-patterns 'src/' -ip 'gradle/' \
--exclude-path-patterns '(.*/)?\.classpath$' -xp '.*\.jmx$' \
scan-local-repo file://path/to/my/repo.git

As of version 3.0, a new format for specifying paths has been added.

.. code-block:: toml

[tool.tartufo]
Expand All @@ -148,10 +102,6 @@ As of version 3.0, a new format for specifying paths has been added.
{path-pattern = 'poetry\.lock', reason='reason for exclusion'},
]

.. note::

Currently all 3 formats are supported. However, only `TOML`_ `array of tables`_ format
will be supported in future versions.

Configuration File Exclusive Options
------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion docs/source/examplecleanup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ More on this later!)
mv tartufo.toml tartufo.toml_bak
mv tartufo.toml_new tartufo.toml
# one final run to make sure your signatures are all set
tartufo --regex scan-local-repo ${gitrepo}
tartufo --regex scan-local-repo ${GITHUBREPO}

#. Once you are happy with the data that is being stored, time to commit the
changes back up!
Expand Down
Loading