-
Notifications
You must be signed in to change notification settings - Fork 582
fqdn_rotate: Don't use the value itself as part of the random seed #462
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
fqdn_rotate: Don't use the value itself as part of the random seed #462
Conversation
|
Hi @elyscape , I think I like that change, but I'm having a hard time to put into words why this is needed. Would you mind enhancing the commit message to explain that? |
The result of the test was: PASS I am a beta ci bot. I am probably lying to you. |
@DavidS: Sure. Will do. |
The result of the test was: PASS I am a beta ci bot. I am probably lying to you. |
a8cf2dc
to
2478c40
Compare
@DavidS: Done. |
Hold up, there's a bug in the spec tests. |
Previously, the random number generator was seeded with the array or string to be rotated in addition to any values specifically provided for seeding. This behavior is potentially insecure in that it allows an attacker who can modify the source data to choose the post-shuffle order.
2478c40
to
d7c8460
Compare
Or not. By chance, the rotation in this test is the same before and after the change. That being said, question: why was this test added? it {
pending("Current implementation ignores parameters after the first.")
is_expected.to run.with_params("one", "two").and_raise_error(Puppet::ParseError)
} This has never been the case. It has always accepted a seed in the second parameter. In light of that, I have removed it. |
Ah, looks like there are no spec tests for the custom seed functionality. I'll add some real quick. |
The result of the test was: PASS I am a beta ci bot. I am probably lying to you. |
The result of the test was: PASS I am a beta ci bot. I am probably lying to you. |
Okay, improved spec tests are in. Improved acceptance tests will come in another PR that will also improve the acceptance tests for |
The result of the test was: PASS I am a beta ci bot. I am probably lying to you. |
1e9d82e
to
b436216
Compare
The result of the test was: PASS I am a beta ci bot. I am probably lying to you. |
…ment fqdn_rotate: Don't use the value itself as part of the random seed
Thank you for this work! |
Previously, the random number generator was seeded with the array or string to be rotated in addition to any values specifically provided for seeding. This behavior is potentially insecure in that it allows an attacker who can modify the source data to choose the post-shuffle order. While this is probably not a particularly big issue, it's still worth changing.
This also improves the documentation for
fqdn_rotate
.