How To Install Dbms_Network_Acl_Admin Package

How To Install Dbms_Network_Acl_Admin Package

How To Install Dbms_Network_Acl_Admin Package Rating: 7,4/10 1353 votes

Re: How to install -only- dbmsnetworkacladmin on 11.2 sol.beach Nov 4, 2014 2:14 PM ( in response to user12987613 ) Identify a database that contains the desired package, then export only this package so you can subsequently import where needed. Exec DBMSNETWORKACLADMIN. DBMSTNS package for tnsping in database Oracle 12.2. 4 thoughts on “how to send mail using.

8i 9i 10g 11g 12c 13c 18c 19c Misc PL/SQL SQL RAC WebLogic Linux

Home » Articles » 11g » Here

Oracle allows access to external network services using several PL/SQL APIs (UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP and UTL_INADDR), all of which are implemented using the TCP protocol. In previous versions of the database, access to external services was effectively an on/off switch based on whether a user was granted execute permissions on a specific package or not. Oracle 11g introduces fine grained access to network services using access control lists (ACL) in the XML DB repository, allowing control over which users access which network resources, regardless of package grants.

Access control lists can be created, amended and deleted in the XML DB repository directly using FTP or WebDav. In addition, Oracle provide the DBMS_NETWORK_ACL_ADMIN and DBMS_NETWORK_ACL_UTILITY packages to allow ACL management from PL/SQL. These APIs are the subject of this article.

Related articles.

Create an Access Control List (ACL)

Access control lists are manipulated using the DBMS_NETWORK_ACL_ADMIN package. The CREATE_ACL procedure uses the following parameters to create a new ACL:

  • acl - The name of the access control list XML file, generated relative to the '/sys/acls' directory in the XML DB Repository.
  • description - A description of the ACL.
  • principal - The first user account or role being granted or denied permissions. The text is case sensitive.
  • is_grant - TRUE to grant, FALSE to deny the privilege.
  • privilege - Use 'connect' for UTL_TCP, UTL_SMTP, UTL_MAIL and UTL_HTTP access. Use 'resolve' for UTL_INADDR name/IP resolution. The text is case sensitive.
  • start_date - Default value NULL. When specified, the ACL will only be active on or after the specified date.
  • end_date - An optional end date for the ACL.

The following code creates two test users to act as principals, then creates a new ACL.

Once created, the ACL is visible in the 'http://host:port/sys/acls/' directory.

Additional users or roles are added to the ACL using the ADD_PRIVILEGE procedure. Its parameter list is similar to the CREATE_ACL procedure, with the omission of the DESCRIPTION parameter and the addition of a POSITION parameter, which sets the order of precedence.

Each principal is defined as a separate access control element (ACE), within the ACL. When multiple principles are defined, they are evaluated in order from top to bottom, with the last relevant reference used to define the privilege. This means a role that denies access to a resource can be granted to a user, but if the user is defined as a principal further down the file, that definition will override the role definition for that user. Use the POSITION parameter to ensure privileges are evaluated in order.

Privileges are removed using the DELETE_PRIVILEGE procedure. If the IS_GRANT or PRIVILEGE parameters are NULL, all grants or privileges for the ACL and principal are removed.

ACLs are deleted using the DROP_ACL procedure.

Assign an ACL to a Network

Access control lists are assigned to networks using the ASSIGN_ACL procedure, whose parameters are listed below:

How To Install Dbms_Network_Acl_Admin Package
  • acl - The name of the access control list XML file.
  • host - The hostname, domain, IP address or subnet to be assigned. Hostnames are case sensitive, and wildcards are allowed for IP addresses and domains.
  • lower_port - Defaults to NULL. Specifies the lower port range for the 'connect' privilege.
  • upper_port - Defaults to NULL. If the lower_port is specified, and the upper_port is NULL, it is assumed the upper_port matches the lower_port.

The code below shows the ACL created previously being assigned to a specific IP address and a subnet.

Only one ACL can be assigned to a specific host and port-range combination. Assigning a new ACL to a specific host and port-range results in the deletion of the previous assignment. You must take care when making a new assignment that you are not opening ports that were closed by a previous ACL assignment, or you could be opening yourself to attack. When wildcard usage causes overlapping assignments, the most specific assignment will take precedence, so an ACL assigned to 192.168.2.3:80 takes precedence over once assigned to 192.168.2.* etc.

The UNASSIGN_ACL procedure allows you to manually drop ACL assignments. It uses the same parameter list as the ASSIGN_ACL procedure, with any NULL parameters acting as wildcards. Nero 7 startsmart download serial.

ACL Views

The DBA_NETWORK_ACLS, DBA_NETWORK_ACL_PRIVILEGES and USER_NETWORK_ACL_PRIVILEGES views display the current ACL settings. The expected output below assumes none of the delete/drop/unassign operations have been performed.

The DBA_NETWORK_ACLS view displays information about network and ACL assignments.

The DBA_NETWORK_ACL_PRIVILEGES view displays information about privileges associated with the ACL.

The USER_NETWORK_ACL_PRIVILEGES view displays the current users network ACL settings.

How To Install Dbms_Network_Acl_Admin Package

Checking Privileges

