It is perfectly legal for insiders to buy and sell stock in their company. In fact, there are thousands of insider trading reports everyday. As long as the insider is trading on information that is generally available to the public no laws are broken.
Illegal insider trading is trading based on nonpublic information and may include "tipping" such information. For example, if the CEO knows the company is not going to get a big contract and sells before telling the world, that's illegal. Yet illegal insider trading is very difficult to prove.