Identify login with Administrative access on SSAS instance using query or Powershell - powershell

Want to identify the users/login with Administrative access on server to migrate them to new server's. I have tried Select * from $System.TMSCHEMA_ROLE_MEMBERSHIPS but these give information regarding the particular database i need more at server level.

Ssas users are done quite differently from normal databases. Ssas uses only the active directory account of the user trying to connect.
On server level the only security is done in the properties of the server, there you can select active directory users with administrative access to the server.
On database level you can create roles, give them access to (part of a) database and link active directory users/groups to them.
Using the analysisservices namespace of microsoft you already mentioned you can look trough every role in every database and note the permissions.
As far as I know you can't actually use this namespace to see all the administrators of the user. But unless you have an unreasonable amount of administrators the best solution might be to just open the server in sql server management studio, click on properties, security and write down all the AD members manually.
I hope this helps you and good luck!

Related

Creating a user that's not a cloudsqlsuperuser in Cloud SQL using Terraform

I'd like to limit the privileges afforded to any given user that I create via the Google Terraform provider. By default, any user created is placed in the cloudsqlsuperuser group, and any new database created has that role/group as owner. This gives any user created via the GCP console or google_sql_user Terraform resource total control over any database that is (or was) created in a similar fashion.
So far, the best we've been able to come up with is creating and altering a user via a single-run k8s job. This seems circuitous, at best, especially given that that resource must then be manually imported later if we want to manage it via Terraform.
Is there a better way to create a user that has privileges limited to a single, application-specific database?
I was puzzled by this behaviour too. Its probably not the answer you want but if you can use GCP IAM accounts the user gets created in the PostgreSQL instance with NO roles.
There are 3 types of account you can create from "gcloud sql users create" or terraform module "google_sql_user"
"CLOUD_IAM_USER", "CLOUD_IAM_SERVICE_ACCOUNT" or "BUILT_IN"
The default is the built_in type if not specified.
CLOUD_IAM_USER and CLOUD_IAM_SERVICE_ACCOUNTS get created with NO roles.
We are using these as integration with IAM is useful in lots of ways (no managing passwords at database level is a major plus esp. when used in conjunction with SQL Auth Proxy).
BUILT_IN accounts (ie old school need a postgres username and password) for some reason are granted the "cloudsqlsuperuser" role.
In the absence of being allowed the superuser role on GCP this is about as privileged as you can get so to me (and you) seems a bizarre default.

Linking active directory user with SQL SERVER login account

Good day. Am working in an environment that requires a security approach for checking users account (users in the active directory are changing data in the SQL SERVER).
I want to link/tie the users of an active directory to the SQL server account login account.
Am working with Powershell, i type Get-ADUser -filter *, it gives me the list of all listed users. If i log into my SQL SERVER with "winnie", how do i link/tie the active directory user with the sql server user called ""winnie"
You should never give users access to a database by single Windows User or by SQL User. The reason for this is because of the security later on. It will be better to manage and audit a group compared to giving out single users. If you have to restore that database to a new system. It will provide better security between a Production system and a Test system.
The only user who should have access to a database is the SA account. The others should be controlled by Security Groups.
How do you do this:
In SQL Server Management Studio, go to Object Explorer > (your server) > Security > Logins and right-click New Login:
Then in the dialog box that pops up, pick the types of objects you want to see (Groups is disabled by default - check it!) and pick the location where you want to look for your objects (e.g. use Entire Directory) and then find your AD group.
Any member of that AD group can now login to SQL Server and use your database.
Add the Read or Write permissions to the Security Group of choice. Limiting security issues it the future.
Best Practice:
Create Security Groups
Security Group naming convention exmaples:
SG_DBNAME_READ
SG_DBNAME_WRITE
SG_DBSERVER_ADMIN

icCube - XMLA authentication/authorization not working as expected

