-
Notifications
You must be signed in to change notification settings - Fork 560
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
fix: filter out file content from iac test --experimental analytics #1715
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
aron
force-pushed
the
fix/iac-analytics-logging
branch
2 times, most recently
from
March 12, 2021 15:29
7c45f51
to
c6be3af
Compare
aron
changed the title
chore: add regression tests for iac logging
fix: filter out file content from iac test --experimental analytics
Mar 12, 2021
aron
force-pushed
the
fix/iac-analytics-logging
branch
from
March 12, 2021 16:44
40dd18b
to
67e296d
Compare
aron
force-pushed
the
fix/iac-analytics-logging
branch
from
March 12, 2021 20:29
67e296d
to
f42f87e
Compare
rontalx
force-pushed
the
fix/iac-analytics-logging
branch
from
March 14, 2021 08:04
f42f87e
to
b056e7a
Compare
rontalx
force-pushed
the
fix/iac-analytics-logging
branch
from
March 14, 2021 08:12
b056e7a
to
70b32f5
Compare
rontalx
force-pushed
the
fix/iac-analytics-logging
branch
2 times, most recently
from
March 14, 2021 08:14
756bd6c
to
cdf1822
Compare
rontalx
force-pushed
the
fix/iac-analytics-logging
branch
from
March 14, 2021 08:37
a0aa744
to
0a760fe
Compare
I mistakenly messed up the commits, re-opening PR here: |
This was referenced Apr 27, 2023
This was referenced Jun 22, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR do?
We have a minor bug in our Snyk CLI that when the
snyk iac test --experimental
command is run with a directory instead of a single file we include theiacDirFiles
on theoptions
object. This options object is then logged as part of the analytics flow and sent to Big Query. We do not want to be storing user file content in any part of our system so this needs to be filtered out here.This PR filters the File content and JSON output from the
iacDirFiles
property added to theoptions
object in the test command and adds a smoke test and unit test to assert that the content is not present.This is not a long term strategy for solving this issue but fixes the immediate problem that prevents users from adopting the beta. In future we'll want to decouple the file + parsed content from any metadata and ensure that the file content is only passed where needed and discarded when used. We should also look into using a whitelist for the logger to only allow specific arguments to be logged.
Where should the reviewer start?
Start at the smoke tests then the
test()
function and finish up with the unit tests. The unit tests are really a temporary measure I think to ensure that theiacDirFiles
object is clean, we can remove the tests when the flow has been refactored.How should this be manually tested?
Run the following and verify that the "args" property under analytics is clean of file content.