<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Full Time DBA - SQL Security</title>
    <link>http://www.fulltimedba.com/</link>
    <description>SQL tips for database administrator</description>
    <language>en-us</language>
    <copyright>Full Time DBA</copyright>
    <lastBuildDate>Thu, 11 Dec 2008 23:39:15 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.2.8279.16125</generator>
    <managingEditor>fulltimedba@gmail.com</managingEditor>
    <webMaster>fulltimedba@gmail.com</webMaster>
    <item>
      <trackback:ping>http://www.fulltimedba.com/Trackback.aspx?guid=13b95e03-5d76-453b-b1b4-b597718e9491</trackback:ping>
      <pingback:server>http://www.fulltimedba.com/pingback.aspx</pingback:server>
      <pingback:target>http://www.fulltimedba.com/PermaLink,guid,13b95e03-5d76-453b-b1b4-b597718e9491.aspx</pingback:target>
      <dc:creator>Full Time DBA</dc:creator>
      <wfw:comment>http://www.fulltimedba.com/CommentView,guid,13b95e03-5d76-453b-b1b4-b597718e9491.aspx</wfw:comment>
      <wfw:commentRss>http://www.fulltimedba.com/SyndicationService.asmx/GetEntryCommentsRss?guid=13b95e03-5d76-453b-b1b4-b597718e9491</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <font color="#0000ff" size="4">
          <font color="#0000ff" size="4">
            <div>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <font face="Calibri" color="#000000" size="3">One of my colleagues came to me and
showed me a strange problem on SQL server. When a user uses Windows Login to connect
to SQL server the user get the 18456 error message. But if the user is added to SysAdmin
role the user is able to login to the SQL server. My colleague has deleted the window
login from the SQL server and added the window login back to the SQL server. It does
not resolve the problem.</font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <font face="Calibri" color="#000000" size="3">The SQL Server Logs shows the following
message:</font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <i style="mso-bidi-font-style: normal">
                  <font size="3">
                    <font color="#000000">
                      <font face="Calibri">SQL
Error Log Message:</font>
                    </font>
                  </font>
                </i>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <i style="mso-bidi-font-style: normal">
                  <font size="3">
                    <font color="#000000">
                      <font face="Calibri">Date<span style="mso-spacerun: yes">  </span>12/11/2008
9:30:16 AM</font>
                    </font>
                  </font>
                </i>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <i style="mso-bidi-font-style: normal">
                  <font size="3">
                    <font color="#000000">
                      <font face="Calibri">Log<span style="mso-spacerun: yes">  </span>SQL
Server (Current - 12/11/2008 2:50:00 PM)</font>
                    </font>
                  </font>
                </i>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <i style="mso-bidi-font-style: normal">
                  <font size="3">
                    <font color="#000000">
                      <font face="Calibri">Source<span style="mso-spacerun: yes">  </span>Logon</font>
                    </font>
                  </font>
                </i>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <i style="mso-bidi-font-style: normal">
                  <font size="3">
                    <font color="#000000">
                      <font face="Calibri">Message</font>
                    </font>
                  </font>
                </i>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <i style="mso-bidi-font-style: normal">
                  <font size="3">
                    <font color="#000000">
                      <font face="Calibri">Error:
18456, Severity: 14, State: 11.</font>
                    </font>
                  </font>
                </i>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <span style="mso-spacerun: yes">
                  <font face="Calibri" color="#000000" size="3">
                  </font>
                </span> 
</p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt">
                <font face="Calibri" color="#000000" size="3">The followings are the steps that we
used to solve this problem:</font>
              </p>
              <p class="MsoListParagraphCxSpFirst" style="MARGIN: 0in 0in 0pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1">
                <font color="#000000">
                  <span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">
                    <span style="mso-list: Ignore">
                      <font face="Calibri" size="3">1.</font>
                      <span style="FONT: 7pt 'Times New Roman'">       </span>
                    </span>
                  </span>
                  <font face="Calibri" size="3">Check
if the login has granted access permission to the default database</font>
                </font>
              </p>
              <p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1">
                <font color="#000000">
                  <span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">
                    <span style="mso-list: Ignore">
                      <font face="Calibri" size="3">2.</font>
                      <span style="FONT: 7pt 'Times New Roman'">       </span>
                    </span>
                  </span>
                  <font face="Calibri" size="3">Check
if the login is not disable</font>
                </font>
              </p>
              <p class="MsoListParagraphCxSpMiddle" style="MARGIN: 0in 0in 0pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1">
                <font color="#000000">
                  <span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">
                    <span style="mso-list: Ignore">
                      <font face="Calibri" size="3">3.</font>
                      <span style="FONT: 7pt 'Times New Roman'">       </span>
                    </span>
                  </span>
                  <font face="Calibri" size="3">Check
if the login is denied database engine access</font>
                </font>
              </p>
              <p class="MsoListParagraphCxSpLast" style="MARGIN: 0in 0in 10pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1">
                <font color="#000000">
                  <span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">
                    <span style="mso-list: Ignore">
                      <font face="Calibri" size="3">4.</font>
                      <span style="FONT: 7pt 'Times New Roman'">       </span>
                    </span>
                  </span>
                  <font face="Calibri" size="3">Run
the following script:</font>
                </font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Calibri" color="#000000" size="3">Exec <span style="mso-spacerun: yes"> </span>xp_logininfo <span style="mso-spacerun: yes"> </span>'domain\user'</font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Calibri">
                  <font size="3">
                    <font color="#000000">
                      <span style="mso-spacerun: yes"> </span>(</font>
                  </font>
                  <font color="#000000">
                    <span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt">Replace
the domain with your domain name and user with the right user name</span>
                    <font size="3">)</font>
                  </font>
                </font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Calibri" color="#000000" size="3">If there is no result returning back,
