private void collectData(Sql.RegisteredServer registeredServer) { if (registeredServer != null) { try { Forms.Form_StartSnapshotJobAndShowProgress.Process(registeredServer.ConnectionName); } catch (Exception ex) { Utility.MsgBox.ShowError(Utility.ErrorMsgs.SQLsecureDataCollection, Utility.ErrorMsgs.CantRunDataCollection, ex); } if (_grid.ActiveRow != null) { this._grid.BeginUpdate(); DataRow dr = _dt_servers.Rows[_grid.ActiveRow.Index]; dr[colJobStatus] = "Running"; this._grid.DataSource = _dt_servers; this._grid.DataMember = ""; this._grid.EndUpdate(); } else { System.Threading.Thread.Sleep(1000); ShowRefresh(); } } else { Utility.MsgBox.ShowWarning(Utility.ErrorMsgs.SQLsecureDataCollection, Utility.ErrorMsgs.ServerNotRegistered); } }
public Server(Sql.RegisteredServer serverIn) { Debug.Assert(serverIn != null, "Permission Explorer called with null server"); m_ServerInstance = serverIn; m_Name = serverIn.ConnectionName; }
protected void showConfigure() { Sql.RegisteredServer server = m_server; if (_ultraToolbarsManager.Ribbon.SelectedTab.Key == RibbonTabView.Users) { if (_policyUsers.SelectedServer != null) { server = _policyUsers.SelectedServer; } } else if (_ultraToolbarsManager.Ribbon.SelectedTab.Key == RibbonTabView.Settings) { if (_sqlServerSettings.SelectedServer != null) { server = _sqlServerSettings.SelectedServer; } } if (server == null) { server = Forms.Form_SelectRegisteredServer.GetServer(); } if (server != null) { Forms.Form_SqlServerProperties.Process(server.ConnectionName, Forms.Form_SqlServerProperties.RequestedOperation.EditCofiguration, Program.gController.isAdmin); } }
private void _contextMenuStrip_Server_Opening(object sender, CancelEventArgs e) { bool isServer = (_grid_Servers.ActiveRow != null); bool canExplore = false; if (isServer) { string server = _grid_Servers.ActiveRow.Cells[colServer].Text; Sql.RegisteredServer registeredServer = Program.gController.Repository.RegisteredServers.Find(server); canExplore = (registeredServer.LastCollectionSnapshotId != 0); } // Enable/disable based on the node type. _cmsi_Server_exploreUserPermissions.Enabled = isServer && canExplore && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.UserPermissions); _cmsi_Server_exploreSnapshot.Enabled = isServer && canExplore && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.ObjectPermissions); _cmsi_Server_viewAuditHistory.Enabled = isServer && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.Properties); _cmsi_Server_registerSQLServer.Enabled = Program.gController.Permissions.hasSecurity(Utility.Security.Functions.AuditSQLServer); _cmsi_Server_removeSQLServer.Enabled = isServer && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.Delete); _cmsi_Server_configureDataCollection.Enabled = isServer && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.ConfigureAuditSettings); _cmsi_Server_collectDataSnapshot.Enabled = isServer && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.Collect); _cmsi_Server_refresh.Enabled = Program.gController.Permissions.hasSecurity(Utility.Security.Functions.Refresh); _cmsi_Server_properties.Enabled = isServer && Program.gController.Permissions.hasSecurity(Utility.Security.Functions.Properties); }
public UserPermissions(Sql.RegisteredServer serverIn) { Debug.Assert(serverIn != null, "User Permissions called with null server"); m_ServerInstance = serverIn; m_Name = serverIn.ConnectionName; }
public ServerSecurity(Sql.RegisteredServer serverIn) { Debug.Assert(serverIn != null, "Server Security called with null server"); m_ServerInstance = serverIn; m_Name = serverIn.ConnectionName; }
private void _cmsi_Users_viewGroupMembers_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; UltraGrid grid = (UltraGrid)((ContextMenuStrip)((ToolStripItem)sender).Owner).SourceControl; Sql.User group = new Sql.User(grid.ActiveRow.Cells[colPrincipalName].Text, new Sid(grid.ActiveRow.Cells[colSid].Value as byte[]), DescriptionHelper.GetEnumDescription(Sql.ServerPrincipalTypes.WindowsGroup), Sql.User.UserSource.Snapshot); int snapshotid = (int)grid.ActiveRow.Cells[colSnapshotId].Value; Sql.User user = Forms.Form_SelectGroupMember.GetUser(snapshotid, group); if (user != null) { string server = grid.ActiveRow.Cells[colConnection].Text; Sql.RegisteredServer registeredServer = Program.gController.Repository.RegisteredServers.Find(server); Program.gController.ShowRootView(new Utility.NodeTag(new Data.PermissionExplorer(registeredServer, snapshotid, user, Views.View_PermissionExplorer.Tab.UserPermissions), Utility.View.PermissionExplorer)); } Cursor = Cursors.Default; }
public bool LoadSnapshots(Sql.RegisteredServer server) { m_server = server; // Get the snapshot list. Sql.Snapshot.SnapshotList snapshots = null; try { snapshots = Sql.Snapshot.LoadSnapshots(m_server.ConnectionName); } catch (Exception ex) { Utility.MsgBox.ShowError(Utility.ErrorMsgs.CantGetSnapshots, ex); return(false); } // Fill the list view. string status; //LinkLabel properties; ultraListViewSnapshots.Items.Clear(); foreach (Sql.Snapshot snap in snapshots) { // make sure it is a valid snapshot to explore before adding to list if ((snap.Status == Utility.Snapshot.StatusSuccessful) || (snap.Status == Utility.Snapshot.StatusWarning)) { if (String.Compare(snap.Status, Utility.Snapshot.StatusWarning, true) == 0) { status = snap.SnapshotComment; } else { status = snap.StatusText; } UltraListViewItem li = ultraListViewSnapshots.Items.Add(null, snap.SnapshotName); li.Tag = snap.SnapshotId; li.SubItems["Icon"].Value = snap.Icon; li.SubItems["Status"].Value = status; li.SubItems["Baseline"].Value = snap.Baseline; //_listView_Snapshots.Items.Add("", snap.IconIndex); //_listView_Snapshots.Items[_listView_Snapshots.Items.Count - 1].SubItems.Add(snap.SnapshotName); //_listView_Snapshots.Items[_listView_Snapshots.Items.Count - 1].SubItems.Add(status); //_listView_Snapshots.Items[_listView_Snapshots.Items.Count - 1].SubItems.Add(snap.Baseline); //_listView_Snapshots.Items[_listView_Snapshots.Items.Count - 1].Tag = snap.SnapshotId; } } if (ultraListViewSnapshots.Items.Count > 0) { ultraListViewSnapshots.SelectedItems.Clear(); ultraListViewSnapshots.SelectedItems.Add(ultraListViewSnapshots.Items[0]); } return(true); }
public PolicyAssessment(Sql.Policy policyIn) { Debug.Assert(policyIn != null, "Policy Assessment called with null Policy"); m_Policy = policyIn; m_Server = null; m_Name = m_Policy.PolicyAssessmentName; }
public Form_SelectSnapshot(Sql.RegisteredServer server) { InitializeComponent(); m_server = server; _listView_Snapshots.SmallImageList = AppIcons.AppImageList16(); }
public Main_SecuritySummary(Sql.Policy policyIn) { Debug.Assert(policyIn != null, "Security Summary called with null Policy"); m_Policy = policyIn; m_Server = null; m_Name = m_Policy.PolicyName; }
protected virtual void showConfigure() { // This has a base function that requires no input, so can be defaulted from here or overriden Sql.RegisteredServer server = Forms.Form_SelectRegisteredServer.GetServer(); if (server != null) { Forms.Form_SqlServerProperties.Process(server.ConnectionName, Forms.Form_SqlServerProperties.RequestedOperation.EditCofiguration, Program.gController.isAdmin); } }
public Main_SecuritySummary(Sql.Policy policyIn, Views.View_Main_SecuritySummary.SecurityView showTabIn) { Debug.Assert(policyIn != null, "Security Summary called with null Policy"); m_Policy = policyIn; m_Server = null; m_Name = m_Policy.PolicyName; m_SecurityView = showTabIn; }
public PolicyAssessment(Sql.Policy policyIn, Views.View_PolicyAssessment.AssessmentView showTabIn) { Debug.Assert(policyIn != null, "Security Summary called with null Policy"); m_Policy = policyIn; m_Server = null; m_Name = m_Policy.PolicyAssessmentName; m_AssessmentView = showTabIn; }
public UserPermissions(Sql.RegisteredServer serverIn, int snapShotId) { Debug.Assert(serverIn != null, "User Permissions called with null server"); Debug.Assert(snapShotId != 0, "User Permissions called with invalid SnapShotId"); m_ServerInstance = serverIn; m_Name = serverIn.ConnectionName; m_SnapShotId = snapShotId; }
public ReportCard(Sql.Policy policyIn, bool useBaselineIn, DateTime?selectionDateIn, Sql.RegisteredServer serverIn) { Debug.Assert(policyIn != null, "Report Card called with null Policy"); m_Policy = policyIn; m_Server = serverIn; m_Name = string.Format("{0}::{1}", m_Policy.PolicyName, m_Server == null ? null : m_Server.ConnectionName); m_UseBaseline = useBaselineIn; m_SelectionDate = selectionDateIn; }
public PermissionExplorer(Sql.RegisteredServer serverIn, Views.View_PermissionExplorer.Tab showTabIn) { Debug.Assert(serverIn != null, "Permission Explorer called with null server"); m_ServerInstance = serverIn; m_Name = serverIn.ConnectionName; m_Tab = showTabIn; Program.gController.SetCurrentServer(m_ServerInstance); }
private void _cmsi_Server_viewAuditHistory_Click(object sender, EventArgs e) { Cursor = Cursors.WaitCursor; Sql.RegisteredServer server = Program.gController.Repository.RegisteredServers.Find(_grid.Selected.Rows[0].Cells[colServer].Text); Program.gController.SetCurrentServer(server); Cursor = Cursors.Default; }
private void collectData() { Debug.Assert((_grid.ActiveRow != null), "No selected server row in grid"); if (_grid.ActiveRow != null) { string server = _grid.ActiveRow.Cells[colServer].Text; Sql.RegisteredServer registeredServer = null; Sql.RegisteredServer.GetServer(Program.gController.Repository.ConnectionString, server, out registeredServer); collectData(registeredServer); } }
public Main_SecuritySummary(Sql.Policy policyIn, Sql.RegisteredServer serverIn) { Debug.Assert(policyIn != null, "Security Summary called with null Policy"); Debug.Assert(serverIn != null, "Security Summary called with null Server"); m_Policy = policyIn; m_Server = serverIn; m_Name = string.Format("{0}::{1}", m_Policy.PolicyName, m_Server.ConnectionName); Program.gController.SetCurrentPolicy(m_Policy); }
public PermissionExplorer(Sql.RegisteredServer serverIn, int snapShotId) { Debug.Assert(serverIn != null, "Permission Explorer called with null server"); Debug.Assert(snapShotId != 0, "Permission Explorer called with invalid SnapShotId"); m_ServerInstance = serverIn; m_Name = serverIn.ConnectionName; m_SnapShotId = snapShotId; Program.gController.SetCurrentSnapshot(m_ServerInstance, snapShotId); }
public PolicyAssessment(Sql.Policy policyIn, Sql.RegisteredServer serverIn) { Debug.Assert(policyIn != null, "Policy Assessment called with null Policy"); Debug.Assert(serverIn != null, "Policy Assessment called with null Server"); m_Policy = policyIn; m_Server = serverIn; m_Name = string.Format("{0}::{1}", m_Policy.PolicyAssessmentName, m_Server.ConnectionName); Program.gController.SetCurrentPolicyAssessment(m_Policy); }
public PolicySummary(Sql.Policy policyIn, bool useBaselineIn, DateTime?selectionDateIn, Sql.RegisteredServer serverIn) { Debug.Assert(policyIn != null, "Policy Summary called with null Policy"); Debug.Assert(serverIn != null, "Policy Summary called with null Server"); m_Policy = policyIn; m_UseBaseline = useBaselineIn; m_SelectionDate = selectionDateIn; m_Server = serverIn; m_Name = string.Format("{0}::{1}", m_Policy.PolicyName, m_Server.ConnectionName); }
private void configureDataCollection(object sender, EventArgs e) { Sql.RegisteredServer server = Forms.Form_SelectRegisteredServer.GetServer(); //if a server was selected, then show the view if (server != null) { Forms.Form_SqlServerProperties.Process(server.ConnectionName, Forms.Form_SqlServerProperties.RequestedOperation. EditCofiguration, Program.gController.isAdmin); } }
public PolicySummary(Sql.Policy policyIn, Sql.RegisteredServer serverIn) { Debug.Assert(policyIn != null, "Policy Summary called with null Policy"); Debug.Assert(policyIn.IsAssessment, "Policy Summary called with Policy that should be Assessment"); m_Policy = policyIn; m_UseBaseline = m_Policy.UseBaseline; m_SelectionDate = m_Policy.AssessmentDate; m_Server = serverIn; m_Name = string.Format("{0}::{1}", m_Policy.PolicyAssessmentName, m_Server.ConnectionName); }
public Form_WizardCreateFilterRule( Sql.RegisteredServer registeredServer, List <string> listOfFiltersInListView ) { Debug.Assert(registeredServer != null); InitializeComponent(); m_RegisteredServer = registeredServer; m_ListOfFiltersInListView = listOfFiltersInListView; }
public PolicyUsers(Sql.Policy policyIn, bool useBaselineIn, DateTime?selectionDateIn, Sql.RegisteredServer serverIn) { Debug.Assert(policyIn != null, "Policy Users called with null Policy"); Debug.Assert(serverIn != null, "Policy Users called with null Server"); m_Policy = policyIn; m_UseBaseline = useBaselineIn; m_SelectionDate = selectionDateIn; m_Server = serverIn; m_Name = m_Server.ConnectionName; }
public static void Process(string newConnection) { Sql.RegisteredServer rServer = null; Sql.RegisteredServer.GetServer(Program.gController.Repository.ConnectionString, newConnection, out rServer); if (rServer == null) { Utility.MsgBox.ShowWarning(Utility.ErrorMsgs.SQLsecureDataCollection, Utility.ErrorMsgs.ServerNotRegistered); return; } Process(newConnection, rServer.JobId); }
protected void showServer() { Debug.Assert(!(_grid_Servers.ActiveRow == null), "No selected server row in grid"); if (_grid_Servers.ActiveRow != null) { string server = _grid_Servers.ActiveRow.Cells[colServer].Text; Sql.RegisteredServer registeredServer = Program.gController.Repository.RegisteredServers.Find(server); Program.gController.SetCurrentServer(registeredServer); } }
protected void showConfigure() { Sql.RegisteredServer server = m_server; if (server == null) { server = Forms.Form_SelectRegisteredServer.GetServer(); } if (server != null) { Forms.Form_SqlServerProperties.Process(server.ConnectionName, Forms.Form_SqlServerProperties.RequestedOperation.EditCofiguration, Program.gController.isAdmin); } }