Community discussions

MikroTik App
 
User avatar
KatsuroKurosaki
just joined
Topic Author
Posts: 18
Joined: Tue Jul 24, 2012 10:53 am
Contact:

Use API over Internet. It is secure?

Wed Aug 15, 2012 9:57 pm

Good afternoon everyone,

Currently running RouterOS 5.19, we are planning to do some API operations over Internet, and our boss is worried about passwords, if they are sent in plaintext and/or it is secure enough to do it.
We don't want people sniff our passwords and do unwanted operations to our devices :P

Thank you everyone for your help and time.
 
ayufan
Member
Member
Posts: 334
Joined: Sun Jun 03, 2007 9:35 pm
Contact:

Re: Use API over Internet. It is secure?

Wed Aug 15, 2012 10:11 pm

Use ssh port forwarding in order to access local (or even remote) API interface. It should help with your security concerns.
 
User avatar
KatsuroKurosaki
just joined
Topic Author
Posts: 18
Joined: Tue Jul 24, 2012 10:53 am
Contact:

Re: Use API over Internet. It is secure?

Wed Aug 15, 2012 10:17 pm

Thanks for your reply :)

Do you mean to use API over a SSH tunnel?
Well, I forgot to say that API commands are going to run on a PHP Server.

Regards
 
ayufan
Member
Member
Posts: 334
Joined: Sun Jun 03, 2007 9:35 pm
Contact:

Re: Use API over Internet. It is secure?

Thu Aug 16, 2012 12:31 am

Exactly. SSH allows to forward connections both ways. You can always use following scenario:

1. MikroTik API
a. ip service enable api
b. ip service set api address=127.0.0.1/32

2. PHP Server
a. ssh -L 28728:127.0.0.1:8728 <mt-address>
- run in background or on screen

b. connect to api on: 127.0.0.1:28728
- 127.0.0.1:28728 is local ssh forward port it will redirect all traffic to remote location and connect to remote's 127.0.0.1:8728 (api service)

That way you are fully secure. No additional configuration required ;)


There's always option to make secure VPN network (you have sstp, l2tp, pptp, ovpn) and connect to central VPN server...
 
User avatar
greencomputing
Frequent Visitor
Frequent Visitor
Posts: 95
Joined: Wed Jun 23, 2010 1:12 pm
Location: Italy

Re: Use API over Internet. It is secure?

Thu Aug 16, 2012 1:03 am

Hi sir
that configuration was really helpful! thanks avlot for sharing t with us

have a nice day
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Use API over Internet. It is secure?

Thu Aug 16, 2012 12:06 pm

Note that even without an SSH tunnel, the RouterOS password is never sent in plain text. The whole procedure is a CHAP challenge, similarly to the one in hotspot. Without a tunnel, all other data is sent and received without any form of encryption though.
 
ayufan
Member
Member
Posts: 334
Joined: Sun Jun 03, 2007 9:35 pm
Contact:

Re: Use API over Internet. It is secure?

Thu Aug 16, 2012 12:17 pm

Note that even without an SSH tunnel, the RouterOS password is never sent in plain text. The whole procedure is a CHAP challenge, similarly to the one in hotspot. Without a tunnel, all other data is sent and received without any form of encryption though.
Whole process uses md5 and someone may try to bruteforce password.
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: Use API over Internet. It is secure?

Thu Aug 16, 2012 12:20 pm

True, but at least it's not clear text, and it still requires brute force, without rainbow tables and the like.

(Using an SSH tunnel is still better than no tunnel. I'm just saying that without a tunnel, the situation is one notch less dangerous than "everything is clear text".)
 
User avatar
KatsuroKurosaki
just joined
Topic Author
Posts: 18
Joined: Tue Jul 24, 2012 10:53 am
Contact:

Re: Use API over Internet. It is secure?

Mon Aug 20, 2012 2:46 pm

Excuse me to take this long to reply.
Actualy we are doing tests and considering the best option to secure our Mikrotik devices. I would gladly thank everyone for their replies and time. :D

Also, one of our options is to use an Ubuntu Server as PPTP Server, and all Mikrotik connect to it using PPTP Client, forcing all devices to use MS-CHAPv2 as encryption protocol, to enseure secure communications.

Thank you everyone again. :D
 
User avatar
Chupaka
Forum Guru
Forum Guru
Posts: 8712
Joined: Mon Jun 19, 2006 11:15 pm
Location: Minsk, Belarus
Contact:

Re: Use API over Internet. It is secure?

Tue Aug 28, 2012 12:36 am

Also, one of our options is to use an Ubuntu Server as PPTP Server, and all Mikrotik connect to it using PPTP Client, forcing all devices to use MS-CHAPv2 as encryption protocol, to enseure secure communications.
ms-chap is not encryption, it's authentication. encryption in PPTP is MPPE*, which is less secure than ssh tunnel
 
polymathic
just joined
Posts: 5
Joined: Wed Aug 29, 2012 4:16 am

Re: Use API over Internet. It is secure?

Wed Aug 29, 2012 4:21 am

In light of recent work against MS-CHAPv2, and the fact that even Microsoft has deprecated PPTP (in favor of SSTP which is a little more sane from a protocol design standpoint), I'd be very wary of using PPTP in production for anything actually sensitive.

MS-CHAP was weak the day it was announced, which is why MS-CHAPv2 happened in the first place. PPTP is, well, PPTP. It's byzantine from the perspective of protocol design, and when one works through the actual entropy involved in the keyspace, it's ridiculously small.

If you want to read more about the current success against these, I'd suggest looking here.
https://www.cloudcracker.com/blog/2012/ ... s-chap-v2/

For the horse's mouth, you might look here:
http://blogs.technet.com/b/srd/archive/ ... ation.aspx
 
User avatar
KatsuroKurosaki
just joined
Topic Author
Posts: 18
Joined: Tue Jul 24, 2012 10:53 am
Contact:

Re: Use API over Internet. It is secure?

Tue Nov 13, 2012 11:55 am

Also, one of our options is to use an Ubuntu Server as PPTP Server, and all Mikrotik connect to it using PPTP Client, forcing all devices to use MS-CHAPv2 as encryption protocol, to enseure secure communications.
ms-chap is not encryption, it's authentication. encryption in PPTP is MPPE*, which is less secure than ssh tunnel
Sorry for late reply; you're right, I confused terms here. Thanks for correcting me :)
In light of recent work against MS-CHAPv2, and the fact that even Microsoft has deprecated PPTP (in favor of SSTP which is a little more sane from a protocol design standpoint), I'd be very wary of using PPTP in production for anything actually sensitive.

MS-CHAP was weak the day it was announced, which is why MS-CHAPv2 happened in the first place. PPTP is, well, PPTP. It's byzantine from the perspective of protocol design, and when one works through the actual entropy involved in the keyspace, it's ridiculously small.

If you want to read more about the current success against these, I'd suggest looking here.
https://www.cloudcracker.com/blog/2012/ ... s-chap-v2/

For the horse's mouth, you might look here:
http://blogs.technet.com/b/srd/archive/ ... ation.aspx
Interesting, thank you very much; I'm going to look at this to improve the security of our communications. :)