then the window login is denied database engine access through windows group.</font>
              </p>
              <p class="MsoListParagraph" style="MARGIN: 0in 0in 10pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1">
                <font color="#000000">
                  <span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">
                    <span style="mso-list: Ignore">
                      <font face="Calibri" size="3">5.</font>
                      <span style="FONT: 7pt 'Times New Roman'">       </span>
                    </span>
                  </span>
                  <font face="Calibri" size="3">Run
the following script to get a list of window groups that are denied SQL database engine
access</font>
                </font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Courier New" color="#000000" size="2">
                  <em>select prin.[name], prin.type_desc </em>
                </font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Courier New" color="#000000" size="2">
                  <em>from sys.server_principals prin </em>
                </font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Courier New" color="#000000" size="2">
                  <em>JOIN sys.server_permissions
perm on prin.principal_id = perm.grantee_principal_id</em>
                </font>
              </p>
              <p class="MsoNormal" style="MARGIN: 0in 0in 10pt 19.5pt">
                <font face="Courier New" color="#000000" size="2">
                  <em>where perm.state_desc = 'DENY'</em>
                </font>
              </p>
              <p class="MsoListParagraph" style="MARGIN: 0in 0in 10pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1">
                <font color="#000000">
                  <span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin">
                    <span style="mso-list: Ignore">
                      <font face="Calibri" size="3">6.</font>
                      <span style="FONT: 7pt 'Times New Roman'">       </span>
                    </span>
                  </span>
                  <font face="Calibri" size="3">Make
sure that the window login is not a member of the Window Groups in the list.</font>
                </font>
              </p>
            </div>
          </font>
        </font>
        <img width="0" height="0" src="http://www.fulltimedba.com/aggbug.ashx?id=13b95e03-5d76-453b-b1b4-b597718e9491" />
      </body>
      <title>Error: 18456, Severity: 14, State: 11</title>
      <guid isPermaLink="false">http://www.fulltimedba.com/PermaLink,guid,13b95e03-5d76-453b-b1b4-b597718e9491.aspx</guid>
      <link>http://www.fulltimedba.com/2008/12/11/Error18456Severity14State11.aspx</link>
      <pubDate>Thu, 11 Dec 2008 23:39:15 GMT</pubDate>
      <description>&lt;font color=#0000ff size=4&gt;&lt;font color=#0000ff size=4&gt; 
&lt;div&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;One of my colleagues came to me and showed
me a strange problem on SQL server. When a user uses Windows Login to connect to SQL
server the user get the 18456 error message. But if the user is added to SysAdmin
role the user is able to login to the SQL server. My colleague has deleted the window
login from the SQL server and added the window login back to the SQL server. It does
not resolve the problem.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The SQL Server Logs shows the following message:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;SQL
Error Log Message:&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Date&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;12/11/2008
9:30:16 AM&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Log&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;SQL
Server (Current - 12/11/2008 2:50:00 PM)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Source&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Logon&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Message&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;i style="mso-bidi-font-style: normal"&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;font face=Calibri&gt;Error:
18456, Severity: 14, State: 11.&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;span style="mso-spacerun: yes"&gt;&lt;font face=Calibri color=#000000 size=3&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;The followings are the steps that we used
to solve this problem:&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpFirst style="MARGIN: 0in 0in 0pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;1.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;Check
if the login has granted access permission to the default database&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;2.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;Check
if the login is not disable&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpMiddle style="MARGIN: 0in 0in 0pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;3.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;Check
if the login is denied database engine access&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraphCxSpLast style="MARGIN: 0in 0in 10pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;4.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;Run
the following script:&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;Exec &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;xp_logininfo &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;'domain\user'&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face=Calibri&gt;&lt;font size=3&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;(&lt;/font&gt;&lt;/font&gt;&lt;font color=#000000&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; mso-bidi-font-size: 11.0pt"&gt;Replace
the domain with your domain name and user with the right user name&lt;/span&gt;&lt;font size=3&gt;)&lt;/font&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face=Calibri color=#000000 size=3&gt;If there is no result returning back, then
the window login is denied database engine access through windows group.&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;5.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;Run
the following script to get a list of window groups that are denied SQL database engine
access&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face="Courier New" color=#000000 size=2&gt;&lt;em&gt;select prin.[name], prin.type_desc &lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face="Courier New" color=#000000 size=2&gt;&lt;em&gt;from sys.server_principals prin &lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face="Courier New" color=#000000 size=2&gt;&lt;em&gt;JOIN sys.server_permissions perm
on prin.principal_id = perm.grantee_principal_id&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 10pt 19.5pt"&gt;
&lt;font face="Courier New" color=#000000 size=2&gt;&lt;em&gt;where perm.state_desc = 'DENY'&lt;/em&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoListParagraph style="MARGIN: 0in 0in 10pt 19.5pt; TEXT-INDENT: -0.25in; mso-add-space: auto; mso-list: l0 level1 lfo1"&gt;
&lt;font color=#000000&gt;&lt;span style="mso-bidi-font-family: Calibri; mso-bidi-theme-font: minor-latin"&gt;&lt;span style="mso-list: Ignore"&gt;&lt;font face=Calibri size=3&gt;6.&lt;/font&gt;&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;font face=Calibri size=3&gt;Make
sure that the window login is not a member of the Window Groups in the list.&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/font&gt;&lt;/font&gt;&lt;img width="0" height="0" src="http://www.fulltimedba.com/aggbug.ashx?id=13b95e03-5d76-453b-b1b4-b597718e9491" /&gt;</description>
      <comments>http://www.fulltimedba.com/CommentView,guid,13b95e03-5d76-453b-b1b4-b597718e9491.aspx</comments>
      <category>SQL Security</category>
    </item>
  </channel>
</rss>