In addition to the ACL views, privileges can be checked using the CHECK_PRIVILEGE and CHECK_PRIVILEGE_ACLID functions of the DBMS_NETWORK_ACL_ADMIN package.

The DBMS_NETWORK_ACL_UTILITY package contains functions to help determine possible matching domains. The DOMAINS table function returns a collection of all possible references that may affect the specified host, domain, IP address or subnet, in order of precedence.

The DOMAIN_LEVEL function returns the level of the specified host, domain, IP address or subnet.

These functions may be useful for when querying the ACL views for possible matches to a specific host, domain, IP address or subnet.

Test the ACL

The TEST1 and TEST2 users have the ACL allowed and denied respectively. This means we can test the ACL functionality by comparing their responses to calls to external network services. The following code grants execute permission on the UTL_HTTP package to both users, then attempts to access a web page from each user.

From this we can see that the TEST1 user was able to access the web page, while the TEST2 user was denied access by the ACL.

The default action of the server is to deny access to external network service, as shown by the following test on a new user.

This may cause some confusion when upgrading databases that access external network services from 10g to 11g. In these situations, it will be necessary to implement suitable access control lists before your original functionality is possible.

Other Security Considerations

Pete Finnigan commented on his blog and in his security presentations about the fact that the ACLs are not tied to a specific package. This means opening a port on a server with the 'connect' privilege makes it accessible by UTL_TCP, UTL_SMTP, UTL_MAIL and UTL_HTTP. With this in mind there are some things to consider:

  • The use of fine-grained access to network services is not an excuse to ignore basic security measures, like revoking unnecessary privileges on network service related packages.
  • Control over the services you make available is possible by limiting access to the specific ports. If you only need HTTP access to port 80, specify the port rather than opening access to all ports on the server.
  • Wildcards can be dangerous as you may be granting access to more servers that you should.
  • You must protect your ACLs. If people can alter them, they become useless as a protection mechanism. Prevent direct access to the ACLs in the XML DB repository and make sure users don't have access to the management APIs.

Thanks to Pete Finnigan for his input.

Open ACL

From a security standpoint, it's not a good idea to allow complete network access from the database, but for testing features I sometimes find it useful to create an open ACL for an instance.

For more information see:

Hope this helps. Regards Tim..

Last updated on DECEMBER 06, 2019

Applies to:

Oracle Database - Enterprise Edition - Version 11.1.0.6 to 12.2.0.1 [Release 11.1 to 12.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.

Symptoms

Oracle XML Database (XDB) component is invalid on a fresh database after installing XDB following <Note 1292089.1> and some packages will not compile: sys.dbms_network_acl_admin, sys.dbms_xs_principal_events_int, sys.xs$catview_util, xdb.dbms_resconfig. The one that is not wrapped (sys.xs$catview_util) indicated a problem with xdb.xs$securityclass - this table does not exist. When I run the xdbusage10ginvalid.sql script, I get the following:

SQL> select comp_name, version, status from dba_registry;
COMP_NAME VERSION STATUS
---------------------------------- ----------------------- ----------
Oracle XML Database 11.2.0.2.0 INVALID
Oracle Database Catalog Views 11.2.0.2.0 VALID
Oracle Database Packages and Types 11.2.0.2.0 VALID
JServer JAVA Virtual Machine 11.2.0.2.0 VALID
Oracle XDK 11.2.0.2.0 VALID
Oracle Database Java Packages 11.2.0.2.0 VALID
SQL> select object_type,object_name, owner from dba_objects
where status ='INVALID' and
owner in ('SYS','SYSTEM','XDB')
order by owner, object_name, object_type;
OBJECT_TYPE OBJECT_NAME OWNER
------------------- ------------------------------ --------
PACKAGE BODY DBMS_METADATA SYS
PACKAGE BODY DBMS_NETWORK_ACL_ADMIN SYS
PACKAGE BODY DBMS_XS_PRINCIPAL_EVENTS_INT SYS
PACKAGE BODY XS$CATVIEW_UTIL SYS
PACKAGE BODY DBMS_CSX_INT XDB
PACKAGE BODY DBMS_RESCONFIG XDB
PACKAGE BODY DBMS_XDB XDB
PACKAGE BODY DBMS_XDBRESOURCE XDB
PACKAGE BODY DBMS_XDBUTIL_INT XDB
PACKAGE BODY DBMS_XDBZ0 XDB
PACKAGE BODY DBMS_XMLDOM XDB
PACKAGE BODY DBMS_XMLPARSER XDB
PACKAGE BODY DBMS_XMLSCHEMA XDB
PACKAGE BODY DBMS_XSLPROCESSOR XDB
PACKAGE BODY XIMETADATA_PKG XDB
15 rows selected.
SQL> select owner, schema_url
from dba_xml_schemas
order by 1,2;
OWNER SCHEMA_URL
-------- ----------------------------------------------------------
XDB http://xmlns.oracle.com/xdb/XDBResource.xsd
XDB http://xmlns.oracle.com/xdb/XDBSchema.xsd
2 rows selected.
SQL> select any_path from resource_view;
ERROR:
ORA-01002: fetch out of sequence

Changes

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document
Symptoms
Changes
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.

How To Install Dbms_Network_Acl_Admin Package
© 2020