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

When redactors error, files do not get written back to the support bundle #1341

Open
banjoh opened this issue Sep 14, 2023 · 1 comment
Open
Labels
bug::normal type::bug Something isn't working

Comments

@banjoh
Copy link
Member

banjoh commented Sep 14, 2023

Bug Description

If any of the redactors have an error, any error, and the execution ends up here in this example, the file that was being redacted will not be written back to the support bundle. Instead, and empty file with two new lines will be there.

Expected Behavior

If there is an error from any of the redactors, the error should be logged an that redactor ignored. The file should continue getting redacted by the other redactors in the pipeline and the results written back to the support bundle.

Steps To Reproduce

  • Generate a file, with no newlines, larger than 10MB (the max size of a line to reduct)
base64 /dev/urandom | head -c 20000000 | tr -d '\n' > data.log
  • Collect a support bundle using the spec below - support-bundle spec.yaml
apiVersion: troubleshoot.sh/v1beta2
kind: SupportBundle
metadata:
  name: sample
spec:
  hostCollectors:
    - copy:
        collectorName: random-data
        path: <absolute_directory_of_generated_file>/data.log
  • Observe that the support bundle will have an empty version of your generated file
tar xf support-bundle-<timestamp>.tar.gz
cat support-bundle-<timestamp>/host-collectors/random-data/data.log

Include the following information.

  • Troubleshoot version. If you built from source, note that including the version of Go you used to build with.
  • Operating system
  • Operating system version
  • Other details that might be helpful in diagnosing the problem
@banjoh banjoh added type::bug Something isn't working bug::normal labels Sep 14, 2023
@banjoh banjoh changed the title When redactors error files do not get written back to the support bundle When redactors error, files do not get written back to the support bundle Sep 15, 2023
@xavpaice
Copy link
Member

If a redactor fails, we should not include that file in the final output since it may contain un-redacted information leading to a security breach.

We should, however, improve the error logging so that this can be diagnosed more cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug::normal type::bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants