| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Introduction} | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | PLEASE READ THE FOLLOWING IMPORTANT SECURITY RELATED INFORMATION. | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | IMPROPER CONFIGURATION OF ASTERISK COULD ALLOW UNAUTHORIZED USE OF YOUR | 
					
						
							|  |  |  | FACILITIES, POTENTIALLY INCURRING SUBSTANTIAL CHARGES. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2005-10-18 21:06:38 +00:00
										 |  |  | Asterisk security involves both network security (encryption, authentication) | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | as well as dialplan security (authorization - who can access services in | 
					
						
							| 
									
										
										
										
											2005-10-18 21:06:38 +00:00
										 |  |  | your pbx). If you are setting up Asterisk in production use, please make | 
					
						
							|  |  |  | sure you understand the issues involved. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Network Security} | 
					
						
							| 
									
										
										
										
											2005-10-18 21:06:38 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | If you install Asterisk and use the "make samples" command to install | 
					
						
							|  |  |  | a demonstration configuration, Asterisk will open a few ports for accepting | 
					
						
							|  |  |  | VoIP calls. Check the channel configuration files for the ports and IP addresses. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | If you enable the manager interface in manager.conf, please make sure that | 
					
						
							|  |  |  | you access manager in a safe environment or protect it with SSH or other | 
					
						
							|  |  |  | VPN solutions. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | For all TCP/IP connections in Asterisk, you can set ACL lists that | 
					
						
							|  |  |  | will permit or deny network access to Asterisk services. Please check | 
					
						
							|  |  |  | the "permit" and "deny" configuration options in manager.conf and | 
					
						
							|  |  |  | the VoIP channel configurations - i.e. sip.conf and iax.conf. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | The IAX2 protocol supports strong RSA key authentication as well as | 
					
						
							|  |  |  | AES encryption of voice and signalling. The SIP channel does not | 
					
						
							|  |  |  | support encryption in this version of Asterisk. | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Dialplan Security} | 
					
						
							| 
									
										
										
										
											2005-10-18 21:06:38 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | First and foremost remember this: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USE THE EXTENSION CONTEXTS TO ISOLATE OUTGOING OR TOLL SERVICES FROM ANY | 
					
						
							|  |  |  | INCOMING CONNECTIONS. | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | You should consider that if any channel, incoming line, etc can enter an | 
					
						
							|  |  |  | extension context that it has the capability of accessing any extension | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | within that context. | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Therefore, you should NOT allow access to outgoing or toll services in | 
					
						
							|  |  |  | contexts that are accessible (especially without a password) from incoming | 
					
						
							|  |  |  | channels, be they IAX channels, FX or other trunks, or even untrusted | 
					
						
							|  |  |  | stations within you network.  In particular, never ever put outgoing toll | 
					
						
							|  |  |  | services in the "default" context.  To make things easier, you can include | 
					
						
							|  |  |  | the "default" context within other private contexts by using: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | 	include => default | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | in the appropriate section.  A well designed PBX might look like this: | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | \begin{astlisting} | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \begin{verbatim} | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | [longdistance] | 
					
						
							| 
									
										
										
										
											2008-06-12 17:27:55 +00:00
										 |  |  | exten => _91NXXNXXXXXX,1,Dial(DAHDI/g2/${EXTEN:1})
 | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | include => local | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [local] | 
					
						
							| 
									
										
										
										
											2008-06-12 17:27:55 +00:00
										 |  |  | exten => _9NXXNXXX,1,Dial(DAHDI/g2/${EXTEN:1})
 | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | include => default | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | [default] | 
					
						
							| 
									
										
										
										
											2008-06-12 17:27:55 +00:00
										 |  |  | exten => 6123,Dial(DAHDI/1) | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \end{verbatim} | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | \end{astlisting} | 
					
						
							| 
									
										
										
										
											2001-08-23 17:57:10 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-11-10 18:09:19 +00:00
										 |  |  | DON'T FORGET TO TAKE THE DEMO CONTEXT OUT OF YOUR DEFAULT CONTEXT.  There | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | isn't really a security reason, it just will keep people from wanting to | 
					
						
							| 
									
										
										
										
											2005-10-18 21:06:38 +00:00
										 |  |  | play with your Asterisk setup remotely. | 
					
						
							| 
									
										
										
										
											2007-03-14 16:40:52 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2007-03-15 22:29:45 +00:00
										 |  |  | \subsection{Log Security} | 
					
						
							| 
									
										
										
										
											2007-03-14 16:40:52 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | Please note that the Asterisk log files, as well as information printed to the | 
					
						
							| 
									
										
										
										
											2007-10-15 13:12:51 +00:00
										 |  |  | Asterisk CLI, may contain sensitive information such as passwords and call | 
					
						
							| 
									
										
										
										
											2007-03-14 16:40:52 +00:00
										 |  |  | history.  Keep this in mind when providing access to these resources. |