Entangled ways of product development in the area of cybersecurity #2 - BitSwan

🇨🇿 Česká verze je níže / Scroll down for Czech version.

BitSwan, data processing and analysis

After successfully completing my engineering degree, I finally started working full-time at TeskaLabs just as I initially promised. In addition to data from the world of telecommunications, we started to learn data from the world of logistics in BitSwan, which of course required being able to calculate the cost of transporting some cargo from point A to point B. To do this, I was tasked with writing a simple microservice that could estimate this for some pre-specified system of routes. It was a rather suboptimal recursive algorithm in Python, and it was not nearly enough to calculate a similar route for the whole of Europe. However, I discovered an experimental/academic library written in C++ called Routing Kit, which was based on the Contraction Hierarchy algorithm, simplified to a precomputed system of shortcuts from any point A to any point B. So I wrote a C++ program that used the Routing Kit and the data from OpenStreetMap. Ales and I then created microservices to compute additional attributes to each route within the maps, and connected everything via ASAB. To connect the C++ part of the code with the asynchronous Python part, we had to write a "bridge" in C and the Python library ctypes (I'll get to Cython later).

Then, at the end of the summer, Mila managed to hire a new colleague, Margarita, who was studying data science at the Faculty of Electrical Engineering at CTU. This was just right for us to write the first parsers in our data parsing pumps, in addition to processors. Under Aleš's guidance, we were able to detect the first irregularities over telecommunication data, for example the failure of a transmitter. Until now we used RabbitMQ to pass events and data in general between the data pumps, but in the fall we switched to Apache Kafka in new deployments. What's it for? Kafka allows you to store data for a period of time, which it then sends to the next service when it is available and able to process the data. In addition, it can divide the data fairly among all available consumers, i.e. microservices that read the same type of data. With Margarita, we wrote new algorithms and created time-window (time-constrained) and session (state of entities, such as users or devices) parsers and added them to pumps. Gradually other colleagues joined us and our team grew.

In fact, during the beginning of my work at TeskaLabs, Mila asked me what my favorite color was. I answered green, and our team was called Green Team from then on. Gradually, the business part of our company organized itself into a team and called itself the Blue Team. While the Blue Team grew slowly, the Green Team by the end of 2018 and the beginning of 2019 already had six members without Ales, and so it was time for the team to split into two non-violently, much like a cell in biology. "There are two ways to become more senior, more experienced," Ales told me one evening, "the first is to become an expert in any one technology, but you risk getting stuck there. The second option is team leading and delivering." So, after a company-wide move to a larger office, I became the leader of a new team, where there were only four of us to begin with. Besides me, there was Adam, Honza and Margarita.

Fruit must be harvested when ripe

We had to come up with a name for the new team. Naturally, we wanted to choose a color, so we decided to look at the HTML color chart. As I was going through an exercise at the time on how important it is to tighten up, deploy and present implementations, otherwise it is basically a worthless investment, my attention started to wander around ripe fruit, and thus eventually a color called plum (this context is still listed in our team channel description in our company Slack). Thus, the plum team, the Plum Team, was formed to specialize in data analytics and, in the future, machine learning.

We continued to deploy pumps and a few projects in telecom and logistics, but wanted to leave those and focus more on the product itself. We also played around with transcribing photos of documents into text and speech, but the focus of the company was an ever-evolving cybersecurity product called SeaCat. Its delivery was handled by Ales and Mila, who worked with his green team on projects for electronic sales records and security audits. But we also saw these projects as somewhat temporary.

One day Aleš asked us how we saw our future. While virtually all the other members of the Plum team were excited about the idea of data science and machine learning, I personally answered that I wanted to get better at software engineering. Because that's the profession I decided to pursue at the age of thirteen. Data science is just such a bonus that can come out of it, but when I understand the information that data carries in real time. Analyzing year-old data only when a serious incident occurs is like trying to catch a canary escaping from its cage. Even the best network, the best model won't help you there.

Other parts of this series can be found here.

🇨🇿 Spletité cesty produktového vývoje v oblasti kybernetické bezpečnosti #2 - BitSwan

BitSwan, zpracování dat a jejich analýza

Když jsem úspěšně dokončil inženýrské státnice, začal jsem konečně v TeskaLabs pracovat na full-time přesně, jak jsem na začátku slíbil. Vedle dat ze světa telekomunikací jsme se začali v BitSwanu učit data ze světa logistiky, k čemuž ovšem bylo třeba umět spočítat cenu přepravy nějakého nákladu z místa A do místa B. K tomu jsem dostal za úkol napsat jednoduchou mikroslužbu, která by toto dokázala odhadnout pro nějaký předem zadaný systém cest. Jednalo se o poměrně neoptimální rekurzivní algoritmus v Pythonu, navíc ani zdaleka nedostačoval k tomu, abychom mohli podobnou trasu počítat pro celou Evropu. Objevil jsem však experimentální/akademickou knihovnu napsanou v C++ s názvem Routing Kit, která byla založená na algoritmu Contraction Hierarchy, zjednodušeně na předpočítaném systému zkratek z libovolného bodu A do libovolného bodu B. Napsal jsem tedy program v C++, který Routing Kit a data z OpenStreetMap využíval. S Alešem jsme pak vytvořili mikroslužby pro počítání dodatečných atributů k jednotlivým cestám v rámci map a vše jsme propojili přes ASAB. Abychom spojili C++kovou část kódu s asynchronním Pythonem, museli jsme napsat „bridge“ v Cčku a pythoní knihovně ctypes (k Cythonu se dostanu později).

Koncem léta se pak Mílovi podařilo najmout novou kolegyni Margaritu, která na Fakultě elektrotechnické ČVUT studovala data science. To se nám právě hodilo, abychom do našich datových parsovacích pump mohli kromě procesorů psát první analyzéry. Pod vedením Aleše jsme tak byli schopni detekovat první nesrovnalosti nad telekomunikačními daty, například výpadek nějakého vysílače. Dosud jsme na předávání událostí a obecně dat mezi jednotlivými datovými pumpami používali RabbitMQ, ale na podzim jsme v nových nasazeních přesedlali na Apache Kafka. K čemu nám vlastně je? Kafka umožňuje po určitý čas uchovávat data, které pak pošle další službě v okamžiku, kdy je dostupná a schopná data zpracovávat. Navíc může data spravedlivě dělit mezi všechny dostupné konzumery, tj. mikroslužby, které čtou stejný typ dat. S Margaritou jsme psali nové algoritmy a vytvářeli time-window (časově omezené) a session (stav entit, například uživatelů nebo zařízení) analyzéry a přidávali je do pump. Postupně se k nám přidali další kolegové a náš tým se rozrostl.

Vlastně už během začátku práce v TeskaLabs se mě Míla zeptal, jaká je moje nejoblíbenější barva. Odpověděl jsem, že zelená, a náš tým se od té doby jmenoval Green Team. Postupně se i obchodní část naší firmy zorganizovala do týmu a nazvala se Blue Team. Zatímco modrý tým rostl jen pomalu, zelený tým koncem roku 2018 a začátkem roku 2019 měl už bez Aleše šest členů, a tak nastal čas na to, aby se tým nenásilně rozdělil na dva, podobně jako v biologii buňka. „Existují dvě možnosti, jak se stát seniornějším, zkušenějším,“ řekl mi Aleš jednou večer, „první možností je, že se staneš expertem v nějaké jedné technologii, ale hrozí, že se tam zasekneš. Druhou možností je team leading a dotahování dodávek.“ Tak jsem se po celofiremním přesunu do větší kanceláře stal leaderem nového týmu, kde jsme byli ze začátku pouze čtyři. Kromě mě ještě Adam, Honza a Margarita.

Ovoce je třeba sklízet zralé

Museli jsme vymyslet pro nový tým název. Pochopitelně jsme chtěli zvolit barvu a tak jsme se rozhodli prohlédnout tabulku HTML barev. Protože jsem v tu chvíli procházel cvičením, jak je důležité implementace dotahovat, nasazovat a odprezentovat, jinak se jedná v podstatě o bezcennou investici, moje pozornost se začala motat kolem zralého ovoce, a tedy nakonec barvy zvané švestková (tato souvislost je stále uvedena v popisu našeho týmového kanálu v našem firemním Slacku). Vznikl tak švestkový tým, Plum Team, který se měl specializovat na datovou analýzu a v budoucnu i machine learning.

Pokračovali jsme v nasazování pump a několika projektech v oblasti telekomunikací a logistiky, které jsme však chtěli opustit a více se věnovat produktu jako takovému. Hráli jsme si i s přepisem fotografií dokumentů do textu a do mluvené řeči, ale těžištěm firmy byl stále rozvíjející se produkt pro kybernetickou bezpečnost jménem SeaCat. O jeho dodávky se staral Aleš s Mílou, který se svým zeleným týmem pracoval na projektech pro elektronickou evidenci tržeb a bezpečnostních auditech. Tyto projekty jsme ale také vnímali tak trochu jako dočasné.

Jednou se nás Aleš zeptal, jak vidíme svoji budoucnost. Zatímco prakticky všichni ostatní členové švestkového týmu byli nadšení myšlenkou data science a machine learning, osobně jsem odpověděl, že se chci zlepšovat v softwarovém inženýrství. Protože to je povolání, pro které jsem se rozhodl už ve svých třinácti letech. Data science je jen takový bonus, který z toho může vyplynout, ale až pochopím informace, které data nesou v reálném čase. Analyzovat rok stará data teprve, když dojde k nějakému vážnému incidentu, mi přijde, jako kdyby se někdo snažil chytit kanárka uprchlého z klece. Tam vám ani sebelepší síť, sebelepší model nepomůže.

Další části této série naleznete zde.

About the Author

Premysl Cerny

Software Developer at TeskaLabs




You Might Be Interested in Reading These Articles

5 Things to Look for in an Enterprise Mobile Development Platform Solution

Today many enteprises are looking to have their own mobile applications. With the right solution, you can build a mobile app that will fit your organization’s needs like a glove and be in the driver’s seat of the development.

Continue reading ...

mobile development

Published on September 01, 2015

What TCP port to use with SeaCat?

SeaCat requires to specify one TCP port that is eventually used for client-gateway communication. Clients connect to this port to establish TLS channel that is used to exchange requests and related responses. SPDY-based communication protocol is used for traffic in this channel.

Continue reading ...

tech

Published on May 23, 2014

What Is Mobile Application Containerization or Wrapper, and Why It Needs to Go?

Containerization is an alternative for full machine virtualization. You probably know well-known containerization technology from Docker or Rocket. However, this article addresses the pros and cons of mobile “containerization” or wrapper used to isolate the mobile app from the mobile operating system or other applications installed on the same device. These type of “containerization” work in a different way.

Continue reading ...

tech security

Published on September 27, 2016