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

[match] fix match nuke not deleting decrypted files #20776

Merged

Conversation

revolter
Copy link
Collaborator

@revolter revolter commented Oct 21, 2022

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

I noticed that running fastlane match nuke and cancelling it (answering n to "Do you really want to nuke everything listed above? (y/n)") causes the decrypted git repo to remain in the temp folder, which I personally think it's a security issue.

Description

I added an ensure block that deletes it, similar to the runner.rb file.

Testing Steps

Add

gem 'fastlane', git: 'https://github.com/revolter/fastlane.git', branch: 'security/match-nuke-cancel-decrypted-files'

to your Gemfile, and run bundle install to apply the changes.

Then run bundle exec fastlane match nuke development, then press n, and see that a folder like /var/folders/73/rlp8bl_x5lg1vbv1xbz159d40000gn/T/d20221021-22249-cq51af still exists, which contains the decrypted certificates and profiles.

@revolter revolter marked this pull request as draft October 22, 2022 06:35
@revolter revolter changed the title [match] Fix cancelling match nuke not deleting decrypted files [match] Fix match nuke not deleting decrypted files Oct 23, 2022
@revolter revolter force-pushed the security/match-nuke-cancel-decrypted-files branch from 0f5634d to 1fbb55f Compare October 23, 2022 19:53
@revolter revolter marked this pull request as ready for review October 23, 2022 19:53
@revolter revolter force-pushed the security/match-nuke-cancel-decrypted-files branch from 1fbb55f to 868db12 Compare October 24, 2022 05:47
Copy link
Member

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great find!! 🙌

match/lib/match/commands_generator.rb Show resolved Hide resolved
@rogerluan rogerluan changed the title [match] Fix match nuke not deleting decrypted files [match] fix match nuke not deleting decrypted files Oct 25, 2022
Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh this is amazing! Thanks for finding and fixing this 😊

Also... hello 👋 🥰

@joshdholtz joshdholtz merged commit 62fc877 into fastlane:master Nov 12, 2022
@fastlane-bot
Copy link

Hey @revolter 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

Congratulations! 🎉 This was released as part of fastlane 2.211.0 🚀

@revolter revolter deleted the security/match-nuke-cancel-decrypted-files branch November 16, 2022 21:19
@revolter
Copy link
Collaborator Author

Hello 🤗 Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants