Access Control Lists(ACL's) , Configuration and Deconfiguration

 In the world of oracle database, most of the DBA'S concentrate on Migration, Upgradation, replication and other database activities. Today, we will learn a new concept called Access Control List (ACL) which configures rules/regulation for database users to connect to external networks.

Access Control List(ACL) is a fine-grained security mechanism. It is a list of access control entries to restrict the hosts that are allowed to connect to the Oracle database . From 11G, all external network access is blocked by default and can be enabled through Access Control List(ACL).


High Level Steps in Configuring ACL

--Create ACL

--Assign Network access to ACL

--Add Users to the ACL

--Validate the ACL's which are created


High Level steps for ACL Deconfiguration

--Unassign network from ACL's


Following are the steps for Create ACLs for public or HR schema:

Create the ACL

BEGIN

DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (

acl => 'hr_utl_http.xml',

description => 'Allow mail',

principal => 'PUBLIC',  --- you can assign PUBLIC or user like 'HR'

is_grant => TRUE,

privilege => 'connect',

start_date => SYSTIMESTAMP,

end_date => NULL);

COMMIT;

END;

/

2. Assign ACL to network.

BEGIN

DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (

acl => 'hr_utl_http.xml',

host => '192.168.63.63', -- specify the host IP address 

lower_port => 34,       -- specify the port range lower value (* for all)

upper_port => 63);      -- specify the port range higher value

COMMIT;

END;

/

3. Grant privilege to user or Public

Connect Privilege allows to connect to a host and send/receive data, where as resolve allows to look up hostname/ip addresses with UTL_INADDR package

-- Grant connect permission 

BEGIN

DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(

acl => 'hr_utl_http.xml',

principal => 'PUBLIC',  --if you want user like 'HR' 

is_grant => true,

privilege => 'connect');

COMMIT;

END;

/


-- grant resolve permission

BEGIN

DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(

acl => 'hr_utl_http.xml',

principal => 'PUBLIC',  --if you want user like 'HR' 

is_grant => true,

privilege => 'resolve');

COMMIT;

END;

/


4. Verified the ACL is created.

SELECT * FROM DBA_NETWORK_ACLS;

SELECT * FROM DBA_NETWORK_ACL_PRIVILEGES;


Rollback or Remove the ACL permission.

Remove the created permission or ACL rule from the Oracle Database.

--Un-assign network from ACL:

exec DBMS_NETWORK_ACL_ADMIN.UNASSIGN_ACL(acl =>'hr_utl_mail.xml',lower_port =>'*',upper_port =>25);


-- Remove privilege from an user:

exec DBMS_NETWORK_ACL_ADMIN.DELETE_PRIVILEGE(acl =>'hr_utl_mail.xml',principal =>'PUBLIC',is_grant =>TRUE,privilege =>'connect');

exec DBMS_NETWORK_ACL_ADMIN.DELETE_PRIVILEGE(acl =>'hr_utl_mail.xml',principal =>'PUBLIC',is_grant =>TRUE,privilege =>'resolve');


-- Drop ACL:

exec DBMS_NETWORK_ACL_ADMIN.DROP_ACL (acl => 'hr_utl_mail.xml' );




Comments

Popular posts from this blog

Oracle GoldenGate Microservices Architecture - 1

All About Oracle Database Block

ORACLE CLOUD INFRASTRUCTURE(OCI) FOR ABSOLUTE BEGINNER'S