I am trying to limit user to see only one schema over XMLA.
For that i have done:
created separate role without full access check
Created separate role without full access check
In Applications tab checked only XMLA
In Schemas tab selected "Authorize Selected" and select only one schema
Created user with just created role
applied new user definitions
After that steps, when i connect via XMLA with just created users i still see all schemas.
What i am doing wrong?
One point that is important when using XMLA interface is to disable the 'anonymous' login. When doing XMLA if this mode is activate it is going to be used in priority.
To change this you need to modify icCube.xml and restart icCube Server. See more on online doc here.

How to establish Firebird 2.5 service connection using trusted authentication and the RDB$ADMIN role?

Connections using trusted authentication can be established by passing isc_dpb_trusted_auth and isc_spb_trusted_auth in the respective parameter blocks when using Firebird 2.1.
The connected user will have administrative rights depending on their being member of a Windows group with administrative rights.
For Firebird 2.5 the role "rdb$admin" can be specified to connect with administrative rights to the database, provided the user has been granted permission to that role.
I want to establish a service connection with administrative rights, using that role, but haven't found a way yet to do it. The connection is made but I can't for example list database users, which I can when connecting as SYSDBA.
What combination of isc_spb_trusted_auth, isc_spb_trusted_role and isc_spb_sql_role_name or other parameter blocks do I need, and what parameters do I need to pass?
There is a difference between a role and a user regarding where appropriate data are stored. The former is stored inside database in the RDB$ROLES table. The latter is stored in a special separate database file named security2.fdb, which usually lays in a Firebird directory.
When attaching to a service manager through Firebird API particular database is not known yet. Only server name is specified. Because of this you can not use roles. At this point the server simply doesn't know from what database to read role credentials.
The only service accepting role parameter in FB2.5 is users' management - that's how services work since interbase 6. Ability to use it for other services will be present starting with FB3.

How to revoke permission of Windows Administrator user from DB2?

On IBM DB2 v.9 windows, when someone connect to database by Server\Administrator user
DB2 database will automatically accept and grant all the permissions to this user?
But, in some case environment Administrator of server does not need to see every data in the database. So how to prevent Administrator use connect to database?
On 9.5 and older this would not be possible because the account under which your instance runs is SYSADM. Also Administrator can reset at least local account passwords and gain access to them, making changing the instance owner account useless.
However on 9.7 and onwards the instance owner will not have access to the data anymore. One option is to upgrade to 9.7. Furthermore you can set up an AD account for the connections your applications use. Local Administrator is not necessarily able to change into those credentials.
Still, the Administrator ultimately has access to the (usually unencrypted) database files. You can mostly improve the administrative aspect of security.
Umm... For many times I try to revoke with this command but when I connect to database by Administrator account DB2 will automatic grant permission to Administrator again.
I will try again for make sure.
By default, DB2 databases are created with CONNECT authority granted to public. If you want to restrict some users from connecting, you need to do
GRANT CONNECT ON DATABASE TO <user1>, <user2>, ...
Then revoke the CONNECT authority from PUBLIC
REVOKE CONNECT ON DATABASE FROM PUBLIC
I don't think it's possible under normal circumstances simply because Administrator is in the sysadm group.
Options I can think of (but haven't tried) include:
Setting the sysadm group to something else ("db2 update dbm cfg using sysadm_group blah"). Check the docs for caveats and gotchas when doing this, as I'm sure there are some.
Stop using OS authentication. Use a different security plugin (8.2 and higher only). This would move the authentication, and thus groups, to a new location (say an LDAP server). Then you just don't add Administrator to the new location, and especially don't add Administrator to the sysadm group again.
On Windows, the database manager configuration parameter SYSADM_GROUP controls who has SYSADMauthority at the instance level. When SYSADM_GROUP is blank (as is the default on Windows), then DB2 defaults to using the Administrators group on the local machine.
To fix this, you can create a new group in Windows and then modify the value of SYSADM_GROUP to use this new group. Make sure that the ID that the DB2 Service runs under belongs to this new group. After making this change, members of the Administrators group will no longer have SYSADM authority.
As Kevin Beck states, you may also want to look at restricting CONNECT authority on databases, too, because by default the CONNECT privilege is granted to PUBLIC.