How to verify SA password is not blank

  • I know for a fact that my SA pw has been changed. However, our SOX IT auditors want me to send them a screenshot "proving" that the SA pw has been changed. Can someone tell me the best way to show this visually?

    Thank you.

    Edit: Sorry, this was supposed to be in one of the SQL Server 2008 forums. I just noticed I accidentally put it in here with 2005 stuff. Maybe the same applies.

  • Try logging in with 'sa' and no password and screenshot the login dialog and the login failed error box?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • You need to use the PWDCOMPARE function:

    Reat this article: http://msdn.microsoft.com/en-us/library/dd822792.aspx

    Use it like this,

    SELECT name FROM sys.sql_logins

    WHERE PWDCOMPARE('', password_hash) = 1

    OR PWDCOMPARE('', password_hash, 1) = 1 ;

    Cheers

    Leo

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • Presumably if the password in sys.syslogins is null then it hasn't been changed, and if not it has?

    Also what is the password policy set to, wouldnt the corerect setting here prove it must have been changed?

    Andrew

  • You can right click on the properties for the SA user and show a screen shot that the password is not empty, even though it does not show for security reasons, it still does show that it is not an empty string.

  • Leo, maybe my eyes just cannot make out the difference but where is the difference from your WHERE line and the OR line condition? Should one of the entries have a space in them?

    HTH -- Mark D Powell --

  • The OR line has an extra parameter. Note the extra ,1 in the brackets.

    Leo

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • Now that you have pointed it out the extra 1 is plan as daylight. Here is my version of the query you posted.

    select

    name

    ,default_database_name

    ,is_disabled

    ,modify_date

    from

    sys.sql_logins

    where

    pwdcompare('',password_hash) = 1 or

    pwdcompare('',password_hash,1) = 1

    order by

    name

    go

    Thank you

    -- Mark D Powell --

  • @leo-2 & mark

    The script provided by you not working.

    Can you confirm it is working on your side?

    Regards,

    SKYBVI

    Regards
    Sushant Kumar
    MCTS,MCP

  • Tested on 2005 and 2008 successfully. It errors on 2000 (no sys.sql_logins table after all)

    -- Mark --

  • SKYBVI (11/17/2011)


    @leo & mark

    The script provided by you not working.

    Can you confirm it is working on your side?

    Regards,

    SKYBVI

    This only works on SQL 2005 up. I've tested it and I know we use it regulalry as we do SQL Server Health checks as one of our service offerings. One of the tests is for blank passwords and this is the method we use. In SQL 2000 you could check the length of the password, but from 2005 on this no longer works.

    Cheers

    Leo

    SQL Services Ltd

    http://www.sqlservices.com

    Leo
    Nothing in life is ever so complicated that with a little work it can't be made more complicated.

  • Leo.Miller (11/15/2011)


    You need to use the PWDCOMPARE function:

    Reat this article: http://msdn.microsoft.com/en-us/library/dd822792.aspx

    Use it like this,

    SELECT name FROM sys.sql_logins

    WHERE PWDCOMPARE('', password_hash) = 1

    OR PWDCOMPARE('', password_hash, 1) = 1 ;

    Cheers

    Leo

    Leo....Doesn't this script tell us about the logins who have no passwords on sql 2005 /2008 ...

    But the Original poster asked if hte password was changed, then he wants to know.....

    Thats why, I told that the script didn't work ( As i manually changed the password of a login and then executed the script expecting it to select that login but it didn't).

    Regards,

    SKYBVI

    Regards
    Sushant Kumar
    MCTS,MCP

  • I think the posted query answers the question that was asked which I remember as being how to prove to the auditor via a query that the sa account requires a password, that is, it has been changed from null.

    IMHO -- Mark D Powell --

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply