Миролюба Бенатова: „Истинският разговор за ролята на ДС в Прехода никога не е започвал“

Post Syndicated from Боряна Телбис original https://www.toest.bg/miroluba-benatova-istinskiyat-razgovor-za-rolyata-na-ds-v-prehoda-nikoga-ne-e-zapochval/

Миролюба Бенатова: „Истинският разговор за ролята на ДС в Прехода никога не е започвал“

Съвсем наскоро, в рамките на по-малко от месец, починаха Красимир Каменов – Къро и Ангел Христов, познат като единия от двамата Братя Галеви. Първият – жестоко убит в дома си в Кейптаун, вторият – починал от естествена смърт в родното си село. За Къро се смяташе, че иска да говори и така са му запушили устата. За Христов се смяташе, че е изчезнал и го няма в България ни жив, ни умрял. И както от години не се говореше за тези хора, изведнъж имената им отново влязоха в ефира, завъртяха се набързо за овации и отпаднаха пак от дневния ред на обществото.

Само че техните имена, както и имената (даже прякорите) на много други като тях, не може да са част от някаква хроника без контекст, защото тези герои на Прехода са пряко свързани с всичко, което ни се случва днес. Те са свързващото звено между близкото минало и настоящето. Вдигано години наред на техните рамене, миналото допълзява до креслото на настоящето, намества се нахално в него и кръвожадно гледа към бъдещето ни. И разчита на това, че няма да го видим, докато се крие в сенките, и няма да го разпознаем, дори да излезе на дневна светлина, защото това, че „нек’ви мутри“ са умрели, не би следвало да засяга никого. Но засяга всеки от нас, защото генезисът на тези хора е пряко свързан със състоянието на обществото и държавата ни.

Защо трябва да говорим за миналото, вместо да го замитаме под килима, и кои връзки между някои от силните днес и някои от силните вчера не бива да се забравят – за това е разговорът ни с Миролюба Бенатова, дългогодишен разследващ журналист и един от малкото хора, интервюирали Братя Галеви, Златомир Иванов – Баретата, емблематични членове от кръга „Монтерей“ и други знакови фигури от новата история на България.

Преди да прочетете интервюто, ви предлагаме да видите този материал на Миролюба Бенатова, в който преди години тя прави подробна хроника на възхода и залеза на някои от съществените играчи на Прехода. Ще си припомните имената на Емил Кюлев, Илия Павлов, Димитър Джамов, Младен Михалев – Маджо, Бай Миле, Маргините, Иван Тодоров – Доктора, Филип Найденов – Фатик, Стоил Славов, Димата Руснака, Георги Илиев, но и на кукловодите от „Монтерей“ – Любен Гоцев и Виктор Вълков.

Изгледайте видеото и докато четете Миролюба в интервюто ѝ за „Тоест“, имайте предвид казаното от Илия Павлов в нейния материал:

Обиждам се от думите, че бизнесът или държавата е бандитска. Тя е бандитска по две причини: първо, защото ние я направихме такава и трябва да я поправим; и втората причина е, че определено конкуренцията пък желае да е такава, защото по-лесно се продават активите.


Защо хората с прякори и техните връзки с властта не бива да се забравят? Ето например наскоро пак се заговори за Братя Галеви в контекста на това, че уж изчезналият Ангел Христов се появи в България, само че починал.

Не бива да се забравят, защото са анамнеза на Прехода. Показват поне част от трансформацията на паяжината от връзки и зависимости във власт и пари. Братя Галеви са известни още от 90-те години, както и други хора от „първия ешелон на Строители на съвременна България“, които бяха пуснати като пушечно месо и разсейваща маневра. Това са бивши служители на МВР и МО, сред които и спортисти, които се оказаха в един момент без спорт, кауза и пари. Хора с дисциплина, хора с умения, хора без работа, на които тогава им беше внушено, че могат да свършат нещо, че са важни, че „ще правят бизнес“. Те също са някакъв вид жертва, още повече че доста от тях вече не са живи.

В края на 80-те и началото на 90-те Братя Галеви са част от Отряда за борба с тероризма, по-известен като „Баретите“. Там са били заедно със Златомир Иванов – Баретата. Един от командирите им е бил Алексей Петров. Тогавашен техен ръководител е бил Красимир Петров – шеф на баретите по време на правителството „Виденов“, директор на „Гранична полиция“ по време на правителството на НДСВ, а в друг момент – шеф по сигурността на „Лукойл“. Всички тези хора помнят Галеви като много добри командоси. Всички изброени също са част от трансформацията на службите за сигурност в частни конгломерати, чийто инструментариум продължава да е и влияние с информация.

Миролюба Бенатова: „Истинският разговор за ролята на ДС в Прехода никога не е започвал“
Ангел Христо и Пламен Галев, известни като Братя Галеви

През 90-те „добрите барети“ Галеви са част от т.нар. Банда на офицерите, след като напускат отдела за борба с наркотрафика на ГДБОП. От този период датират около десетина дела срещу тях. Правят всичко типично за онези години, като част от тогавашната „екосистема“ – различни брънки на силовите структури, които диктуват правилата в цяла България с рекет, изнудване, тормоз, завладяване на бизнеси, отчисления.

По споменатите дела те са оправдани. Интервюирах ги през 2008 г., когато се бяха запътили към политиката с вече прекратени дела „поради липса на доказателства“. Когато посегнаха към политиката и се опълчиха срещу тогавашния кмет на Дупница, обяснението им беше:

Ние винаги сме плащали на политици. Искаме да го съкратим този разход и да влезем в политиката директно, без да се занимаваме с посредници.

Междувременно ги бяха проверявали от ГДБОП по подозрение, че са свързани с производство и международен трафик на наркотици. И тази проверка беше завършила с „липса на данни за престъпление“. Практически те си бяха презаверили печата от държавата, че всичко им е наред и че са просто „напредничави бизнесмени“, „новатори“, „лидери“, които имат „щедри работодатели от Сейшелите“ и с техните пари строят нещо, което прилича на Пентагона (имението на Братя Галеви в с. Ресилово – б.р.). На това държавата просто му беше дала зелена светлина. Галеви бяха изпрани от МВР и съдебната система. И те са просто един пример.

Защо се дава зелена светлина?

Предполагам, че те винаги са работили за службите. Този маниер беше използван по отношение на много като тях – да се водят агенти на службите за сигурност дори след 1989 г., с идеята, че биха могли да бъдат полезни като информатори за случващото се в престъпния свят. Да не забравяме и досието „Буда“, в което е Борисов. Той твърди, че не е бил информатор, но според сайта „Биволъ“, който извади досието му, това не е така.

Няма лошо такъв тип хора да бъдат ползвани за информатори, стига това да не се превърне в индулгенция и в безкрайно разпънат чадър за вършене на престъпна дейност, както стана в България.

През службите този тип хора си разчистваха сметките с конкуренти. Не службите да разследват на равна нога цялата престъпна дейност, ползвайки някакви агенти, а обратното – групировките ползват службите за собствено оръжие, като бухалки. Цялата система, която би трябвало да ни пази, всъщност е обслужвала определени интереси. Тогава са били мутренски, сега са олигархични. В началото беше МВР и службите, после основна роля на бухалка зае прокуратурата, а в някои случаи – и съдът.

А това се случва, защото говорим за корупция на изключително високо ниво, или за нещо още по-дълбоко, за някакъв изначален замисъл да е точно така?

Ще се върна още малко по-назад. В началото на 90-те години излязоха разни доклади какво са работили комунистическите служби. И стана ясно, че тогава едно от направленията на Държавна сигурност е било контрабанда на каптагон (вид амфетамин) и на оръжие. Това са били „официални“ държавни канали, създадени по поръчка на ръководството на БКП. Според официалния замисъл на цялата работа по този начин са се осигурявали валутни постъпления за бюджета на България. Създадени са много задгранични дружества – параван на всякакъв вид дейност, включително и незаконна. Парите, с които са оперирали назначените за бизнесмени агенти, са държавни.

След промените тези държавни (частни на хартия) дружества минават в частни ръце, както и контрабандните канали, както и парите в сметките. Всъщност групировките се ръководят от различни служители на високо ниво в Държавна сигурност, които си приватизират тези канали. Дейността продължава, но вече не се отчитат на държавата, а на себе си. Ето как се раждат групировките и първите олигарси. Всъщност червените пари не са митични, те са съществуващи пари, които просто минават в частни ръце. Някои ги пропиляват, други успяват да ги трансформират в истински частен капитал, който да се превърти, да се умножи, да продължи нататък. Накрая някои даже ги препират, част от тях превръщайки се в сериозни строителни предприемачи например.

2008 г. беше много типична в това отношение. Тогава външните частни инвестиции в България бяха в пик. Помня, че Сергей Станишев много се гордееше с тази статистика. Но анализаторите от Центъра за изследване на демокрацията направиха уговорката, че голяма част от тези т.нар. външни инвестиции са всъщност препрани пари от престъпна дейност, които се връщат в България през чужди дружества, решили да инвестират. Примерно в строителство.

Тогава всъщност беше и най-големият бум на строителството.

Да. Това са всъщност едни добре завъртени и препрани пари, които се трансформираха в бетон. И това е само една от проследимите брънки на тези мрежи.

Същото се случи с предприятия и с тяхната приватизация. Малко неща, независимо легални или нелегални, са попаднали в случайни хора, които не са свързани под някаква форма с комунистическия елит на службите или на Партията.

Попадането на случаен принцип не е ли пак по някакъв начин контролирано, за да не са всички уязвими по комунистическа линия?

Те не се броят за уязвими. Над 40% от досиетата са унищожени още през 1990 г. Това с уязвимостта е силно надценено. Виктор Вълков – един от митичните хора от кръга „Монтерей“, бивш външен министър, дългогодишен дипломат, работил като търговски аташе в няколко държави, сред които най-важна е Турция, и който 90-та беше едно от предложенията за първи демократичен президент – много обичаше да се шегува, че два пъти е проверяван от Комисията по досиетата и винаги е излизало, че няма досие. В крайна сметка му излезе картонче и се оказа, че има два псевдонима. А по негови думи – нещо, което липсва в досието – той е бил двоен агент.

Миролюба Бенатова: „Истинският разговор за ролята на ДС в Прехода никога не е започвал“
Виктор Вълков и Любен Гоцев, митични фигури от т.нар. кръг „Монтерей“

За тези хора това не е уязвимост, но покрай срещите си като журналист с кръга „Монтерей“, където ме бяха допуснали, съм видяла как се поддържа тази мрежа от връзки и контакти. С много хора и фирми, чиито имена не знаем.

Пеевски оттам ли тръгна?

Така изглежда. Но не той, а майка му. Той е страничен ефект. Всъщност ние в момента живеем във времето на страничните ефекти, които вече дори и най-големите стратези и кадровици на Държавна сигурност не са изчислили. Те са изчислили до майката на Пеевски. След това Пеевски, неговите деца и така нататък – те за тях не отговарят. Покрай службите, задграничните дружества, търговските представителства остават връзките и контактите от миналото и тези хора продължаваха да възпроизвеждат по модела на Държавна сигурност бизнес мрежите си – с доверени лица, с конспиративност, с благодарност.

А как изглежда в този контекст Васил Терзиев – кандидатът за кмет на София от ПП–ДБ, „Спаси София“ и „Екипът на София“, чиито дядо, чичо и баща са били висши офицери в ДС? (Позволяваме си да добавим този въпрос, който не съществуваше, когато е проведен разговорът за интервюто, тъй като и кандидатурата на Терзиев не беше обявена официално, а темата е в същия контекст – б.р.)

