Code Monkey home page Code Monkey logo

Comments (3)

finalduty avatar finalduty commented on September 7, 2024 1

Tabs in the /etc/pam.d/password-auth and /etc/pam.d/system-auth are not configured right so the formatting can cause a failure.

Ah yeah, I see that - I'm not sure it's 100% safe to put .* at the beginning as that could allow for something else to go in between it, but we can use \s* to achieve the same result - will fix

Also the /etc/security/pwquality.conf requires spaces between the equals characters but the check doesn't expect the spaces so it fails here also.

Caused by a difference between v2.1.1 and v2.2.0 - will fix as part of Issue #7

from cis-benchmarks-audit.

rabcin avatar rabcin commented on September 7, 2024

suggest...

## Tests Start ##
file="/etc/security/pwquality.conf"

[ $(grep -c "^password.*requisite.*pam_pwquality.so.*try_first_pass.*retry=3" /etc/pam.d/password-auth) -eq 1 ] || state=$(( $state + 1 ))
[ $(grep -c "^password.*requisite.*pam_pwquality.so.*try_first_pass.*retry=3" /etc/pam.d/system-auth) -eq 1 ] || state=$(( $state + 2 ))

if [ "$(grep -c "^minlen = " $file)" -eq 1 ]; then
    [ "$(grep "^minlen = " $file | sed 's/^.*= //' )" -ge 14 ] || state=$(( $state + 4 ))
else
    state=$(( $state + 8 ))
fi

for i in dcredit ucredit ocredit lcredit; do
    if [ "$(grep -c "^$i = " $file)" -eq 1 ]; then
        [ "$(grep "^$i = " $file | sed 's/^.*= -//' )" -eq 1 ] || state=$(( $state + 16 ))
    else
        state=$(( $state + 32 ))
    fi
done

[ $state -eq 0 ]&& result="Pass"
write_debug "Test $id finished with end state of $state"
## Tests End ##

from cis-benchmarks-audit.

rabcin avatar rabcin commented on September 7, 2024

Looks good but doesn't match still for me, I think it needs an egrep?

#10

from cis-benchmarks-audit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.