-
Notifications
You must be signed in to change notification settings - Fork 92
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
Debian uses group 42 shadow #33
Debian uses group 42 shadow #33
Conversation
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.
Thank you @timstoop for highlighting and fixing this issue. Your solution will work, I have a small nitpick on the style though. I prefer if tests keep as readable as possible
its(:sticky) { should equal false } | ||
its(:suid) { should equal false } | ||
its(:sgid) { should equal false } | ||
end | ||
if os.debian? |
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.
I think we can make the test more readable if we do the following instead:
expected_gid = 0
expected_gid = 42 if os.debian?
shadow_files.each do |f|
describe file(f) do
...
its(:gid) { should cmp expected_gid }
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.
Honestly, I'm not very good at Ruby (I'm more a Python guy), so any advice here is appreciated! I'll make the change and push it.
HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop)
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.
Awesome. Thank you @timstoop this reads much better!
* Each MAC entry should be an element in the list. * Check if each MAC is approved instead of specific sets of MACs. * Trying to get syntax right to iterate over array. * Ensuring the MACs list is proper. * Fixing linting error. * Fix checking of password quality items. * Trying to get the check right. * Try using whether a package is installed as the identifier. * pwquality requires a different package on amazon and centos7. * Adding a whole section for cracklib checks also. * Missing an end to a describe. * Working on regex check for password quality. * Got the regex right. * More work on the password options regex. * Fixed regex for cracklib adding back in if statement for package. * Fix linting issues, added an inline ignore to large block length for this control. * Add just a bashrc file for Centos7 and check for file existence before checking for values in it. * Fix file existence syntax. * Wrap block in if statement. * Fix style issues for rubocop. * Remove ruby-version from commit. * Remove Gemfile.lock. * Adjust modprobe check to remove false positives. * updated regex to account for sha512 not being first option * Fix deprecation warnings. (dev-sec#34) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Change regex to allow multiple spaces. (dev-sec#35) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Debian uses group 42, which is just as secure. (dev-sec#33) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * ubuntu modinfo
* Each MAC entry should be an element in the list. * Check if each MAC is approved instead of specific sets of MACs. * Trying to get syntax right to iterate over array. * Ensuring the MACs list is proper. * Fixing linting error. * Fix checking of password quality items. * Trying to get the check right. * Try using whether a package is installed as the identifier. * pwquality requires a different package on amazon and centos7. * Adding a whole section for cracklib checks also. * Missing an end to a describe. * Working on regex check for password quality. * Got the regex right. * More work on the password options regex. * Fixed regex for cracklib adding back in if statement for package. * Fix linting issues, added an inline ignore to large block length for this control. * Add just a bashrc file for Centos7 and check for file existence before checking for values in it. * Fix file existence syntax. * Wrap block in if statement. * Fix style issues for rubocop. * Remove ruby-version from commit. * Remove Gemfile.lock. * Adjust modprobe check to remove false positives. * updated regex to account for sha512 not being first option * Fix deprecation warnings. (dev-sec#34) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Change regex to allow multiple spaces. (dev-sec#35) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Debian uses group 42, which is just as secure. (dev-sec#33) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * ubuntu modinfo * update
* Each MAC entry should be an element in the list. * Check if each MAC is approved instead of specific sets of MACs. * Trying to get syntax right to iterate over array. * Ensuring the MACs list is proper. * Fixing linting error. * Fix checking of password quality items. * Trying to get the check right. * Try using whether a package is installed as the identifier. * pwquality requires a different package on amazon and centos7. * Adding a whole section for cracklib checks also. * Missing an end to a describe. * Working on regex check for password quality. * Got the regex right. * More work on the password options regex. * Fixed regex for cracklib adding back in if statement for package. * Fix linting issues, added an inline ignore to large block length for this control. * Add just a bashrc file for Centos7 and check for file existence before checking for values in it. * Fix file existence syntax. * Wrap block in if statement. * Fix style issues for rubocop. * Remove ruby-version from commit. * Remove Gemfile.lock. * Adjust modprobe check to remove false positives. * updated regex to account for sha512 not being first option * Fix deprecation warnings. (dev-sec#34) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Change regex to allow multiple spaces. (dev-sec#35) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Debian uses group 42, which is just as secure. (dev-sec#33) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * ubuntu modinfo * update * update
* Each MAC entry should be an element in the list. * Check if each MAC is approved instead of specific sets of MACs. * Trying to get syntax right to iterate over array. * Ensuring the MACs list is proper. * Fixing linting error. * Fix checking of password quality items. * Trying to get the check right. * Try using whether a package is installed as the identifier. * pwquality requires a different package on amazon and centos7. * Adding a whole section for cracklib checks also. * Missing an end to a describe. * Working on regex check for password quality. * Got the regex right. * More work on the password options regex. * Fixed regex for cracklib adding back in if statement for package. * Fix linting issues, added an inline ignore to large block length for this control. * Add just a bashrc file for Centos7 and check for file existence before checking for values in it. * Fix file existence syntax. * Wrap block in if statement. * Fix style issues for rubocop. * Remove ruby-version from commit. * Remove Gemfile.lock. * Adjust modprobe check to remove false positives. * updated regex to account for sha512 not being first option * Fix deprecation warnings. (dev-sec#34) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Change regex to allow multiple spaces. (dev-sec#35) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Debian uses group 42, which is just as secure. (dev-sec#33) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * ubuntu modinfo * update * update * update
* Each MAC entry should be an element in the list. * Check if each MAC is approved instead of specific sets of MACs. * Trying to get syntax right to iterate over array. * Ensuring the MACs list is proper. * Fixing linting error. * Fix checking of password quality items. * Trying to get the check right. * Try using whether a package is installed as the identifier. * pwquality requires a different package on amazon and centos7. * Adding a whole section for cracklib checks also. * Missing an end to a describe. * Working on regex check for password quality. * Got the regex right. * More work on the password options regex. * Fixed regex for cracklib adding back in if statement for package. * Fix linting issues, added an inline ignore to large block length for this control. * Add just a bashrc file for Centos7 and check for file existence before checking for values in it. * Fix file existence syntax. * Wrap block in if statement. * Fix style issues for rubocop. * Remove ruby-version from commit. * Remove Gemfile.lock. * Adjust modprobe check to remove false positives. * updated regex to account for sha512 not being first option * Fix deprecation warnings. (dev-sec#34) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Change regex to allow multiple spaces. (dev-sec#35) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * Debian uses group 42, which is just as secure. (dev-sec#33) HardeningFramework-DCO-1.1-Signed-off-by: Tim Stoop <github@timstoop.nl> (github: timstoop) * ubuntu modinfo * update * update * update * ubuntu update
* refactor `attribute()` -> `input()` * fix regression/add supportfor evaluating gid on /etc/shadow and friends on - debian - suse - alpine Ref: - dev-sec#33 - dev-sec/linux-baseline#70 on-behalf-of: @Logicworks <dmiguel@logicworks.net> Signed-off-by: Deric Miguel <dmiguel@logicworks.net>
* refactor `attribute()` -> `input()` * fix regression/add supportfor evaluating gid on /etc/shadow and friends on - debian - suse - alpine Ref: - dev-sec#33 - dev-sec/linux-baseline#70 on-behalf-of: @Logicworks <dmiguel@logicworks.net> Signed-off-by: Deric Miguel <dmiguel@logicworks.net>
Fixes #31 (this time actually tested...)