Васил Терзиев истински вярва, че не е бил подпомогнат и привилегирован, въпреки че като дете е живял и учил в САЩ, което ние, които можехме да стигнем само до Румъния, преценяваме като привилегия. Вероятно и по-добре за него е, че не знае какво е да имаш избор само между бели и сини гуменки, и затова недоумява кое не е ясно в разбирането по отношение на предимствата, получени чрез неговия произход. Те не са битови толкова, колкото образователни и социални.

Извън бита, Терзиев е категоричен, че връзките на неговите роднини и роднините на съдружниците му нямат отношение към успеха му в ИТ сектора. Той разказва, че с приятели от студентските години и лични спестявания са си измислили, изградили и продали всичко сами. Факт е, че сферата е сложна и не е като да приватизираш завод и да го продадеш на скрап, както направиха стотици партийни и комсомолски функционери. Но разузнаването по време на соца се е занимавало и с технологии.

Мимоходом Терзиев сподели в подкаста „Говори интернет“, че баща му е работил за т.нар. научно-техническо разузнаване към Първо главно управление на ДС (бил е на мисия в САЩ – б.р.). Васил Терзиев не каза повече. Това, което неизкушените от темата „Държавна сигурност“ не знаят, е, че научно-техническото разузнаване се е занимавало с крадене (копиране или купуване) на западни технологии. Даже проф. Вили Лилков, изследовател на социализма и службите, каза в предаването „Въпросите“, че българските разузнавачи в това направление са били гордостта на соцлагера. Лилков твърди, че цели индустрии в България са изградени с технологии, донесени от научно-техническото разузнаване. Не казвам, че случаят на Терзиев и съдружниците му е такъв, но давам повече информация за научно-техническото разузнаване.

Терзиев вероятно е добър организатор – това, че обедини толкова различни интереси и личности, го показва. Но според мен той подцени темата за ДС и собственото си осмисляне на миналото. Терзиев е повод този разговор да започне. Разговорът за децата на Политбюро, номенклатурата и ДС, които и до днес не слизат от обществения живот във всички сфери. Те са старите нови звезди на Прехода, към които винаги е имало уважение, дори страхопочитание.

Шофьорите на Политбюро станаха капиталисти опозиционери (нека вземем един Спас Русев, бивш шофьор на Стоян Марков), децата им са вече изучени в елитни университети и готови да са управленците на бъдещето. Това дразни, без задължително да сме от род на репресирани. Терзиев натисна този бутон – напомни за неравенството, което няма наваксване, напомни, че никой не е искал прошка за издевателствата по време на режима, напомни за всичко, което обсъждахме в предните редове. Напомни за неслучилия се преход. А явно същите ДС мрежи няма да му простят, че вместо да е поредният червен принц, той се опитва да се откъсне. Дори да се извини.

Не знам дали е готов да осмисли и понесе автентичното недоволство, не политически дирижираното. Разбира се, Васил Терзиев е хубаво да прочете папките за своите роднини, даже щеше да е най-добре вече да ги е прочел, за да може да разкаже нещо от свое име, а не да отговаря на статии, които го замерят анонимно и му иззеха инициативата. Но с него вероятно никога няма да видим в читалнята наследниците на Политбюро и сие – Станишев, Йончева, Живкови, Малееви и т.н. Някои от тях добре се реализираха и в демокрацията, и в европейските институции. Важно е да се знае, че по закон Васил Терзиев не може да прочете нищо, без всички наследници да са съгласни, а ако човекът е жив, не може да отвори досието му без съгласието на конкретната личност. Така че в случая прочитът на родовото минало трябва да се приема като метафора и по-скоро вътрешна работа.

Но парадоксите не стигат дотук. Част от перверзията на неслучилия се анализ се състои във факта, че в един момент Цветан Цветанов (бивш втори в ГЕРБ и син на служител от ДС) беше лицето на говоренето за тоталитарния режим и той „превзе“ темата за репресиите и Комисията по досиетата. Не се посвени да сложи и жертвите на режима пред себе си като жив щит. Нито Цветанов, нито Борисов могат да са лицето на антикомунизма и на евроатлантизма. Няма как. Всъщност всички тези политически играчи са част от голямата подмяна. Лошото е, че ние като общество сме жертва на такива инсталирани фалшиви герои, през които не можем да стигнем до истината. И така законът за омертата продължава да властва.

Всъщност човек като погледне по-голямата картина от дистанцията на времето, излиза, че докато ние сме се занимавали с престрелки по улиците, докато „играчите“ са били реално пушечно месо, пуснати да парадират със скъпи коли, с големи телефони, с лъскави костюми от пясъчна коприна, там някъде в сенките се е случвало истинското разграбване на България.

Някои от тези „играчи“, за които говорим, еманципираха ли се?

Най-вероятно всички под някаква форма са се еманципирали и са си повярвали, че са истински. На много голяма част от тях не им се получи. Пропиляха шанса. Някои успяха да влязат в крачка и наистина да реализират нещо. Други просто изядоха и изпиха всичко и го продадоха за скрап. Но за това е говорено по-малко, отколкото за стрелбата на „Мария Луиза“ например. (Стрелбата до басейн „Мария Луиза“ на 5 юли 2001 г. Тогава с гранатомет е стреляно по джип, в който се предполагало, че е Георги Пехливанов, шеф на силовата групировка СИК и съсобственик на „Интергруп“. Действието се развива посред бял ден, докато басейнът е пълен с хора – б.р.)

Друго важно крило е и това около Илия Павлов. Него вече го няма, но контрабандните канали и туризмът, на който беше сложил ръка, са си тук, само че преминаха нататък. Например почти не се говори за начина, по който банката на Славчо Христов мина в ръцете на Цветелина Бориславова.

Миролюба Бенатова: „Истинският разговор за ролята на ДС в Прехода никога не е започвал“
Илия Павлов

Славчо Христов е сред героите, които сме забравили – осветител от БНТ, сервитьор в ресторант „Олимп“, говореше се, че бил доверено лице на Иван Костов. И като дойде на власт Сакскобургготски, банката тихомълком, кротко и полека беше „издадена“. Славчо Христов може би разбра знаците и се оттегли. Има хора от онези времена, които не са от спорта и за които по-малко се говори, но те са живи, здрави и богати.

В самото начало на Прехода се твърдеше, че имало две крила: на Андрей Луканов и на Огнян Дойнов. Единият по̀ бизнес ориентиран, технократ, другият – с тесни руски връзки. Но реално цялата руска мрежа никога не е прекъсвала съществуването си тук именно покрай бизнес връзките, оплетени със службите, чиито кадри винаги са били свързани със Съветския съюз и КГБ, въпреки че това е дълбоко покрито. За някои хора изобщо не си личи на пръв поглед.

Понякога на хората, успяващи да навържат нещата и да обърнат внимание не на фокуса, който се прави за пред зрителите, а на това, което се случва отзад, се гледа особено.

То звучи параноично. Всъщност никой, на който не му се налага професионално или някак си животът не го е насочил в такава посока, не може да го види. То е даже страшно да го видиш. Нека не забравяме кога например беше продаден „Нефтохим Бургас“ – пак по времето на Костов, който казва, че това е бил най-добрият вариант. Но е факт, че не се прекрати зависимостта на България от Русия. Години наред. Всъщност тези енергийни връзки са сериозната част, за която най-малко се говори и най-малко хората разбират от нея. Защото от криминален свят всеки може да каже, че разбира. Всички са чели „Кръстникът“.

Между убийството на Красимир Каменов – Къро и смъртта на Ангел Христов имаше много кратък период и някак си изведнъж ефирът се насити отново с тези имена. Защо говорим например кой е Къро, когато Къро умря?

Таки и Къро се смятаха за наследници на Васил и Георги Илиеви и бяха неразделни във всичко, с което се занимаваха. Имали са някакво разделение на бизнесите, но още от миналото десетилетие се знаеше, че например борсата в „Слатина“ е на Къро и на жена му. Таки беше разследван като лидер на организирана престъпна група, свързана с наркоразпространение, но така и не беше осъден. Къро никога не е бил разследван за такива работи. До момента, в който не се заговори, че всъщност всички гьолове на „Капитан Андреево“ – и санитарният контрол, и всичко останало – са свързани с него. А за това също се знаеше през годините.

Миролюба Бенатова: „Истинският разговор за ролята на ДС в Прехода никога не е започвал“
Венецът, поднесен от името на Къро и Таки на погребението на Георги Илиев през 2005 г.

Но сякаш започна да се говори през миналата година повече?

Когато се оказва, че Таки и Къро вече са били врагове. Точно какво е станало, никой не знае, или поне аз не знам. Но знам със сигурност, че в един момент Таки започва да превзема бизнеса на Къро – легалните неща, които са с много голямо участие на държавата. Всички „хранилки“ са взети за „управление“ от тези хора с благословията на ГЕРБ през последните десетина и повече години. Твърди се, че е имало покровителство на много високо ниво.

Когато Таки и Къро се скарват по някаква причина и Таки прави опити да изземе този бизнес, Къро се обръща срещу него и започва да работи със службите, за да уязви бившия си партньор. И ако Къро е бил готов да говори за цялата обвързаност „престъпност–бизнес–политика“, не му стигна времето.

Имената на Къро и Таки изплуваха покрай странна докладна записка, намерена в документацията на един убит бивш полицай – Любомир Иванов. Всъщност в тази анонимна докладна от човек, смятан за агент на въпросния бивш полицай, пише, че има информация, че по поръчение на Таки Ружа Игнатова е убита и пусната някъде из Йонийско море.

Вероятно и за тези неща е можел Къро да говори, като обаче в момента, в който неговото име беше осветено, а не това на Таки, му се приписаха няколко убийства и заговор срещу държавата. След това го убиха.

Спомена Ружа Игнатова. Как точно са преплетени тези взаимоотношения в нейната история?

Отново говорим за чадър от службите. Според мен тя е продукт на сериозни заинтересовани кръгове. Преди да изчезне, всички капитали, които бяха откраднати от хората от целия свят – не само пари, но и имоти, преминаха в други ръце. Реално тя беше прехвърлила всичко, когато изчезна. Твърди се, че всичко се води на съхранение при финансиста Емил Хърсев. Той обича да казва, че няма нищо общо, просто го ползват за чекмедже – финансов уредник за различни клиенти. Тези активи са под някакво попечителство с други собственици. Тя вече нямаше нищо, когато замина за последен път.

Но знаеше прекалено много.

Вероятно и тя си е вярвала, че е истинска и че е измислила тази игра. Смята се, че голяма част от т.нар. престъпен свят също е инвестирала пари в OneCoin.

Тоест те също са ужилени?

И ужилени, и може би не съвсем, защото може да са си върнали част от инвестициите междувременно. А и според онзи агент Ружа е някъде из Йонийско море по поръчение на Таки. Не знаем дали е така. И в този, и в други случаи трябва да се знае, че не гърмят истинските играчи, а бушоните, които, дори в публичното пространство да са изглеждали влиятелни и на високо ниво, всъщност не са.

За какво си говорим, когато си говорим за някой с прякор, който е изчезнал или са го убили?

Винаги има друг сериозен, добре образован, умен човек, на когото никой не знае името, който седи в опушен кабинет, пуши пура и дава наставления. Може и никога да не стигнем до този в опушения кабинет. Знам за няколко, които си починаха на сериозна възраст от естествена смърт.

