Oracle 11g Error: Network access denied by access control list (ACL)
From Oracle 11g network packages like UTL_TCP, UTL_SMTP, UTL_MAIL, UTL_HTTP, and UTL_INADDR which can be used to access external network resources, are more restricted and secured. Oracle 11g introduced Fine-Grained Access to these packages by creating an Access Control List to use any external network resource through these packages. Before this any user who had an execute privilege on these packages was able to do anything to any network resource like web and local mail servers etc. But now a user needs a little more than just an execute privilege on the network packages.ERROR at line 1:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1722
ORA-24247: network access denied by access control list (ACL)
ORA-06512: at line 1
How to configure Access Control List
We need to configure an Access Control List (ACL) and grant "connect" privilege on that ACL to our user. Then we need to assign host to this ACL and any other host to which user needs access.
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL () - Creates a new Access Control List. Following are the parameters that it takes.
Acl => Name of the Access Control List. This is a XML file which will be created in /sys/acls directory by default.
Description => Description of the ACL.
Principal => Name of the user or role (case sensitive) to whom the permissions are being granted or denied.
is_grant => TRUE or FALSE, whether to grant access or deny access
Privilege => connect or resolve (lowercase always). Will the user be able to connect to the network resource or just could resolve the network address
start_date => Start date (optional) of the access to the user
end_date => End date (optional) of the access to the user
Example:-
BEGIN
DBMS_NETWORK_ACL_ADMIN.CREATE_ACL (
ACL => 'YourUser_utl_http.xml',
DESCRIPTION => 'Allow to call http url',
PRINCIPAL => 'YourUser',
IS_GRANT => TRUE,
PRIVILEGE => 'connect'
);
COMMIT;
END;
Add a privilege to Access Control List
First access to the ACL to any user is granted when the ACL is created with the CREATE_ACL procedure. If any other user or role needs permission on the ACL you may user the procedure ADD_PRIVILEGE.
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE ()
Add access for more users or roles in an already existing ACL. It takes similar parameters as CREATE_ACL procedure except there is no description parameter and a new parameter position which is used in ADD_PRIVILEGE but not in CREATE_ACL.
The position parameter decides the precedence of the rights for multiple users. When granting access to multiple roles and user set the precedence appropriately.
Example:-
BEGIN
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE (
ACL => 'YourUser_utl_http.xml',
PRINCIPAL => 'YourUser',
IS_GRANT => TRUE,
PRIVILEGE => 'resolve'
);
COMMIT;
END;
Assign a network host to Access Control List
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL ()-Assigns a network host local or remote to an ACL. It takes the following parameters:
acl=> Name of the Access Control List.
host=> Name of the host.
lower_port=> Lower port (optional) from the range of ports allowed on this host.
upper_port=> Upper port (optional) from the range of ports allowed on this host
Example:-
BEGIN
DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL (
ACL => 'YourUser_utl_http.xml',
HOST => 'Your domain name eg. www.xyz.com',
LOWER_PORT => 60,
UPPER_PORT => 8080
);
COMMIT;
END;
Hope this is Helpful
Add Comment
Insert Bullet List
Please enter at least one item.
Item:
Item:
Item:
Item:
Item:
Insert Numeric List
Please enter at least one item.
Item:
Item:
Item:
Item:
Item:
Insert Link
Please enter the link of the website
Optionally you can add display text
Insert Email
Please enter the email address
Optionally add any display text
Insert Image
Please enter the link of the image
Insert YouTube Video
Please enter the link of the video
Image Upload
Privacy Policy
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
- Your name, rating, website address, town, country, state and comment will be publicly displayed if entered.
- Aside from the data entered into these form fields, other stored data about your comment will include:
- Your IP address (not displayed)
- The time/date of your submission (displayed)
- Your email address will not be shared. It is collected for only two reasons:
- Administrative purposes, should a need to contact you arise.
- To inform you of new comments, should you subscribe to receive notifications.
- A cookie may be set on your computer. This is used to remember your inputs. It will expire by itself.
This policy is subject to change at any time and without notice.
Terms and Conditions
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
- Although the administrator will attempt to moderate comments, it is impossible for every comment to have been moderated at any given time.
- You acknowledge that all comments express the views and opinions of the original author and not those of the administrator.
- You agree not to post any material which is knowingly false, obscene, hateful, threatening, harassing or invasive of a person's privacy.
- The administrator has the right to edit, move or remove any comment for any reason and without notice.
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
{"commentics_url":"\/\/merachamoli.com\/comments\/","page_id":38,"enabled_country":true,"country_id":0,"enabled_state":true,"state_id":0,"enabled_upload":true,"maximum_upload_amount":3,"maximum_upload_size":5,"maximum_upload_total":5,"captcha":true,"captcha_url":"https:\/\/merachamoli.com\/comments\/frontend\/index.php?route=main\/form\/captcha&page_id=38","cmtx_wait_for_comment":"cmtx_wait_for_comment","lang_error_file_num":"A maximum of %d files are allowed to be uploaded","lang_error_file_size":"Please upload files no bigger than %.1f MB in size","lang_error_file_total":"The total size of all files must be less than %.1f MB","lang_error_file_type":"Only image file types are allowed to be uploaded","lang_text_loading":"Loading ..","lang_placeholder_country":"Country","lang_placeholder_state":"State","lang_text_country_first":"Please select a country first","lang_button_submit":"Add Comment","lang_button_preview":"Preview","lang_button_remove":"Remove","lang_button_processing":"Please Wait.."}
{"commentics_url":"\/\/merachamoli.com\/comments\/","language":"english"}
Comments