|
|
|
Right there with Babe
      
Group: General Forum Members
Last Login: Monday, January 21, 2013 1:19 PM
Points: 727,
Visits: 264
|
|
Good job, Brian. I will definitely use this.
- Paul
http://paulpaivasql.blogspot.com/
|
|
|
|
|
Keeper of the Duck
Group: Moderators
Last Login: Yesterday @ 1:55 PM
Points: 6,584,
Visits: 1,789
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, July 23, 2012 3:52 AM
Points: 4,
Visits: 35
|
|
Hey I ran this and my DB is blocked. Help me out my system giving myself error
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Thursday, March 25, 2010 11:26 AM
Points: 6,
Visits: 12
|
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, July 23, 2012 3:52 AM
Points: 4,
Visits: 35
|
|
| Any resolution???? I am not good in DB.. Plz help....
|
|
|
|
|
Keeper of the Duck
Group: Moderators
Last Login: Yesterday @ 1:55 PM
Points: 6,584,
Visits: 1,789
|
|
|
|
|
|
SSCrazy Eights
        
Group: General Forum Members
Last Login: Saturday, May 04, 2013 11:13 AM
Points: 9,855,
Visits: 9,374
|
|
K. Brian Kelley (3/9/2009)
RBarryYoung (3/9/2009) Great article, Brian. Is the Client_Host ip information still available about a session later on, or would I need to store it from a Logon Trigger like yours if I needed that?It's also available in sys.dm_exec_connections in the column client_net_address. Hah! That's great, Brian. I've seen this question (how can to get a session's IP address) asked many times without hearing an answer. Thanks.
-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung Proactive Performance Solutions, Inc. "Performance is our middle name."
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Wednesday, May 08, 2013 11:44 AM
Points: 1,110,
Visits: 1,145
|
|
er.imran.it (3/9/2009) Any resolution???? I am not good in DB.. Plz help....
Probably shouldn't have run the code then.
|
|
|
|
|
SSC Rookie
      
Group: General Forum Members
Last Login: Thursday, February 14, 2013 1:59 PM
Points: 26,
Visits: 143
|
|
| This is good stuff. I'm learning. It's got me thinking how an attacker could ompromise our web servers and launch an attack against the SQL Server.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Wednesday, March 27, 2013 3:34 AM
Points: 165,
Visits: 405
|
|
Thanks for the post Brian.
However, I am stuck with few issues. Hope you could throw some light on them and clarify .
1. I executed the Step to insert <local machine< into ValidIP table and still i am not able to connect from my local machine, bcoz of trigger execution.
2. I changed the trigger to capture the @IP value in troubleshooting the above said issue. Below is my code:
CREATE TRIGGER tr_logon_CheckIP ON ALL SERVER FOR LOGON AS DECLARE @IP NVARCHAR(15),@SqlCmd NVARCHAR(100); SET @IP = (SELECT EVENTDATA().value('(/EVENT_INSTANCE/ClientHost)[1]', 'NVARCHAR(15)')); INSERT INTO dbo.ValidIP (IP) VALUES (@IP); BEGIN IF IS_SRVROLEMEMBER('sysadmin') = 1 BEGIN IF NOT EXISTS(SELECT IP FROM DBAWork.dbo.ValidIP WHERE IP = @IP) ROLLBACK; END; END; GO
But this is not inserting any @IP value in the ValidIP table. Does triggers have constraint of not inserting any value into the tables in execution.
3. If @IP value can't be inserted into the table ,as desired, is there any other way to see the output of EventData() or IP later.
Thanks in advance!! Vampire
--In 'thoughts'... Lonely Rogue
|
|
|
|