Но го има и другото – разследвания, в които, като тръгнеш да разнищваш брънка по брънка, свидетел по свидетел, схема по схема, накрая опираш до някой мъртвец и всичко свършва там. Или пък много неща, които се знаят, но се вадят на показ, когато някой реши, че определени хора вече не са нужни.

Убийството на Къро може да е поръчано от много страни, защото той е бил замесен в международна престъпна мрежа, но е убит в един момент, в който, ако тръгнем все пак по конкретната сюжетна линия, която ни интересува в България, той беше решил да говори за неща, засягащи българския политически елит.

За кого в българския политически елит в момента той можеше да говори евентуално?

Както казахме, страничните ефекти на кадровия подбор на Държавна сигурност, метастазите или въобще – неизчислените. Защото те вече са хора, които никой не ги е смятал. Нито Борисов е изчислен, че ще стигне толкова далече, нито Пеевски, нито други хора.

Защо е важно тези хора, чиито имена споменахме в разговора, а и много други от т.нар. герои на Прехода, да не се забравят, както и техните връзки един с друг?

Защото истинският публичен разговор за ролята на Държавна сигурност в Прехода никога не е започвал в България. Това се смята за някаква параноична, паразитна тема и тя съвсем нарочно е профанизирана. Всъщност най-шумните и най-постоянните гласове в медиите са хората, свързани с Държавна сигурност и номенклатурата от миналото.

Не е започвал никога и истинският разговор за жертвите на комунизма. Това също се смята за тема, която не засяга никого. И пак нарочно се вменява подобно схващане. Този разговор е обидно маргинализиран. Нашето общество изобщо не е стигнало до момента на осъзнаване. Голяма част от него е с широко затворени очи и за терора, и за кражбите, и за последствията. Трябва да си дадем сметка, че бяхме доволни, когато получихме банани, бяла техника и възможност да пътуваме в чужбина, но никога не си признахме, че сме част от режим, който ни е осакатил. Това признание си го дължим, за да продължим напред.

Ние сме жертва на колективна травма и ако не започнем да се виждаме като такива, ще ни се случват все по-страшни неща. Обезчувствили сме се. От страх да не би да ни заболи, като погледнем какво ни се е случило, сме калцирали болката. А така сме заплашени от тежки рецидиви или от самоунищожение. В обществото никой не е признал болката на другия. Няма никаква емпатия, има само лозунги, плакати, комунистическа пропаганда, а след нея – нищо. А това нищо води до голямо объркване по всякакви теми и съответно до голямо обществено разделение. Имаме 30 пропилени години, превзети от онези кръгове, за които говорихме. По-страшното е, че не са превзели само заводите и парите, а и разказа за това, което ни се е случило.

А ако все пак съумеем да разкажем историята, какво ще стане?

Тогава ще боли, ще има гняв, ще има обвинения. Но болката ще излезе на повърхността, което ще даде възможност на раната да се излекува.

Security updates for Friday

Post Syndicated from original https://lwn.net/Articles/937616/

Security updates have been issued by Debian (debian-archive-keyring, libusrsctp, nsis, ruby-redcloth, and webkit2gtk), Fedora (firefox), Mageia (apache-ivy, cups, curaengine, glances, golang, keepass, libreoffice, minidlna, nodejs, opensc, perl-DBD-SQLite, python-setuptools, python-wheel, skopeo/buildah/podman, systemd, testng, and webkit2), SUSE (bind), and Ubuntu (Gerbv, golang-websocket, linux-gke, linux-intel-iotg, and linux-oem-5.17).

The AI Dividend

Post Syndicated from Bruce Schneier original https://www.schneier.com/blog/archives/2023/07/the-ai-dividend.html

For four decades, Alaskans have opened their mailboxes to find checks waiting for them, their cut of the black gold beneath their feet. This is Alaska’s Permanent Fund, funded by the state’s oil revenues and paid to every Alaskan each year. We’re now in a different sort of resource rush, with companies peddling bits instead of oil: generative AI.

Everyone is talking about these new AI technologies—like ChatGPT—and AI companies are touting their awesome power. But they aren’t talking about how that power comes from all of us. Without all of our writings and photos that AI companies are using to train their models, they would have nothing to sell. Big Tech companies are currently taking the work of the American people, without our knowledge and consent, without licensing it, and are pocketing the proceeds.

You are owed profits for your data that powers today’s AI, and we have a way to make that happen. We call it the AI Dividend.

Our proposal is simple, and harkens back to the Alaskan plan. When Big Tech companies produce output from generative AI that was trained on public data, they would pay a tiny licensing fee, by the word or pixel or relevant unit of data. Those fees would go into the AI Dividend fund. Every few months, the Commerce Department would send out the entirety of the fund, split equally, to every resident nationwide. That’s it.

There’s no reason to complicate it further. Generative AI needs a wide variety of data, which means all of us are valuable—not just those of us who write professionally, or prolifically, or well. Figuring out who contributed to which words the AIs output would be both challenging and invasive, given that even the companies themselves don’t quite know how their models work. Paying the dividend to people in proportion to the words or images they create would just incentivize them to create endless drivel, or worse, use AI to create that drivel. The bottom line for Big Tech is that if their AI model was created using public data, they have to pay into the fund. If you’re an American, you get paid from the fund.

Under this plan, hobbyists and American small businesses would be exempt from fees. Only Big Tech companies—those with substantial revenue—would be required to pay into the fund. And they would pay at the point of generative AI output, such as from ChatGPT, Bing, Bard, or their embedded use in third-party services via Application Programming Interfaces.

Our proposal also includes a compulsory licensing plan. By agreeing to pay into this fund, AI companies will receive a license that allows them to use public data when training their AI. This won’t supersede normal copyright law, of course. If a model starts producing copyright material beyond fair use, that’s a separate issue.

Using today’s numbers, here’s what it would look like. The licensing fee could be small, starting at $0.001 per word generated by AI. A similar type of fee would be applied to other categories of generative AI outputs, such as images. That’s not a lot, but it adds up. Since most of Big Tech has started integrating generative AI into products, these fees would mean an annual dividend payment of a couple hundred dollars per person.

The idea of paying you for your data isn’t new, and some companies have tried to do it themselves for users who opted in. And the idea of the public being repaid for use of their resources goes back to well before Alaska’s oil fund. But generative AI is different: It uses data from all of us whether we like it or not, it’s ubiquitous, and it’s potentially immensely valuable. It would cost Big Tech companies a fortune to create a synthetic equivalent to our data from scratch, and synthetic data would almost certainly result in worse output. They can’t create good AI without us.

Our plan would apply to generative AI used in the US. It also only issues a dividend to Americans. Other countries can create their own versions, applying a similar fee to AI used within their borders. Just like an American company collects VAT for services sold in Europe, but not here, each country can independently manage their AI policy.

Don’t get us wrong; this isn’t an attempt to strangle this nascent technology. Generative AI has interesting, valuable, and possibly transformative uses, and this policy is aligned with that future. Even with the fees of the AI Dividend, generative AI will be cheap and will only get cheaper as technology improves. There are also risks—both every day and esoteric—posed by AI, and the government may need to develop policies to remedy any harms that arise.

Our plan can’t make sure there are no downsides to the development of AI, but it would ensure that all Americans will share in the upsides—particularly since this new technology isn’t possible without our contribution.

This essay was written with Barath Raghavan, and previously appeared on Politico.com.

Zero traffic cost for Kafka consumers

Post Syndicated from Grab Tech original https://engineering.grab.com/zero-traffic-cost

Introduction

Coban, Grab’s real-time data streaming platform team, has been building an ecosystem around Kafka, serving all Grab verticals. Along with stability and performance, one of our priorities is also cost efficiency.

In this article, we explain how the Coban team has substantially reduced Grab’s annual cost for data streaming by enabling Kafka consumers to fetch from the closest replica.

Problem statement

The Grab platform is primarily hosted on AWS cloud, located in one region, spanning over three Availability Zones (AZs). When it comes to data streaming, both the Kafka brokers and Kafka clients run across these three AZs.

Figure 1 – Initial design, consumers fetching from the partition leader

Figure 1 shows the initial design of our data streaming platform. To ensure high availability and resilience, we configured each Kafka partition to have three replicas. We have also set up our Kafka clusters to be rack-aware (i.e. 1 “rack” = 1 AZ) so that all three replicas reside in three different AZs.

The problem with this design is that it generates staggering cross-AZ network traffic. This is because, by default, Kafka clients communicate only with the partition leader, which has a 67% probability of residing in a different AZ.

This is a concern as we are charged for cross-AZ traffic as per AWS’s network traffic pricing model. With this design, our cross-AZ traffic amounted to half of the total cost of our Kafka platform.

The Kafka cross-AZ traffic for this design can be broken down into three components as shown in Figure 1:

  • Producing (step 1): Typically, a single service produces data to a given Kafka topic. Cross-AZ traffic occurs when the producer does not reside in the same AZ as the partition leader it is producing data to. This cross-AZ traffic cost is minimal, because the data is transferred to a different AZ at most once (excluding retries).
  • Replicating (step 2): The ingested data is replicated from the partition leader to the two partition followers, which reside in two other AZs. The cost of this is also relatively small, because the data is only transferred to a different AZ twice.
  • Consuming (step 3): Most of the cross-AZ traffic occurs here because there are many consumers for a single Kafka topic. Similar to the producers, the consumers incur cross-AZ traffic when they do not reside in the same AZ as the partition leader. However, on the consuming side, cross-AZ traffic can occur as many times as there are consumers (on average, two-thirds of the number of consumers). The solution described in this article addresses this particular component of the cross-AZ traffic in the initial design.

Solution

Kafka 2.3 introduced the ability for consumers to fetch from partition replicas. This opens the door to a more cost-efficient design.

Figure 2 – Target design, consumers fetching from the closest replica

Step 3 of Figure 2 shows how consumers can now consume data from the replica that resides in their own AZ. Implementing this feature requires rack-awareness and extra configurations for both the Kafka brokers and consumers. We will describe this in the following sections.

The Coban journey

Kafka upgrade

Our journey started with the upgrade of our legacy Kafka clusters. We decided to upgrade them directly to version 3.1, in favour of capturing bug fixes and optimisations over version 2.3. This was a safe move as version 3.1 was deemed stable for almost a year and we projected no additional operational cost for this upgrade.

To perform an online upgrade with no disruptions for our users, we broke down the process into three stages.

  • Stage 1: Upgrading Zookeeper. All versions of Kafka are tested by the community with a specific version of Zookeeper. To ensure stability, we followed this same process. The upgraded Zookeeper would be backward compatible with the pre-upgrade version of Kafka which was still in use at this early stage of the operation.
  • Stage 2: Rolling out the upgrade of Kafka to version 3.1 with an explicit backward-compatible inter-broker protocol version (inter.broker.protocol.version). During this progressive rollout, the Kafka cluster is temporarily composed of brokers with heterogeneous Kafka versions, but they can communicate with one another because they are explicitly set up to use the same inter-broker protocol version. At this stage, we also upgraded Cruise Control to a compatible version, and we configured Kafka to import the updated cruise-control-metrics-reporter JAR file on startup.
  • Stage 3: Upgrading the inter-broker protocol version. This last stage makes all brokers use the most recent version of the inter-broker protocol. During the progressive rollout of this change, brokers with the new protocol version can still communicate with brokers on the old protocol version.

Configuration

Enabling Kafka consumers to fetch from the closest replica requires a configuration change on both Kafka brokers and Kafka consumers. They also need to be aware of their AZ, which is done by leveraging Kafka rack-awareness (1 “rack” = 1 AZ).

Brokers

