Questions tagged [policy-based-management]
For questions about SQL Server Policy Based Management
16 questions
1
vote
1
answer
550
views
How to write (postgres) RLS-policies for related/nested tables?
I have a database structure with lots of tables related to eachother. For the sake of this question let's simplify it a bit to a project-management idea:
Organizations have Departments, Departments ...
0
votes
1
answer
48
views
Run Policy Based Management On Central Management Server with Code
I have a jump\terminal server to administer 100 SQL Servers and want to evaluate my locally created policies across all the servers by using the Central Management Server but WITHOUT:
creating the ...
0
votes
1
answer
21
views
Apply policy management column name in SQL Server
I want to apply a specific rule when somebody create new column in SQL Server 2016 Enterprise.
For example:
NR_NameColumn = int
IS_Deleted = bit
DT_update = Date
ID_User = int
and etc...
How can I ...
0
votes
1
answer
81
views
Using whole row in Row Level Security policy
I am using row level security with function, for example
CREATE POLICY person_select_policy ON core.person FOR SELECT USING (core.person_policy_check(id, 'read') = TRUE);
Is it possible to pass whole ...
0
votes
1
answer
2k
views
SQL Service Account group policy permissions
I'm trying to establish the best practice standards for configuring service account permissions in Group Policy. Based on Microsoft documentation, SQL Server setup requests permissions for the per-...
3
votes
1
answer
3k
views
postgresql - Policy to prevent a field from being updated
How can I create a policy to prevent a field from being updated?
I am thinking something like this:
CREATE POLICY "test" ON posts.created_at FOR UPDATE WITH CHECK (exists(created_at));
...
1
vote
1
answer
113
views
Postgres/Postgis : setting up rls policies
So i'm trying to configure the different accesses for mutliple users to my postgres/postgis database.
Basically I have 1 manager user and 4 weak users accessing the db.
What I would like to do is to ...
1
vote
0
answers
70
views
Issue with table naming policy with PBM - can't create it passed in the condition or not
I used PBM to create a condition to blocking create tables if nomenclature no haven't the prefix tbl:
EXEC msdb.dbo.sp_syspolicy_update_condition @condition_id=24, @description=N'Necessário ...
1
vote
1
answer
130
views
Using Policy-Based Management to check backup history for an Availability Group database
I like using Policy-Based Management to do some simple "everything's okay" sanity checks and email me if something goes out of spec. Typically, I validate the time since the last full backup, both to ...
-1
votes
1
answer
80
views
Why SP_Naming policy still blocked my correct creating? [closed]
I used PBM to manage my policy against my user DBs.
The Condition is:
Declare @condition_id int
EXEC msdb.dbo.sp_syspolicy_add_condition @name=N'SP_Naming_convention',
@description=N'', @facet=N'...
2
votes
2
answers
2k
views
Is it best practice to revoke server permissions to the server "public" role on SQL Server instances?
We have evaluated the Microsoft "best practice" policies (located at C:\Program Files (x86)\Microsoft SQL Server\number\Tools\Policies\DatabaseEngine\1033) on each of our SQL Server instances (example ...
1
vote
1
answer
120
views
How to select only one database in a policy in SQL Server?
I am creating a new policy which shows sproc creation dates. I am based on Stored Procedure facet and appropriate condition is created. Now I want this policy to include only one database in an ...
2
votes
1
answer
111
views
Enforce conditions on queries
Currently I have a simple schema, a sites table and an items table.
Sites own many items, items has a siteId column to store the reference of the site which owns it.
I'd like to be able to enforce a ...
5
votes
1
answer
253
views
Prevent users creating constraints or indexes with no name
I have done some searching but haven't found a solution to my problem.
I started with some databases where users didn't care to name PK constraints, foreign keys or indexes, ending up with system ...
1
vote
0
answers
32
views
User-defined Policy Evaluates to True when Evaluated but False when Invoked by Test-SqlAvailabilityReplica
I created a PBM condition and policy in SSMS. The policy runs a T-SQL script using the ExecuteSql function against the Server facet to determine whether all databases that are expected to be a member ...
11
votes
1
answer
503
views
Issue with Table Naming Conventions and Policy Management in SQL Server 2016
In SQL Server 2012, I had a policy set to not allow spaces in a table name. However, when I use the same policy in SQL Server 2016, I get an error.
Here is the code for the condition:
DECLARE @...