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

Debian uses group 42 shadow #33

Merged
merged 1 commit into from
Jun 8, 2018
Merged

Debian uses group 42 shadow #33

merged 1 commit into from
Jun 8, 2018

Conversation

timstoop
Copy link
Contributor

@timstoop timstoop commented Jun 3, 2018

Fixes #31 (this time actually tested...)

Copy link
Member

@chris-rock chris-rock left a 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?
Copy link
Member

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 }

Copy link
Contributor Author

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)
Copy link
Member

@chris-rock chris-rock left a 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!

@chris-rock chris-rock requested a review from rarenerd June 6, 2018 09:24
@chris-rock chris-rock merged commit c48fd79 into dev-sec:master Jun 8, 2018
michael-c-hoffman pushed a commit to michael-c-hoffman/cis-dil-benchmark that referenced this pull request Jun 13, 2018
* 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
michael-c-hoffman pushed a commit to michael-c-hoffman/cis-dil-benchmark that referenced this pull request Jun 13, 2018
* 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
michael-c-hoffman pushed a commit to michael-c-hoffman/cis-dil-benchmark that referenced this pull request Jun 13, 2018
* 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
michael-c-hoffman pushed a commit to michael-c-hoffman/cis-dil-benchmark that referenced this pull request Jun 13, 2018
* 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
michael-c-hoffman pushed a commit to michael-c-hoffman/cis-dil-benchmark that referenced this pull request Jun 13, 2018
* 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
deric4 pushed a commit to Logicworks/cis-dil-benchmark that referenced this pull request Jan 5, 2021
* 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>
deric4 pushed a commit to Logicworks/cis-dil-benchmark that referenced this pull request Jan 7, 2021
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants