feat(redactors): Run redactors on an existing support bundle (#887)

* feat(redactors): Run redactors on an existing support bundle

Add redact subcommand to support-bundle to allow running redactors on an
existing bundle to creating a new redacted bundle.

The command will be launched like so

support-bundle redact <redactor urls> --bundle support-bundle.tar.gz

Fixes: #705
This commit is contained in:
Evans Mungai
2023-01-03 18:05:15 +00:00
committed by GitHub
parent d73d5c6a3a
commit a523551da9
33 changed files with 502 additions and 154 deletions

View File

@@ -17,7 +17,7 @@ preflight [url] [flags]
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uid string UID to impersonate for the operation.
--cache-dir string Default cache directory (default "/Users/xavpaice/.kube/cache")
--cache-dir string Default cache directory (default "$HOME/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
@@ -48,4 +48,4 @@ preflight [url] [flags]
* [preflight version](preflight_version.md) - Print the current version and exit
###### Auto generated by spf13/cobra on 21-Nov-2022
###### Auto generated by spf13/cobra on 22-Dec-2022

View File

@@ -35,4 +35,4 @@ preflight version [flags]
* [preflight](preflight.md) - Run and retrieve preflight checks in a cluster
###### Auto generated by spf13/cobra on 21-Nov-2022
###### Auto generated by spf13/cobra on 22-Dec-2022

View File

@@ -8,7 +8,7 @@ A support bundle is an archive of files, output, metrics and state
from a server that can be used to assist when troubleshooting a Kubernetes cluster.
```
support-bundle [url] [flags]
support-bundle [urls...] [flags]
```
### Options
@@ -17,7 +17,7 @@ support-bundle [url] [flags]
--as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
--as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
--as-uid string UID to impersonate for the operation.
--cache-dir string Default cache directory (default "/Users/xavpaice/.kube/cache")
--cache-dir string Default cache directory (default "$HOME/.kube/cache")
--certificate-authority string Path to a cert file for the certificate authority
--client-certificate string Path to a client certificate file for TLS
--client-key string Path to a client key file for TLS
@@ -47,7 +47,8 @@ support-bundle [url] [flags]
### SEE ALSO
* [support-bundle analyze](support-bundle_analyze.md) - analyze a support bundle
* [support-bundle version](support-bundle_version.md) - Print the current version and exit
* [support-bundle analyze](support-bundle_analyze.md) - analyze a support bundle
* [support-bundle redact](support-bundle_redact.md) - Redact information from a generated support bundle archive
* [support-bundle version](support-bundle_version.md) - Print the current version and exit
###### Auto generated by spf13/cobra on 21-Nov-2022
###### Auto generated by spf13/cobra on 22-Dec-2022

View File

@@ -23,4 +23,4 @@ support-bundle analyze [url] [flags]
* [support-bundle](support-bundle.md) - Generate a support bundle
###### Auto generated by spf13/cobra on 21-Nov-2022
###### Auto generated by spf13/cobra on 22-Dec-2022

View File

@@ -0,0 +1,35 @@
## support-bundle redact
Redact information from a generated support bundle archive
### Synopsis
Redaction is the process of masking sensitive information from collected data in a support bundle.
This is done using rules defined in the list of redactor manifests provided in the [urls...] command line
argument. Default built in redactors will also be run, but these would have been run when the support
bundle was generated. After redaction, the support bundle is archived once more. The resulting file will
be stored in the current directory in the path provided by the --output flag.
The [urls...] argument is a list of either oci://.., http://.., https://.. or local paths to yaml files.
For more information on redactors visit https://troubleshoot.sh/docs/redact/
```
support-bundle redact [urls...] [flags]
```
### Options
```
--bundle string file path of the support bundle archive to redact
-h, --help help for redact
-o, --output string file path of where to save the redacted support bundle archive (default "redacted-support-bundle-YYYY-MM-DDTHH_MM_SS.tar.gz")
-q, --quiet enable/disable error messaging and only show parseable output
```
### SEE ALSO
* [support-bundle](support-bundle.md) - Generate a support bundle
###### Auto generated by spf13/cobra on 22-Dec-2022

View File

@@ -20,4 +20,4 @@ support-bundle version [flags]
* [support-bundle](support-bundle.md) - Generate a support bundle
###### Auto generated by spf13/cobra on 21-Nov-2022
###### Auto generated by spf13/cobra on 22-Dec-2022