Not able to grant a role to the group in beeline - hive

I am trying to grant a role to the AD group in beeline. I am facing the below error. If anyone has encountered the same issue, Please suggest me the steps to resolve.
GRANT ROLE role_test1 TO GROUP test1;
Error: Error while processing statement: FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. Invalid principal type in principal Principal [name=itops_hdp3_saie_archive_rw, type=GROUP] (state=08S01,code=1)

One of the many, many, many critical informations that you did not give was: what Authorization Model do you use?
with Ranger enabled (...not the case here...)
with Sentry enabled (...not the case here...)
with SQL Standard Based Hive Authorization you can GRANT privileges to a User or a Role, you can GRANT membership of a Role to a User -- but there is currently no concept of Group (see sources below); and it works only with HiveServer2, the Hive CLI does not enforce these privileges restrictions anyway
with the Legacy Mode you could indeed GRANT privileges to a Group...
Some interesting sources:
> mail thread - Q: "Hive SQL based authorization don't have support for group?" -- A: "we haven’t added that feature" (2016-05-26)
> Hive unit tests - comment: "grant insert on group should fail" (was in SVN trunk as of 2016-09-21)

Related

-567 Rebind Authorization error for Auth ID IBM Db2 native stored procedure

A user is unable to create a native stored procedure via IBM data studio and faces -567 rebind authorization error for a particular auth id say DBAXXYY.The schema name is also same as the authid
But I am able to create the stored procedure successfully without any issues using the same authid.
Could any of you kindly help in determining what privilege does the other user lack and what privilege I have different to him? Also, provide the syntax for any grant privilege that will be needed to create the stored procedure from his end using the same authid DBAXXYY.
I tried providing GRANT BINDADD TO DBAXXYY to that authid but still it didn't work.
Error :
Create stored procedure returns SQLCODE: -567, SQLSTATE:42591.
DBAXXYY.SP_SAMP: 0: REBIND AUTHORIZATION ERROR USING
DBAXXYY AUTHORITY PACKAGE =
LOCATION.DBAXXYY.SP_SAMP.(V1) PRIVILEGE = CREATE IN.
SQLCODE=-567, SQLSTATE=42501,
DRIVER=4.18.60
DBAXXYY.SP_SAMP - Deploy failed.
DBAXXYY.SP_SAMP - Roll back completed successfully.
The exception states that the user account lacks the CREATEIN privilege on the target schema. There may be other missing privileges, but you will be able to resolve these either by carefully studing the details of each exception, or by comparing your priviliges with those of the other user. Do that by querying the relvant catalog tables.
For the immediate problem, try:
GRANT CREATEIN ON SCHEMA ... TO ...
(where the first name is the schema name , and the second name is the other user name).
If , on the other hand, your security configuration uses ROLES then you need to grant that privilege to a role which the other user has.
Documentation link, adjust for your version of Db2 and platform.
At last I was able to provide the required privilege to the user and he is now able to create the native stored procedure.
I gave the following grant on the collection DBAXXYY to the auth id DBAXXYY and this solved the problem.
GRANT CREATE IN COLLECTION DBAXXYY TO DBAXXYY; COMMIT;

Snowflake permission issue for "GRANT USAGE ON FUTURE PROCEDURES IN SCHEMA MyDb.MySchema TO ROLE MyRole"

I am trying to grant usage on future stored procedures within a particular schema.
I am using the role SYSADMIN and the schema is owned by SYSADMIN.
The following statement works
GRANT USAGE ON ALL PROCEDURES IN SCHEMA UAT_CONTROL.PDS TO ROLE UAT_OPERATIONS;
While this one fails
GRANT USAGE ON FUTURE PROCEDURES IN SCHEMA UAT_CONTROL.PDS TO ROLE UAT_OPERATIONS;
"SQL Error [3001] [42501]: SQL access control error: Insufficient
privileges to operate on schema 'PDS'
Am I missing a trick?
Just wanted to provide the answer in case someone was looking for it in this forum. The MANAGE GRANTS privilege is required for future grants:
https://docs.snowflake.com/en/user-guide/security-access-control-configure.html#security-privileges-required-to-manage-future-grants
You also have to grant usage on your database and maybe on your schema:
GRANT USAGE ON DATABASE UAT_CONTROL TO ROLE UAT_OPERATIONS;
GRANT USAGE ON SCHEMA PDS TO ROLE UAT_OPERATIONS;
More infos here: https://docs.snowflake.com/en/sql-reference/sql/grant-privilege.html