In our Kafka brokers’ configuration, we already had broker.rack set up to distribute the replicas across different AZs for resiliency. Our Ansible role for Kafka automatically sets it with the AZ ID that is dynamically retrieved from the EC2 instance’s metadata at deployment time.

- name: Get availability zone ID
  uri:
    url: http://169.254.169.254/latest/meta-data/placement/availability-zone-id
    method: GET
    return_content: yes
  register: ec2_instance_az_id

Note that we use AWS AZ IDs (suffixed az1, az2, az3) instead of the typical AWS AZ names (suffixed 1a, 1b, 1c) because the latter’s mapping is not consistent across AWS accounts.

Also, we added the new replica.selector.class parameter, set with value org.apache.kafka.common.replica.RackAwareReplicaSelector, to enable the new feature on the server side.

Consumers

On the Kafka consumer side, we mostly rely on Coban’s internal Kafka SDK in Golang, which streamlines how service teams across all Grab verticals utilise Coban Kafka clusters. We have updated the SDK to support fetching from the closest replica.

Our users only have to export an environment variable to enable this new feature. The SDK then dynamically retrieves the underlying host’s AZ ID from the host’s metadata on startup, and sets a new client.rack parameter with that information. This is similar to what the Kafka brokers do at deployment time.

We have also implemented the same logic for our non-SDK consumers, namely Flink pipelines and Kafka Connect connectors.

Impact

We rolled out fetching from the closest replica at the turn of the year and the feature has been progressively rolled out on more and more Kafka consumers since then.

Figure 3 – Variation of our cross-AZ traffic before and after enabling fetching from the closest replica

Figure 3 shows the relative impact of this change on our cross-AZ traffic, as reported by AWS Cost Explorer. AWS charges cross-AZ traffic on both ends of the data transfer, thus the two data series. On the Kafka brokers’ side, less cross-AZ traffic is sent out, thereby causing the steep drop in the dark green line. On the Kafka consumers’ side, less cross-AZ traffic is received, causing the steep drop in the light green line. Hence, both ends benefit by fetching from the closest replica.

Throughout the observeration period, we maintained a relatively stable volume of data consumption. However, after three months, we observed a substantial 25% drop in our cross-AZ traffic compared to December’s average. This reduction had a direct impact on our cross-AZ costs as it directly correlates with the cross-AZ traffic volume in a linear manner.

Caveats

Increased end-to-end latency

After enabling fetching from the closest replica, we have observed an increase of up to 500ms in end-to-end latency, that comes from the producer to the consumers. Though this is expected by design, it makes this new feature unsuitable for Grab’s most latency-sensitive use cases. For these use cases, we retained the traditional design whereby consumers fetch directly from the partition leaders, even when they reside in different AZs.

Figure 4 – End-to-end latency (99th percentile) of one of our streams, before and after enabling fetching from the closest replica

Inability to gracefully isolate a broker

We have also verified the behaviour of Kafka clients during a broker rotation; a common maintenance operation for Kafka. One of the early steps of our corresponding runbook is to demote the broker that is to be rotated, so that all of its partition leaders are drained and moved to other brokers.

In the traditional architecture design, Kafka clients only communicate with the partition leaders, so demoting a broker gracefully isolates it from all of the Kafka clients. This ensures that the maintenance is seamless for them. However, by fetching from the closest replica, Kafka consumers still consume from the demoted broker, as it keeps serving partition followers. When the broker effectively goes down for maintenance, those consumers are suddenly disconnected. To work around this, they must handle connection errors properly and implement a retry mechanism.

Potentially skewed load

Another caveat we have observed is that the load on the brokers is directly determined by the location of the consumers. If they are not well balanced across all of the three AZs, then the load on the brokers is similarly skewed. At times, new brokers can be added to support an increasing load on an AZ. However, it is undesirable to remove any brokers from the less loaded AZs as more consumers can suddenly relocate there at any time. Having these additional brokers and underutilisation of existing brokers on other AZs can also impact cost efficiency.

Figure 5 – Average CPU utilisation by AZ of one of our critical Kafka clusters

Figure 5 shows the CPU utilisation by AZ for one of our critical Kafka clusters. The skewage is visible after 01/03/2023. To better manage this skewage in load across AZs, we have updated our SDK to expose the AZ as a new metric. This allows us to monitor the skewness of the consumers and take measures proactively, for example, moving some of them to different AZs.

What’s next?

We have implemented the feature to fetch from the closest replica on all our Kafka clusters and all Kafka consumers that we control. This includes internal Coban pipelines as well as the managed pipelines that our users can self-serve as part of our data streaming offering.

We are now evangelising and advocating for more of our users to adopt this feature.

Beyond Coban, other teams at Grab are also working to reduce their cross-AZ traffic, notably, Sentry, the team that is in charge of Grab’s service mesh.

Join us

Grab is the leading superapp platform in Southeast Asia, providing everyday services that matter to consumers. More than just a ride-hailing and food delivery app, Grab offers a wide range of on-demand services in the region, including mobility, food, package and grocery delivery services, mobile payments, and financial services across 428 cities in eight countries.

Powered by technology and driven by heart, our mission is to drive Southeast Asia forward by creating economic empowerment for everyone. If this mission speaks to you, join our team today!

Fedora considers “privacy-preserving” telemetry

Post Syndicated from original https://lwn.net/Articles/937528/

The Fedora project is considering a
Fedora 40 change proposal
to add limited, opt-out telemetry to the
workstation edition. The proposal is detailed; it is clear that the
developers involved understand that this will be a hard sell in that
community.

We believe an open source community can ethically collect limited
aggregate data on how its software is used without involving big
data companies or building creepy tracking profiles that are not in
the best interests of users. Users will have the option to disable
data upload before any data is sent for the first time. Our service
will be operated by Fedora on Fedora infrastructure, and will not
depend on Google Analytics or any other controversial third-party
services. And in contrast to proprietary software operating
systems, you can redirect the data collection to your own private
metrics server instead of Fedora’s to see precisely what data is
being collected from you, because the server components are open
source too.

Backblaze Shareholders Eliminate Dual-Class Share Structure

Post Syndicated from original https://www.backblaze.com/blog/backblaze-shareholders-eliminate-dual-class-share-structure/

Backblaze Stockholders Approve Plan to Eliminate Dual-Class Share Structure

Today we announced that Backblaze shareholders voted to eliminate our dual class share structure. For most of our readers, I’m guessing this news flash might be more “???” than “!!!,” but I’ll explain what it means, why it’s an exciting moment for Backblaze and its shareholders, and how it ties back to our business and our commitment to our core values of transparency and accountability.

First Things First: What Does It Mean for You?

If you’re one of our hundreds of thousands of customers and partners—this has no impact for you.

If you’re one of our shareholders or investors: We believe this is 100% good news for you as it gives you an equal say in our business. But you don’t have to do anything—this change happens entirely on our end.

For Everyone Who Is Still Wondering: What Is a Dual Class Structure?

In short, for public companies, a dual class structure means that there are different types of share classes that have different rights. Often, these rights have to do with voting privileges. For example, previously Backblaze had two classes of common stock: Class A and Class B. Class A shareholders get one vote for every share of the company they own. Class B shareholders get ten votes for every one share they own. These are often referred to as “super-voting” shares.

When shareholders would vote on shareholder proposals, the Class B shareholders would theoretically have more sway than Class A folks due to the greater voting rights. After today, this is all a lot simpler and more equal as we only have one class of shares and shareholders.

Why Ever Have a Dual Class Structure?

Roughly 30% of newly public tech companies go out with a dual class structure. Often founder-led companies, like ours, are advised to use dual class structures at the outset to help maintain continuity and focus in the initial years as a public company.

Why Are Backblaze Shareholders Getting Rid of Dual Class?

  • It is fair and good. Being “Fair & Good” is one of our core values. After receiving feedback from various shareholders, potential investors, and corporate governance practitioners that a dual class stock structure is seen as negative by some, we aligned that supporting a single share class is “fair & good” both for corporate governance and for shareholders.
  • It is no longer necessary. This November marks two years since our debut as a public company. We feel that our strategy and values are well aligned and ingrained with our path as a public company. Metaphorically speaking, the training wheels are unnecessary.
  • It delivers equality for shareholders. Having a single class of shareholders supports our belief in shareholder democracy and continues our efforts toward empowering those who choose to invest in our business. We also believe this broadens the potential group of investors in our business by enabling a level playing field.

Here are the more technical details about the change: Backblaze Class B shares will be converted to Class A shares on July 6, 2023. The conversion has no effect on the economic rights of holders of shares of Class A common stock or Class B common stock, except for the elimination of the different voting powers of the two classes of stock.

Why Talk About This At All?

Backblaze IPO’d because it aligned with our company values and long-term goals, and we’ve benefitted from feedback from shareholders, in-depth industry analyses, and expert direction from our board and others. Part of getting that feedback is sharing out as much as we can about the process. Transparency is, after all, another one of our key values, so sharing the thinking behind this decision is as important as making it, from our perspective.

More to Come

If you’re interested in learning more about our experience of bootstrapping to an IPO and what we’ve learned as a public company, we’re working on a series called Open-Sourcing the IPO. Whether you’re dreaming up your first idea, still in stealth mode, or already have revenue in the tens of millions, you can check out the first two installments here:

You can also tune in to our Stocks and Storage series on YouTube for more explainers on Wall Street jargon from IPO to EBITDA. And stay tuned for more—I’ll be filling in the details over the next year and writing the playbook I wish we had when we started down our IPO path.

Looking Forward

As we move into our next phase of growth as the leading specialized storage cloud, we’re happy we can do so with each voice having equal weight. This is an exciting moment for Backblaze shareholders and we are grateful to see this positive change come to fruition.

The post Backblaze Shareholders Eliminate Dual-Class Share Structure appeared first on Backblaze Blog | Cloud Storage & Cloud Backup.

Accessibility considerations behind code search and code view

Post Syndicated from milemons original https://github.blog/2023-07-06-accessibility-considerations-behind-code-search-and-code-view/

GitHub prides itself on being the home for all developers, including developers with disabilities. Accessibility is a core priority for all new projects at GitHub, so it was top of mind when we started our project to rework code search and the code view at GitHub. With the old code view, some developers preferred to look at raw code rather than code view due to accessibility barriers, and that’s what we set out to fix. This blog post will shed light on our process and three major tasks that required thoughtful design and implementation—code search and query builder, the file tree, and navigating code by keyboard.

Process

We worked with a team of experts at GitHub dedicated to accessibility, since while we are confident in our development skills, accessibility has many nuances and requires a large depth of knowledge to get right. This team helped us immensely in three main ways:

  1. External auditing
    In this project, we performed accessibility auditing on all of our features. This meant that another team of auditors reviewed our webpage with all the changes implemented to find accessibility errors. They used tools including screen readers, color contrast tools, and more, to identify areas that users with disabilities may find hard to use. Once those issues were identified, the accessibility team would take a look at those issues and suggest a proper solution to the problem. Then, it was up to us to implement the solution and collaborate with the team where we needed additional assistance.
  2. Design reviews
    The user interface for code search and code view were both entirely redesigned to support our new goals—to allow users to search, navigate, and understand code in a way they weren’t able to before. As a part of the design process, a team of accessibility designers reviewed the Figma mockups to determine proper HTML markup and tab order. Then, they included detailed explanations of what interactions should look like in order to meet our accessibility goals.
  3. Office hours
    The accessibility team at GitHub hosts weekly meetings where engineers can sign up and discuss how to solve problems with their features with the team and a consultant. The consultant is incredibly helpful and knowledgeable about how to properly address issues because he has lived experience with screen readers and accessibility.During these meetings, we were able to discuss complicated issues, such as the following: proper filtering for code search, making an accessible file tree, and navigating code on a keyboard, along with other issues like tab order, and focus management across the whole feature.

