forked from evolvingweb/puppet-apt
-
Notifications
You must be signed in to change notification settings - Fork 461
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
Harden PPA defined type #1052
Merged
Merged
Harden PPA defined type #1052
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
chelnak
force-pushed
the
maint-harden_ppa
branch
from
August 12, 2022 12:23
8ce2119
to
0dc0df2
Compare
chelnak
force-pushed
the
maint-harden_ppa
branch
from
August 12, 2022 12:28
0dc0df2
to
6e207c4
Compare
LivingInSyn
previously approved these changes
Aug 15, 2022
binford2k
suggested changes
Aug 16, 2022
chelnak
force-pushed
the
maint-harden_ppa
branch
7 times, most recently
from
August 17, 2022 10:32
c1eb559
to
79c9634
Compare
LivingInSyn
reviewed
Aug 17, 2022
chelnak
force-pushed
the
maint-harden_ppa
branch
from
August 17, 2022 14:20
79c9634
to
434ed54
Compare
LivingInSyn
previously approved these changes
Aug 17, 2022
binford2k
previously approved these changes
Aug 17, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one small and optional suggestion
Prior to this commit there was a possibility that malformed strings could be passed as the resources name. This could lead to unsafe executions on a remote system. This was also a possibility for the options parameter as it was constrained to a string. In addition, commands were not properly broken out in to arrays of arguments when passed to the exec resource. This commit fixes the above by adding validation to the resource name ensuring that the given ppa name conforms to expectation. Also, commands are now broken down in to arrays of arguments appropriately. This ensures safer execution on the remote system. Given that the options parameter, passed as a raw string, could lead to unsafe code execution it was reasonable to change the accepted type to an `Optional[Array[String]]. This means that an array of options can now be passed to the exec resource inside the original command.
This commit adds spec tests that validate the changes made in the previous commit.
chelnak
force-pushed
the
maint-harden_ppa
branch
from
August 18, 2022 07:28
434ed54
to
3a90419
Compare
pmcmaw
approved these changes
Aug 18, 2022
LukasAud
added a commit
that referenced
this pull request
Jan 17, 2023
Prior to this commit, one of our updates (#1052) implemented a regex validation for ppa packages that were to be installed. However, this validation did not account for resource names that were dotted. This commit aims to fix this bug in our validation process so that it works as intended.
LukasAud
added a commit
that referenced
this pull request
Jan 18, 2023
Prior to this commit, one of our updates (#1052) implemented a regex validation for ppa packages that were to be installed. However, this validation did not account for resource names that were dotted. This commit aims to fix this bug in our validation process so that it works as intended.
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.
Prior to this PR there was a possibility that malformed strings could be passed as the resources name.
This could lead to unsafe executions on a remote system.
This was also a possibility for the options parameter as it was constrained to a string.
In addition, commands were not properly broken out in to arrays of arguments when passed to the exec resource.
This PR fixes the above by adding validation to the resource name ensuring that the given ppa name conforms to expectation.
Also, commands are now broken down in to arrays of arguments appropriately. This ensures safer execution on the remote system.
Given that the options parameter, passed as a raw string, could lead to unsafe code execution it was reasonable to change the accepted type to an
Optional[Array[String]]
.This means that an array of options can now be passed to the exec resource inside the original command.