Unable to load dataset using IBM DB2 LOAD tool

Error for batch element #1: "WQX79824" does not have the privilege to perform operation "IMPLICIT CREATE SCHEMA".. SQLCODE=-552, SQLSTATE=42502, DRIVER=4.26.14
Number of occurrences: 1
This is not a programming issue, instead it is a configuration issue.
Either ask your DBA to grant the relevant authority and permissions to the authID you use (WQX79824) to connect to the database, or alternately connect to the database with a different authID which already has the required permissions and authorities to create objects and do loads etc.

Creating a user in Oracle 11g - No permissions issue

I am trying to set up a user in my Oracle 11g database as such
create user BARRY6 IDENTIFIED by password123;
grant connect to BARRY6;
grant create session to BARRY6;
grant UNLIMITED TABLESPACE to BARRY6;
commit;
This should create the user and provides them with the basic permissions.
All commands executes successfully, However i can not connect with this user.
I get an error
An error was encountered performing the requested operation:
ORA-01031: insufficient privileges
01031. 00000 - "insufficient privileges"
*Cause: An attempt was made to perform a database operation without
the necessary privileges.
*Action: Ask your database administrator or designated security
administrator to grant you the necessary privileges
Vendor code 1031
When i view the USER_ROLE_PRIVS table , there is no permissions in that table for my user
This was happening because the role i was trying to login in as was sysdba. While it should be default.
I know, stupid, but it posting the solution in case other people are creating a user and they make this simple mistake. It was caused by loading the sys connection and just changing the password and not changing the role

ORA-01031 Insufficient privileges while CREATING a VIEW?

When I try to create a view that including different tables I'm getting the following error:
Error at Line 1:
ORA-01031 Insufficient privileges.
Could anyone tell me what could be the problem. I tried following the another stackoverflow post mentioned here but it's pertaining to
different schemas.
ORA-01031: insufficient privileges when selecting view
Please let me know as I'm new here.
My Query is as follows:
ORiginal Question:Create a view to select employee ID, employee name, hire date, and department number.
MY SOLUTION:
CREATE VIEW SIMPVIEW AS
SELECT EMPNO, ENAME, HIREDATE,DEPTNO
FROM EMP;
Then probably you may not have the privileges to perform the CREATE VIEW command in your database schema... Log in into SYSDBA account and issue the command
GRANT CREATE VIEW TO <dbusername>;
Here <dbusername> should be replaced with the name of the user you want to give access to the CREATE VIEW command.
You can check if your user has VIEW creation privileges using select * from session_privs.
Note that to be able to create a view, the user that is creating it needs to have been granted SELECT privileges on all the objects being used, as well as the mentioned CREATE VIEW privilege. You can also check that by querying to USER_TAB_PRIVS with the user getting the error.
when I wanted to execute the above query in sql developer I faced issues as I did not have enough privileges to create a view or other oracle object schema such as trigger, packages, procedures etc. I found the error to i.e. “Error at Line 1: ORA-01031 Insufficient privileges”. so, I needed the all privileges to practice all these queries and programs. I took the following steps in order to solve my problem:
As I logged in as a user name ‘scott’, so my name is ‘scott’ not ‘Dhruv’. My ambition was to grant all the privileges to me i.e. to the user ‘scott’.
For that, I need to enter in the database as a DBA. Now, question is! How to log in as DBA. For this, I opened command prompt and I logged in the database as sysdba by following the below steps:
a) In window run, I typed cmd to open command prompt. I typed: sqlplus /nolog which means that I logged in without providing required credentials.
b) I authenticated myself for my underlying O/S and entered in database as DBA. For that, I typed in command prompt: connect / as sysdba;
c) I evaluated who is the DBA user in my database if exists. For that I typed: select name from V$database;
d) Here we go after this command. I finally granted myself (scott) to create view in sql developer by typing the command: grant create view to scott;
e) Finally, I granted myself all the privileges by typing: grant all privileges to scott;
Snapshot of command prompt: I have attached.
Finally, I executed and created my view: I have attached
I had this error, and the solution was to grant select WITH GRANT OPTION
to a table from another schema that was included in the view.
At first You need to give the user authentication so you need to know who dba in normal the system give this authentication so make conn system/ *password*
give grand or authentication by put grant create view to *DataBaseUsername*;
make the connection to your user and apply your command
You have to give select any table privilege to the user. Then the view will compile successfully. No need to explicitly grant select to the user to all the objects.