Implementation details

This has been written about frequently on our blog—from one post on the details of QueryBuilder, our implementation of an accessible finder component to details about what navigating code search accessibly looks like. Those two posts are great reads and I strongly recommend checking them out, but they’re not the only thing that we’ve worked on. Thanks to @lindseywild, @smockle, @kendallgassner, @owenniblock, and @khiga8 for their guidance and help resolving issues with code search. This is still a work in progress, especially in areas like the filtering behavior on the search pages.

Two areas that also required careful consideration were managing focus after changing the sort order of search results and how to announce the result of the search for screen reader users.

Changing sort—changing focus?

When we first implemented this sort dropdown for non-code search types, if you navigated to it with your keyboard and then selected a different sort option, the whole page would reload and your focus moved back to the header. Our preferred, accessible behavior is that, when a dropdown menu is closed, focus returns to the button that opened the menu. However, our problem was that the “Sort” dropdown didn’t merely perform client-side operations like most dropdowns where you select an option. In this case, once a user selects an option, we do a full page navigation to perform the new search with the sort order added. This meant that the focus was being placed back on the header by default after the page navigation, instead of returning to the sort dropdown. For sighted mouse users, this is a nonissue; for sighted keyboard users, it is unexpected and annoying; for blind users, this is confusing and makes the product hard to use. To fix this, we had to make sure we returned focus to the dropdown after reloading the page.

Screenshot of search results. I have searched “react” and the “Repositories” filter by item is selected. There are 2.2M results, found in 1 second. The "Sort By" dropdown is open with “Best match” selected. The other options are “Most stars”, “Fewest stars”, “Most forks”, “Fewest forks”, “Recently updated”, and “Least recently updated”.

Announcing search results

When a sighted user types in the search bar and presses ‘Enter’ they quickly receive feedback that the search has completed and whether or not they found any results by looking at the page. For screen reader users, though, how to give the feedback that there were results, how many, or if there was an error requires more thought. One solution could be to place focus on the first result. That has a number of problems though.

  1. The user will not receive feedback about the number of search results and may think there’s only one.
  2. The user may miss important context like the Single sign on banner.
  3. The user will have to tab through more elements if they want to get back.

Another solution could be to use aria-live announcements to read out the number of results and success. This has its own problems.

  1. We already have an announcement on page navigation to read out the new title and these two announcements would compete or cause a race condition.
  2. There isn’t a way to programmatically force announcements to be read in order on page load.
  3. Some screen reader users have aria-live announcements turned off since they can be annoying.

After some discussion, we decided to focus and read out the header with the number of search results after a search and allow users to explore for errors, banners, or results on their own once they know how many results they received.

A screenshot of search results showing 0 results and an error message saying, “Invalid repository name.” I have searched “repo:asdfghijkl." The “Code” filter item is selected. There is also some help text on the page that says “Your search did not match any code. However, we found 544k packages that matched your search query. Alternatively, try one of the tips below.

Tree navigation

We knew when redesigning the code viewing experience that we wanted to include the tree panel to allow users to quickly switch between folders or files, because understanding code often requires looking in multiple places. We started the project by making our own tree to the aria spec, but it was too verbose. To fix this, our accessibility and design teams created the TreeView, which is open source. This was implemented to support various generic list elements and use proper HTML structure to make navigating through the tree a breeze, including typeahead (the ability to type a bit and have focus move to the first matching element), proper announcements for asynchronous loading of deeply nested items, and proper IDs for all elements that are guaranteed to be unique (that is, not constructed from their contents which may be the same). The valid markup for a tree view is very specific and developing it requires careful reviews for common issues, like invalid child item types under a role="group" element or using nested list elements without considering screen reader support, which is unlike most TreeView implementations on the internet. For more information about the design details for the tree view, check out the markdown documentation. Thanks to @colebemis, @mperrotti, and @ericwbailey for the work on this.

Reading and navigating code by keyboard

Before the new code view, reading code on GitHub wasn’t a great experience for screen reader users. The old experience presented code as a table—a hidden detail for sighted users but a major hurdle for screen readers, since code isn’t a table, and the semantics didn’t make sense in that context. For example, in code, whitespace has meaning. Whether stylistic or functional, that whitespace gets lost for screen reader users when the code is presented as a table. In addition, table semantics force users into line-by-line navigation, instead of character-by-character or word-by-word navigation. For many users, these hurdles meant that they mostly used GitHub just enough to be able to access the raw code or use a code editor for reading code. Since we want to support all our users, we knew we needed to totally rethink the way we structured code in the DOM.

This problem became even more complicated when we introduced symbols and the symbols panel. Mouse users are able to click on a “symbol” in the code—a special code element, like a function name—to see extra details about it, including references and definitions, in the symbol panel. They can then explore the code more deeply, navigating between lines of code where that symbol is found to investigate and understand the code better. This ability to dive deep has been game changing for many developers. However, for keyboard users, it doesn’t work. At best, a keyboard user can use the “Open symbols panel” button in the code header and then filter all symbol definitions for one they are interested in, but this doesn’t allow users to access symbol references when no definitions are found in a file. In addition, this flow really isn’t the same—if we want to support all developers, then we need to offer keyboard users a way to navigate through the code and select symbols they are interested in.

In addition, for many performance reasons mentioned in the post “Crafting a better, faster code view,” we introduced virtualization to the code viewer which created its own accessibility problems—not having all elements in the DOM can interfere with screen readers and overriding the cmd / ctrl + f shortcut is generally bad practice for screen readers as well. In addition, virtualization posed a problem for selecting text outside of the virtualization window.

This is when we came up with the solution of using a cursor from a <textarea> or a <div> that has the property contentEditable. This solution is modeled after Monaco, the text editor that powers VS Code. <textarea> elements, when not marked as readOnly, and contentEditiable<div> elements have a built in cursor that allows screen reader users to navigate code in their preferred manner using their built in screen reader settings. While a contentEditiable <div> would support syntax highlighting and the deep interactions we needed, screen readers don’t support them well1 which defeats the purpose of the cursor. As a result, we decided to go with the <textarea> However, <textarea> elements do not support syntax highlighting or deeper interactions like selecting symbols, which meant we needed to use both the <textarea> as a hidden element and syntax highlighted elements aligned perfectly above. Since we hide the text element, we need to add a visual “fake” cursor to show and keep it in sync with the “real” <textarea> cursor.

While the <textarea> and cursor help with our goals of allowing screen reader users and keyboard users to navigate code and symbols easily, they also ended up helping us with some of the problems we had run into with virtualization. One example of this was the cmd + f problem that we talk about more in depth in the blog post here. Another problem this solved was the drag and select behavior (or select all) for long files. Since the <textarea> is just one DOM node, we are able to load the whole file contents and select the contents directly from the <textarea> instead of the virtualized syntax highlighted version.

Unfortunately, while the <textarea> solved many problems we had, it also introduced a few other tricky ones. Since we have two layers of text, one hidden unless selected and one visual, we need to make sure that the scroll states are aligned. To do this, we have written observers to watch when one scrolls and mimic the scroll on the other. In addition, we often need to override the default <textarea> behaviors for some events—such as the middle click on mouse which was taking users all the way to the bottom of the code. Along with that issue, different browsers handle <textarea>s differently and making sure our solution behaves properly on all browsers has proven to be time intensive to say the least. In addition, we found that some browsers, like Firefox, allow users to customize their font size using Text zoom, which would apply to the formatted text but not the <textarea>. This led to “ghost text” issues with selection. We were able to resolve that by measuring the height of the text that is rendered and passing that to the <textarea>, though there are still some issues with certain plugins that modify text. We are still working to resolve these specific issues as well. In addition, the <textarea> currently does not work with our Wrap lines view option, which we are working to fix. Thanks especially to @joycezhu, @andrialexandrou, @adamshwert, and @jbrown1618 who put in a ton of work here.

Always iterating

We have taken huge strides to improve accessibility for all developers, but we recognize that we aren’t all the way there. It can be challenging to accommodate all developers, but we are committed to improving and iterating on what we have until we get it right. We want our tools to support everyone to access and explore code. We still have work—a lot of work—to do across GitHub, but we are excited for this journey.

To learn more about accessibility at GitHub, go to accessibility.github.com.


  1. For more information about contentEditable and screen readers, see this article written by @joycezhu from our Accessibility Engineering team. ↩

The Japanese Automotive Industry Attack Landscape

Post Syndicated from Tom Caiazza original https://blog.rapid7.com/2023/07/06/the-japanese-automotive-industry-attack-landscape/

The Japanese Automotive Industry Attack Landscape

Recently, we released a major report analyzing the threat landscape of Japan, the globe’s third largest economy. In that report we looked at the ways in which threat actors infiltrate Japanese companies (spoiler alert: it is often through foreign subsidiaries and affiliates) and some of the most pervasive threats those companies face such as ransomware and state-sponsored threat actors.

We also took a look at some of the hardest hit industries and it should come as no surprise that some of the most commonly attacked companies are in industries where Japan currently excels on a global scale. Think manufacturing and automotive, technology & media, and financial services.

In these blog posts we’re going to briefly discuss the findings for one of those industries, but rest assured, more information can be found in our one-page rundowns and the report itself.

The Japanese automotive industry is massive in scale. Japanese car brands are ubiquitous the world over making them a major target for cyber criminals. The global nature of their business means many foreign entities affiliated with Japanese companies can be sources of infiltration by attackers. Product security is a major concern and car maker IP is valuable. Often these attacks come in the form of ransomware and they often impact the supply chain of automakers as foreign subsidiaries and partners are ripe targets. Vulnerabilities in product features such as keyless entry and diagnostic tools also make for lucrative bounties for ransomware groups.

But those are not the only data sets that attackers seek. Auto companies may have a great deal of personally identifiable information about their customers. This information can include customer addresses, names, email, and even VIN numbers. They can lead to increased identity theft by threat actors and even fraudulent financial actions.

Customers aren’t the only victims of identity theft as PII of employees at automotive industry companies is also prevalent. Business email attacks are common as these employees are high-valued targets. Phishing attacks can lead to fraudulent financial transactions framed as legitimate business practices.

For more detail on the threat landscape of the automotive industry in Japan check out our report, or the handy one-page brief specifically looking at this industry.

Validating attestation documents produced by AWS Nitro Enclaves

Post Syndicated from maceneff original https://aws.amazon.com/blogs/compute/validating-attestation-documents-produced-by-aws-nitro-enclaves/

This blog post is written by Paco Gonzalez Senior EMEA IoT Specialist SA.

AWS Nitro Enclaves offers an isolated, hardened, and highly constrained environment to host security-critical applications. Think of AWS Nitro Enclaves as regular Amazon Elastic Compute Cloud (Amazon EC2) virtual machines (VMs) but with the added benefit of the environment being highly constrained.

A great benefit of using AWS Nitro Enclaves is that you can run your software as if it was a regular EC2 instance, but with no persistent storage and limited access to external systems. The only way to communicate with AWS Nitro Enclaves is using a VSOCK socket. This special type of communication mechanism acts as an isolated communication channel between the parent EC2 instance and AWS Nitro Enclaves.Diagram that shows how Nitro Enclaves uses the proven isolation of the Nitro Hypervisor to further isolate the CPU and memory of the Nitro Enclaves from users, applications, and libraries on the parent instance.

 Fig 1 – AWS Nitro Enclaves uses the proven isolation of the Nitro Hypervisor to further isolate the CPU and memory of the Nitro Enclaves from users, applications, and libraries on the parent instance.

AWS Nitro Enclaves comes with a custom Linux device called the Nitro Security Module (NSM), which is accessible via /dev/nsm. This device provides attestation capability to the Nitro Enclaves. The attestation comes in the form of an attestation document. The attestation document makes it easy and safe to build trust between systems that interact with the Nitro Enclaves. The external system must have a mechanism to process the attestation document to determine the validity of the attestation document.

In this post, I go through the anatomy of an attestation document produced by the NSM API. I then show you an example of how to perform different validations that help determine the accuracy of an attestation document produced by the AWS Nitro Enclaves Security Module. I use syntactic and semantic validations to check for the attestation document’s correctness before proceeding with a cryptographic validation of the contents of the document’s payload. The examples used in this post use the C language. Look at the companion repository available in GitHub for access to the all source code used in this post.

Anatomy of an attestation document produced by AWS Nitro Enclaves

The attestation document uses the Concise Binary Object Representation (CBOR) format to encode the data. The CBOR object is wrapped using the CBOR Object Signing and Encryption (COSE) protocol. The COSE format used is a single-signer data structure called “COSE_Sign1”. The object is comprised of headers, the payload, and a signature.

For more information about COSE, see RFC 8152: CBOR Object Signing and Encryption (COSE). For more information about CBOR, see RFC 8949 Concise Binary Object Representation (CBOR).

We published a library to make it easy to interact with the NSM. The library contains helpers which your application, running on the Nitro Enclaves, can use to communicate with the NSM device.

Here is the minimum code needed to generate an attestation document:

#include <stdlib.h>
#include <stdio.h>
#include <nsm.h>

#define NSM_MAX_ATTESTATION_DOC_SIZE (16 * 1024)

int main(void) {

    /// NSM library initialization function.  
    /// *Returns*: A descriptor for the opened device file.

    int nsm_fd = nsm_lib_init();
    if (nsm_fd < 0) {
        exit(1);
    }

    /// NSM `GetAttestationDoc` operation for non-Rust callers.  
    /// *Argument 1 (input)*: The descriptor to the NSM device file.  
    /// *Argument 2 (input)*: User data.  
    /// *Argument 3 (input)*: The size of the user data buffer.  
    /// *Argument 4 (input)*: Nonce data.  
    /// *Argument 5 (input)*: The size of the nonce data buffer.  
    /// *Argument 6 (input)*: Public key data.  
    /// *Argument 7 (input)*: The size of the public key data buffer.  
    /// *Argument 8 (output)*: The obtained attestation document.  
    /// *Argument 9 (input / output)*: The document buffer capacity (as input)
    /// and the size of the received document (as output).  
    /// *Returns*: The status of the operation.

    int status;
    uint8_t att_doc_buff[NSM_MAX_ATTESTATION_DOC_SIZE];
    uint32_t att_doc_cap_and_size = NSM_MAX_ATTESTATION_DOC_SIZE;

    status = nsm_get_attestation_doc(nsm_fd, NULL, 0, NULL, 0, NULL, 0, att_doc_buff, 
                                    &att_doc_cap_and_size);
    if (status != ERROR_CODE_SUCCESS) {
        printf("[Error] Request::Attestation got invalid response: %s\n",status);
        exit(1);
    }

    printf("########## attestation_document_buff ##########\r\n");
    for(int i=0; i<att_doc_cap_and_size; i++)
        fprintf(stdout, "%02X", att_doc_buff[i]);

    exit(0);
}

To produce a sample attestation document, initialize the device, call the function ‘nsm_get_attestation_doc’ inside the AWS Nitro Enclaves, and dump the contents. The library is written using Rust, but it contains
bindings for C. You can read more about the library and some of the other relevant capabilities
here.

The COSE headers contain a protected and an un-protected data section. The cryptographic algorithm used for the signature is specified inside the protected area. AWS Nitro Enclaves use a 384-bit elliptic curve algorithm (P-384) to sign attestation documents. AWS Nitro Enclaves do not use the unprotected data field so it is always left blank.

The payload contains fixed parameters that include the following: information about the issuing NSM, a timestamp of the issuing event, a map of all the locked Platform Configuration Registers (PCRs) at the moment the attestation document was generated, the hashing algorithm used to produce the digest that was used to calculate the PCR values – AWS Nitro Enclaves use a 384 bit secure hashing algorithm (SHA384), a x509 certificate signed by AWS Nitro Enclaves’ Private Public Key Infrastructure (PKI). An AWS Nitro Enclaves certificate expires three hours after it has been issued. The common name (CN) contains information about the issuing NSM – and finally the issuing Certificate Authority (CA) bundle. The payload also contains optional parameters that a third-party application can use to create custom authentication and authorization workflows. The optional parameters are: a public key, a cryptographic nonce, and additional arbitrary data.

Finally, the signature is the result of a signing operation using the private key related to the public key contained inside the certificate that is part of the payload.

Diagram that illustrates the components of a attestation document produced by a Nitro Enclave

Fig 2. An attestation document is generated and signed by the Nitro Hypervisor. It contains information about the Nitro Enclaves and it can be used by an external service to verify the identity of Nitro Enclaves and to establish trust. You can use the attestation document to build your own cryptographic attestation mechanisms.

Syntactical validation

Early validation of the attestation document format makes sure that only documents that conform to the expected structure are processed in subsequent steps.

I start by attempting to decode the CBOR object and testing to see if it corresponds to a COSE object signed with one signer or ‘COSE_Sign1’ structure. This can be easily done by looking at the most significant first three bits (MSB) of the first byte – I am expecting a stream of CBOR bytes (decimal 6). Then, I take the least significant (LSB) remaining five bits of the first byte – I am expecting a tag that tells me it is a COSE_Sign1 object (decimal 18).

assert(att_doc_buff[0*] == 6 <<5 | 18); // 0xD2

* Note that the time of writing, the NSM does not include the COSE tag and thus this validation cannot be made and is mentioned in this post for informational purposes only. However, it is important to keep this in mind, as the tag is part of the standard, and the NSM device or library could include it in the future.*

The next step is to parse the actual CBOR object. A COSE_Sign1 object is an array of size 4 (protected headers, un protected headers, payload, and signature). Therefore, I must check that the next three MSB correspond to Type 4 (array) and that the size is exactly 4.

assert(att_doc_buff[0] == 4 <<5 | 4); // 0x84

The next byte determines what the first CBOR item of the array looks like. I am expecting the protected COSE header as the first item of the array. The CBOR field should indicate that the contents of the item are of a Type 2 (raw bytes) and the size should be exactly 4.

assert(att_doc_buff[1] == 2 <<5 | 4); // 0x44

The next four bytes represent the protected header. The contents of this item is a regular CBOR object. The object should contain a Type 5 (map) with a single item (1). The item first key is expected to be the number 1. The first three MSB of the first byte should be a Type 1 (negative integer). The remaining five LSB should indicate that the value is an 8-bit number (decimal 24). The last byte should be negative 35 as it maps to the P-384 curve that Nitro Enclaves use. Note that CBOR negative numbers are stored minus 1.

assert(att_doc_buff[2] == 5 <<5 | 1); // 0xA1
assert(att_doc_buff[3] == 0x01); // 0x01
assert(att_doc_buff[4] == 1 <<5 | 24); // 0x38
assert(att_doc_buff[4] == 35-1); // 0x22

The next byte corresponds to the unprotected header. AWS Nitro Enclaves do not use unprotected headers. Therefore, the expected is a Type 5 (map) with zero items.

assert(att_doc_buff[6] == 5 <<5 | 0); // 0xA0

Now that I am done inspecting the headers, I can move onto the payload. The CBOR object used for the payload is Type 2 (raw bytes). This time we are expecting a large steam of bytes. The remaining five LSB are used to indicate the data type used to indicate the size of the byte stream (i.e. 8-bit, 16-bit). AWS Nitro Enclaves attestation documents are about 5 KiB without using any of the three optional parameters. The optional parameters have a size limit of 1 KiB each. This means that it would be highly unlikely for the buffer to be larger than a 16-bit number (CBOR short count: 25).

assert(att_doc_buff[8] == 2 <<5 | 25); // 0x59

The next two bytes represent the size of the payload which I am going to skip those for now, as the contents of the payload are validated in subsequent steps. I’ll move onto the final portion of the attestation document: the signature. The signature has to be a Type 2 (raw bytes) of exactly 96 bytes.

    uint16_t payload_size = att_doc_buff[8] << 8 | att_doc_buff[9];
    assert(att_doc_buff[9+payload_size+1] == (2<<5 | 24));   // 0x58
    assert(att_doc_buff[9+payload_size+1+1] == 96);         // 0x60

At this point, I have validated that the data produced by the NSM looks the way it should. My application is ready to start looking into the contents of the attestation document.

I want to make sure that the document contains all mandatory fields and I can check that the fields have the right structure and their sizes are within the expected boundaries. I have evidence that the data looks the way it should, so I am ready to use an off-the-shelf CBOR library to make the validation process easier instead of doing it by hand.

Here is an example of how to load a CBOR object using libcbor and standard C libraries to check the contents. I am showing just one example to illustrate the process. Refer to the section ‘Verifying the root of trust’ in the AWS Nitro Enclaves User Guide for a detailed description of each parameter and the validations that your application should perform to make sure that the document is valid.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>

#include <cbor.h>
#include <openssl/ssl.h>

#define APP_X509_BUFF_LEN                   (1024*2)
#define APP_ATTDOC_BUFF_LEN                 (1024*10)

void output_handler(char * msg){
    fprintf(stdout, "\r\n%s\r\n", msg);
}

void output_handler_bytes(uint8_t * buffer, int buffer_size){    
    for(int i=0; i<buffer_size; i++)
        fprintf(stdout, "%02X", buffer[i]);
    fprintf(stdout, "\r\n");
}

int read_file( unsigned char * file, char * file_name, size_t elements) {
    FILE * fp; size_t file_len = 0;
    fp = fopen(file_name, "r");
    file_len = fread(file, sizeof(char), elements, fp);
    if (ferror(fp) != 0 ) {
        fputs("Error reading file", stderr);
    } 
    fclose(fp);
    return file_len; 
}  

int main(int argc, char* argv[]) {

    // STEP 0 - LOAD ATTESTATION DOCUMENT

    // Check inputs, expect two
    if (argc != 3) { 
        fprintf(stderr, "%s\r\n", "ERROR: usage: ./main {att_doc_sample.bin} {AWS_NitroEnclaves_Root-G1.pem}"); exit(1);
    }

    // Load file into buffer, use 1st argument
    unsigned char * att_doc_buff = malloc(APP_ATTDOC_BUFF_LEN);
    int att_doc_len = read_file(att_doc_buff, argv[1], APP_ATTDOC_BUFF_LEN );

    // STEP 1 - SYTANCTIC VALIDATON

    // Check COSE TAG (skipping - not currently implemented by AWS Nitro Enclaves)
    // assert(att_doc_buff[0] == 6 <<5 | 18); // 0xD2
    // Check if this is an array of exactly 4 items
    assert(att_doc_buff[0] == (4<<5 | 4));      // 0x84
    // Check if next item is a byte stream of 4 bytes
    assert(att_doc_buff[1] == (2<<5 | 4));      // 0x44
    // Check is fist item if byte stream is a map with 1 item
    assert(att_doc_buff[2] == (5<<5 | 1));      // 0xA1
    // Check that the first key of the map is 0x01
    assert(att_doc_buff[3] == 0x01);            // 0x01
    // Check that value of the the first key of the map is -35 (P-384 curve)
    assert(att_doc_buff[4] == (1 <<5 | 24));    // 0x38
    assert(att_doc_buff[5] == 35-1);            // 0x22
    // Check that next item is a map of 0 items
    assert(att_doc_buff[6] == (5<<5 | 0));      // 0xA0
    // Check that the next item is a byte stream and the size is a 16-bit number (dec. 25)
    assert(att_doc_buff[7] == (2<<5 | 25));     // 0x59
    // Cast the 16-bit number
    uint16_t payload_size = att_doc_buff[8] << 8 | att_doc_buff[9];
    // Check that the item after the payload is a byte stream and the size is 8-bit number (dec. 24)
    assert(att_doc_buff[9+payload_size+1] == (2<<5 | 24));   // 0x58
    // Check that the size of the signature is exactly 96 bytes
    assert(att_doc_buff[9+payload_size+1+1] == 96);         // 0x60

    // Parse buffer using library
    struct cbor_load_result ad_result;
    cbor_item_t * ad_item = cbor_load(att_doc_buff, att_doc_len, &ad_result);
    free(att_doc_buff); // not needed anymore

    // Parse protected header -> item 0 
    cbor_item_t * ad_pheader = cbor_array_get(ad_item, 0); 
    size_t ad_pheader_len = cbor_bytestring_length(ad_pheader);

    // Parse signed bytes -> item 2 (skip un-protected headers as they are always empty)
    cbor_item_t * ad_signed = cbor_array_get(ad_item, 2);
    size_t ad_signed_len = cbor_bytestring_length(ad_signed);

    // Load signed bytes as a new CBOR object
    unsigned char * ad_signed_d = cbor_bytestring_handle(ad_signed);
    struct cbor_load_result ad_signed_result;
    cbor_item_t * ad_signed_item = cbor_load(ad_signed_d, ad_signed_len, &ad_signed_result);

    // Create the pair structure
    struct cbor_pair * ad_signed_item_pairs = cbor_map_handle(ad_signed_item);

    // Parse signature -> item 3
    cbor_item_t * ad_sig = cbor_array_get(ad_item, 3); 
    size_t ad_sig_len = cbor_bytestring_length(ad_sig);
    unsigned char * ad_sig_d = cbor_bytestring_handle(ad_sig);

    // Example 01: Check that the first item's key is the string "module_id" and that is not empty
    size_t module_k_len = cbor_string_length(ad_signed_item_pairs[0].key);
    unsigned char * module_k_str = realloc(cbor_string_handle(ad_signed_item_pairs[0].key), module_k_len+1); //null char
    module_k_str[module_k_len] = '\0';
    size_t module_v_len = cbor_string_length(ad_signed_item_pairs[0].value);
    unsigned char * module_v_str = realloc(cbor_string_handle(ad_signed_item_pairs[0].value), module_v_len+1); //null char
    module_v_str[module_v_len] = '\0';
    assert(module_k_len != 0);
    assert(module_v_len != 0);

    // Example 02: Check that the module id key is actually the string "module_id"
    assert(!strcmp("module_id",(const char *)module_k_str));

    // Example 03: Check that the signature is exactly 96 bytes long
    assert(ad_sig_len == 96);

    // Example 04: Check that the protected header is exactly 4 bytes long
    assert(ad_pheader_len == 4);

Semantic validation

The next step is to look at the data contained in the attestation document and check if it conforms to pre-defined business rules. The attestation document contains a certificate that was signed by the AWS Nitro Enclaves’ PKI. This validation it is important, as it proves that the document was signed by the AWS Nitro Enclaves’ PKI.

The signature of an x509 certificate is based on the certificate’s payload digest. Validating this signature means that I trust the information contained within the certificate, including the public key which I can later use to validate the attestation document itself. Furthermore, the information in the document contains details about the NSM module and a timestamp. Passing this check provides the assurances I need to trust that the document originated from my software running on AWS Nitro Enclaves at a specific time.

Diagram that illustrates the components of a x.509 certificate, part of the payload of a attestation document produced by AWS Nitro Enclaves.

Fig 3. The attestation document contains a x.509 certificate that was signed by the AWS Nitro Enclaves’ PKI.

Here is an example of how I use the AWS Nitro Enclaves’ Private PKI root certificate from an external file. Then, use the CA bundle contained in the attestation document to validate the authenticity of the certificate contained in the document. In this example, I am using the OpenSSL library.

// STEP 2 -  SEMANTIC VALIDATION

    // Load AWS Nitro Enclave's Private PKI root certificate
    unsigned char * x509_root_ca = malloc(APP_X509_BUFF_LEN);
    int x509_root_ca_len = read_file(x509_root_ca, argv[2], APP_X509_BUFF_LEN );
    BIO * bio = BIO_new_mem_buf((void*)x509_root_ca, x509_root_ca_len);
    X509 * caX509 = PEM_read_bio_X509(bio, NULL, NULL, NULL);
    if (caX509 == NULL) {
        fprintf(stderr, "%s\r\n", "ERROR: PEM_read_bio_X509 failed"); exit(1);
    }
    free(x509_root_ca); free(bio);
    // Create CA_STORE
    X509_STORE * ca_store = NULL;
    ca_store = X509_STORE_new();
    /* ADD X509_V_FLAG_NO_CHECK_TIME FOR TESTING! TODO REMOVE */
    X509_STORE_set_flags (ca_store, X509_V_FLAG_NO_CHECK_TIME);
    if (X509_STORE_add_cert(ca_store, caX509) != 1) {
        fprintf(stderr, "%s\r\n", "ERROR: X509_STORE_add_cert failed"); exit(1);
    }
    // Add certificates to CA_STORE from cabundle
    // Skip the first one [0] as that is the Root CA and we want to read it from an external source
    for (int i = 1; i < cbor_array_size(ad_signed_item_pairs[5].value); ++i){ 
        cbor_item_t * ad_cabundle = cbor_array_get(ad_signed_item_pairs[5].value, i); 
        size_t ad_cabundle_len = cbor_bytestring_length(ad_cabundle);
        unsigned char * ad_cabundle_d = cbor_bytestring_handle(ad_cabundle);
        X509 * cabnX509 = X509_new();
        cabnX509 = d2i_X509(&cabnX509, (const unsigned char **)&ad_cabundle_d, ad_cabundle_len);
        if (cabnX509 == NULL) {
            fprintf(stderr, "%s\r\n", "ERROR: d2i_X509 failed"); exit(1);
        }
        if (X509_STORE_add_cert(ca_store, cabnX509) != 1) {
            fprintf(stderr, "%s\r\n", "ERROR: X509_STORE_add_cert failed"); exit(1);
        }
    }

    // Load certificate from attestation dcoument - this a certificate that we don't trust (yet)
    size_t ad_signed_cert_len = cbor_bytestring_length(ad_signed_item_pairs[4].value);
    unsigned char * ad_signed_cert_d = realloc(cbor_bytestring_handle(ad_signed_item_pairs[4].value), ad_signed_cert_len);
    X509 * pX509 = X509_new();
    pX509 = d2i_X509(&pX509, (const unsigned char **)&ad_signed_cert_d, ad_signed_cert_len);
    if (pX509 == NULL) {
        fprintf(stderr, "%s\r\n", "ERROR: d2i_X509 failed"); exit(1);
    }
    // Initialize X509 store context and veryfy untrusted certificate
    STACK_OF(X509) * ca_stack = NULL;
    X509_STORE_CTX * store_ctx = X509_STORE_CTX_new();
    if (X509_STORE_CTX_init(store_ctx, ca_store, pX509, ca_stack) != 1) {
        fprintf(stderr, "%s\r\n", "ERROR: X509_STORE_CTX_init failed"); exit(1);
    }
    if (X509_verify_cert(store_ctx) != 1) {
        fprintf(stderr, "%s\r\n", "ERROR: X509_verify_cert failed"); exit(1);
    }
    fprintf(stdout, "%s\r\n", "OK: ########## Root of Trust Verified! ##########");

Having proof that the certificate was signed by the expected CA is just the beginning. I also want to make sure that the contents of the certificate are correct. This involves checking that the certificate has not expired, as well as making sure that the critical extensions contain correct information to name a few.

Cryptographic validation

The syntactic validation helped me determine that the attestation document has the right shape, and the sematic validation helped me determine if the document meets my business rules. However, I still don’t know for sure if the document is valid.

The attestation document contains critical information, such as PCRs and the AWS Identity Access and Management (IAM) role among other details. I can safely use these two values in my authentication or authorization workflows if I can prove that they are trustworthy.

The attestation document was signed using a private key that is never exposed. However, the corresponding public key is contained within the certificate that was issued and stored within the attestation document. I know I can trust the contents of this certificate because I have proof that the certificate was signed by an entity that I trust.

Here is an example where I cryptographically prove that all the protected contents of the attestation document are related to the public key contained in the certificate. To validate the COSE signature, I must first recreate the original message that was used during the signature operation – COSE uses a specific format. Then, I use OpenSSL to check if there is a match between the message, signature, and public key. If the signature checks, then I can trust the contents of the already semantically-verified payload.

 // STEP 3 - CRYPTOGRAPHIC VALIDATION

    #define SIG_STRUCTURE_BUFFER_S (1024*10)
    // Create new empty key
    EVP_PKEY * pkey = EVP_PKEY_new();
    // Create a new eliptic curve object using P-384 curve
    EC_KEY * ec_key = EC_KEY_new_by_curve_name(NID_secp384r1);
    // Reference the public key stucture and eliptic curve object with each other
    EVP_PKEY_assign_EC_KEY(pkey, ec_key);
    // Load the public key from the attestation document (we trust it now)
    pkey = X509_get_pubkey(pX509);
    if (pkey == NULL) {
        fprintf(stderr, "%s\r\n", "ERROR: X509_get_pubkey failed"); exit(1);
    }
    // Allocate, initialize and return a digest context
    EVP_MD_CTX * ctx = EVP_MD_CTX_create();
    // Set up verification context
    if (EVP_DigestVerifyInit(ctx, NULL, EVP_sha384(), NULL, pkey) <= 0) {
        fprintf(stderr, "%s\r\n", "ERROR: EVP_DigestVerifyInit failed"); exit(1);
    }
    // Recreate COSE_Sign1 structure, and serilise it into a buffer
    cbor_item_t * cose_sig_arr = cbor_new_definite_array(4);
    cbor_item_t * cose_sig_arr_0_sig1 = cbor_build_string("Signature1"); 
    cbor_item_t * cose_sig_arr_2_empty = cbor_build_bytestring(NULL, 0);

    assert(cbor_array_push(cose_sig_arr, cose_sig_arr_0_sig1));
    assert(cbor_array_push(cose_sig_arr, ad_pheader));
    assert(cbor_array_push(cose_sig_arr, cose_sig_arr_2_empty));
    assert(cbor_array_push(cose_sig_arr, ad_signed));

    unsigned char sig_struct_buffer[SIG_STRUCTURE_BUFFER_S];
    size_t sig_struct_buffer_len = cbor_serialize(cose_sig_arr, sig_struct_buffer, SIG_STRUCTURE_BUFFER_S);
    // Hash message and load it into the verificaiton context
    if (EVP_DigestVerifyUpdate(ctx, sig_struct_buffer, sig_struct_buffer_len) <= 0) {
        fprintf(stderr, "%s\r\n", "ERROR: nEVP_DigestVerifyUpdate failed"); exit(1);
    }
    // Create R and V BIGNUM structures
    BIGNUM * sig_r = BN_new(); BIGNUM * sig_v = BN_new();
    BN_bin2bn(ad_sig_d, 48, sig_r); BN_bin2bn(ad_sig_d + 48, 48, sig_v);
    // Allocate an empty ECDSA_SIG structure
    ECDSA_SIG * ec_sig = ECDSA_SIG_new();
    // Set R and V values
    ECDSA_SIG_set0(ec_sig, sig_r, sig_v);
    // Convert R and V values into DER format
    int sig_size = i2d_ECDSA_SIG(ec_sig, NULL);
    unsigned char * sig_bytes = malloc(sig_size); unsigned char * p;
    memset_s(sig_bytes,sig_size,0xFF, sig_size);
    p = sig_bytes;
    sig_size = i2d_ECDSA_SIG(ec_sig, &p);
    // Verify the data in the context against the signature and get final result
    if (EVP_DigestVerifyFinal(ctx, sig_bytes, sig_size) != 1) {
        fprintf(stderr, "%s\r\n", "ERROR: EVP_DigestVerifyFinal failed"); exit(1);
    } else {
        fprintf(stdout, "%s\r\n", "OK: ########## Message Verified! ##########"); 
        free(sig_bytes);
        exit(0);
    }
    //#endif

    exit(1);

}

Conclusion

In this post, I went through a detailed examination of attestation documents produced by the AWS Nitro Enclaves. Then, I went over different types of validations (syntactic, semantic, and cryptographic) that safely help determine if an attestation document should be trusted. I’ve also included access to a public repository that contains the source code used in this post. New AWS Nitro Enclaves users can use it as a starting point when looking to integrate their applications with AWS Nitro Enclaves and build highly secure and confidential solutions.

PenTales: “User enumeration is not a vulnerability” – I beg to differ

Post Syndicated from Rapid7 original https://blog.rapid7.com/2023/07/06/user-enumeration-is-not-a-vulnerability-i-beg-to-differ/

PenTales: “User enumeration is not a vulnerability” – I beg to differ

At Rapid7 we love a good pentest story. So often they show the cleverness, skill, resilience, and dedication to our customer’s security that can only come from actively trying to break it! In this series, we’re going to share some of our favorite tales from the pen test desk and hopefully highlight some ways you can improve your own organization’s security.

This is a story of how a well defended network was compromised through user enumeration; a vulnerability which many organizations do not consider to be a “real” vulnerability. For the uninitiated, user enumeration vulnerabilities are application behaviors that could allow a malicious actor to determine valid usernames on a service. They are commonly exploited to set up follow-on attempts to guess users’ passwords.

I was tasked with performing an external penetration test for a midsize company. I began the engagement by performing port scanning and service enumeration, and discovered a small number of accessible web services. This led to a wonderful discovery: Outlook Web Access (OWA) was exposed! OWA suffers from a user enumeration vulnerability in which authentication requests involving valid usernames produce different responses than authentication requests involving invalid usernames. This could allow a malicious actor to submit unlimited authentication requests with different usernames, and use the responses to determine whether a given user exists in Exchange or not. We believe that Microsoft has been aware of this problem since 2014 but has not yet patched it. Some security professionals speculate that this may be because Microsoft (like many other companies) does not consider user enumeration to be a vulnerability.

I quickly began user enumeration against this service. After harvesting employee names from LinkedIn, marketing databases, and password breach databases, I coerced the employee names into a username format and verified them against OWA. Once done, I pulled popular names from US Census data and found additional valid usernames. When all was finished I was in possession of hundreds of usernames I could employ for password spray attacks set up through Metasploit. It took just one attempt to find success: a support engineer was using a classic weak password which is compliant with most password policies, [season][year][special character]!

I logged into this user’s email, enumerated their inbox, and found users sending support requests that contained passwords and sensitive information over plaintext! If a malicious actor were to obtain these, they could potentially log into other accounts owned by this company’s clients or employees given the prevalence of password reuse. I also extracted the Exchange Global Address List that contained every email address in the company which would prove incredibly useful for further password spray attacks (or in the hands of a malicious actor, for a business email compromise attack).

Finally, I observed that VMware Horizon, a system used to provide remote access to employee workstations, was accessible to the public internet. When attempting to log in using the compromised credentials it was discovered that multifactor authentication was not being employed. I identified an active Windows virtual machine and logged in over RDP, giving me a foothold in the client’s internal network. This entire attack chain took less than an hour and the ingress into internal systems went undetected by my client.

My client was stunned to say the least, but through our partnership we identified a set of controls which would mitigate all of the identified vulnerabilities. Our subsequent conversations also were able to surface other issues outside of the pentest scope which we helped address, and together we were able to dramatically reduce their organization’s attack surface.

We believe this assessment demonstrates the value of a penetration test: vulnerability scans will not flag findings such as OWA user enumeration, users employing weak passwords that still comply with password policies, and a lack of MFA. Through our penetration testing assessments, we can also demonstrate a more holistic picture of the risks that our clients face by identifying and chaining disparate vulnerabilities together in the way that only a skilled human can. We can then partner with them to ensure swift mitigation using a strategy that is tailor made for the client’s individual environment.

Showcasing SecOps Metrics That Matter

Post Syndicated from Rapid7 original https://blog.rapid7.com/2023/07/06/showcasing-secops-metrics-that-matter/

Showcasing SecOps Metrics That Matter

This year, new rules from the Security and Exchange Commission (SEC) about board-level expertise, risk management, and public disclosures will take effect. The European Union is updating its regulations, as well. To meet these new requirements, organizations will need to explain to shareholders exactly how they assess cyber risk, describe security policies, and prove a significant level of board oversight.

In this climate, security leaders will be expected to advise the C-suite on SecOps activities. As a security professional, this can be a challenge. It’s also an opportunity to shape the structure and execution of business and go-to-market decisions.

Our latest ebook, Presenting Upward: How to Showcase SecOps Metrics That Matter offers practical and actionable advice on how to present security metrics in a language execs understand.

About those metrics

Cybersecurity metrics are essential to understand where you’re succeeding and where you may need to make changes.

Some examples include:

Number and disposition of security incidents: You have no control of this, but it gives execs insight into the risk they face. There’s an attack every 39 seconds somewhere. What’s life like in your security operation?

Mean time-to-detection (MTTD): This metric gives insight into both efficacy of tools and coverage of data (is the detection coming from a reported incident vs. a tool, etc.).

Mean time-to-respond (MTTR): This also gives insight into your ability to respond and whether your tools and processes meet your threats and use cases.

Cost-per-incident: This gives you insight into efficiency of process, tooling, and also potential staffing shortcomings (like the number of people or specific skills).

There are many other metrics you may need to track to understand your cybersecurity readiness. Good metrics will differ for every organization, depending on your risks, needs, compliance requirements, desired business outcomes, security maturity, and more.

Stories + metrics = success

Generally speaking, executives don’t usually want to get too deep in the weeds. So, your ability to present metrics in a way they understand is critical to achieve cybersecurity goals.

Execs typically want answers to questions like:

  • What are our risks, and how are we addressing them?
  • How secure are we compared to similar organizations?
  • Are we budgeting the right amount for cybersecurity?
  • Where do we have opportunities for efficiencies or consolidation?
  • How are we addressing that thing in the news?

So, when presenting to execs it’s essential to put metrics into context. One way to do this is to craft a narrative that brings metrics to life. Stories often have more of an impact than facts and figures alone. This isn’t anecdotal; neuroscience has shown that when we are presented with a story, we understand the information more deeply, remember longer, and are more likely to factor what it taught us into future decisions.
For more tips on crafting an effective narrative, and much more, download Presenting Upward: How to Showcase SecOps Metrics That Matter now.

Things Might Look a Little Different Around Here: Technical Documentation Gets an Upgrade

Post Syndicated from Alison McClelland original https://www.backblaze.com/blog/things-might-look-a-little-different-around-here-technical-documentation-gets-an-upgrade/

A decorative image of a computer displaying the title Introducing the New Backblaze B2 Cloud Storage Documentation Portal.

When you’re working hard on an IT or development project, you need to be able to find instructions about the tools you’re using quickly. And, it helps if those instructions are easy to use, easy to understand, and easy to share. 

On the Technical Publications team, we spend a lot of time thinking about how to make our docs just that—easy. 

Today, the fruits of a lot of thinking and reorganizing and refining are paying off. The new Backblaze technical documentation portal is live.

Explore the Portal ➔ 

What’s New in the Tech Docs Portal?

The documentation portal has been completely overhauled to deliver on-demand content with a modern look and feel. Whether you’re a developer, web user, or someone who wants to understand how our products and services work, our portal is designed to be user-friendly, with a clean and intuitive interface that makes it easy to navigate and find the information you need.

Here are some highlights of what you can look forward to:

  • New and updated articles right on the landing page—so you’re always the first to know about important content changes.
  • A powerful search engine to help you find topics quickly.
  • A more logical navigation menu that organizes content into sections for easy browsing.
  • Information about all of the Backblaze B2 features and services in the About section.

You can get started using the Backblaze UI quickly to create application keys, create buckets, manage your files, and more. If you’re programmatically managing your data, we’ve included resources such as SDKs, developer quick-start guides, and step-by-step integration guides. 

Perhaps the most exciting enhancement is our API documentation. This resource provides endpoints, parameters, and responses for all three of our APIs: S3-Compatible, B2 Native, and Partner API.   

For Fun: A Brief History of Technical Documentation

As our team put our heads together to think about how to announce the new portal, we went down some internet rabbit holes on the history of technical documentation. Technical documentation was recognized as a profession around the start of World War II when technical documents became a necessity for military purposes. (Note: This was also the same era that a “computer” referred to a job for a person, meaning “one who computes”.) But the first technical content in the Western world can be traced back to 1650 B.C—the Rhind Papyrus describes some of the mathematical knowledge and methods of the Egyptians. And the title of first Technical Writer? That goes to none other than poet Geoffrey Chaucer of Canterbury Tales fame for his lesser-known work “A Treatise on the Astrolabe”—a tool that measures angles to calculate time and determine latitude.

A photograph of an astrolabe.
An astrolabe, or, as the Smithsonian calls it, “the original smartphone.” Image source.

After that history lesson, we ourselves waxed a bit poetic about the “old days” when we wrote long manuals in word processing software that were meant to be printed, compiled long indexes for user guides using desktop publishing tools, and wrote more XML code in structured authoring programs than actual content. These days we use what-you-see-is-what-you-get (WYSIWYG) editors in cloud-based content management systems which make producing content much easier and quicker—and none of us are dreaming in HTML anymore. 

<section><p>Or maybe we are.</p></section>

Overall, the history of documentation in the tech industry reflects the changing needs of users and the progression of technology. It evolved from technical manuals for experts to user-centric, accessible resources for audiences of all levels of technical proficiency.

The Future of Backblaze Technical Documentation Portal

In the coming months, you’ll see even more Backblaze B2 Cloud Storage content including many third-party integration guides. Backblaze Computer Backup documentation will also find a home here in this new portal so that you’ll have a one-stop-shop for all of your Backblaze technical and help documentation needs. 

We are committed to providing the best possible customer-focused documentation experience. Explore the portal to see how our documentation can make using Backblaze even easier!

The post Things Might Look a Little Different Around Here: Technical Documentation Gets an Upgrade appeared first on Backblaze Blog | Cloud Storage & Cloud Backup.

The collective thoughts of the interwebz