Войната на бъдещето

Post Syndicated from Григор original http://www.gatchev.info/blog/?p=2651

Мисля си – човечеството върви към Трета световна война. На която сегашната война в Украйна е просто Судети.

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

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

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

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

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

(Всъщност и тогава не може. Рим го направи могъщ свободата на гражданите му. Тя създаде такава база, че дори след като се превърна в империя, Рим контролира екумена си с векове. Да, след като рухна дойде Средновековието, наричано на повечето езици „време на мрака“. Но и в него забутан остров на края на екумена в един момент прие Харта за правата и свободите. Съгради на нейна база малко по-свободно от околните общества. А то направи индустриална революция и превърна страната си в световна империя. Която отстъпи от тези позиции чак след като беше надконкурирана от други, взели нейната свобода и я умножили, и станали още по-могъщи… И демокрацията се възроди, още по-силна отпреди.

Преди повече от 20 години бях сънувал един сън – ето извадка от него:

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

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

Затова всички те имат общ интерес във войната, която вече се води. (И на която бъдеща Трета световна между демокрациите и диктатурите е само един от многото аспекти.) И диктатурите знаят това отлично, и търсят съюз и взаимодействие с местните психопати, садисти и отпадъци на еволюцията в демокрациите. Или дори просто ги подпомагат, като начин да пренесат войната си срещу „врага“ на негов терен. (Някой учуден защо Русия подкрепя Тръмп?)

Имат интерес и да манипулират глупавите и лековерните, за да ги превърнат в „полезни идиоти“ (терминът е на ГРУ) и да ги използват за пушечно месо във войната си. И благодарение на Русия имат и технологии за социално инженерство, които да им помагат в това. Затова и в днешните времена идиотът винаги е опасен за адекватните – шансът някой психопат да е успял да му хване конците и да го марионетства да ти навреди е голям.

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

Ето това е войната, която ни очаква. Това са страните, които ще воюват в нея. Това е, което очаква обикновените хора където стъпят диктатурите. И това са тези, които ще ги предадат отвътре.

Предупреденият е въоръжен.

Стратегически технологични решения вместо политически битовизми

Post Syndicated from Bozho original https://blog.bozho.net/blog/4433

Изкуственият интелект (големите езикови модели) носи потенциал за сериозна трансформация в много сфери. Носи и рискове, които са трудно оценими, а самият разговор за потенциала и за рисковете има трансформиращи ефекти.

За да бъдем защитени в дигиталния свят, особено в свят с напреднал изкуствен интелект, трябва в сферата на киберсигурността да има сериозни развития – и на технологично, и на организационно ниво. Основни вектори за атака са все още нерешени на достатъчно добро и масово ниво – phishing, ransomware – и това струва милиарди на икономиките.

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

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

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

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

Няма да правя предизборни заключения от това, но ми се ще да се занимаваме повече с тези стратегически технологични въпроси, вниквайки в тях извън маркетинговите заглавия, и по-малко с полиически битовизми.

Материалът Стратегически технологични решения вместо политически битовизми е публикуван за пръв път на БЛОГодаря.

Седмицата (21–26 октомври)

Post Syndicated from Надежда Радулова original https://www.toest.bg/sedmitsata-21-26-oktomvri/

Седмицата (21–26 октомври)

В ден като днешния има риск почти всичко, което бих могла да напиша тук, да се приеме като агитация в полза на тази или онази политическа формация. Или пък като очерняне. Затова и няма да споменавам нищо за взривоопасни документални филми, за образователни деятелки/кукловодки, за високотехнологични печатници на банкноти или за люти битки в последната минута между соколи и други едри хищни и хвъркати екземпляри, пък били те пойни…

Вместо това предлагам за миг да си спомним за големия Франк Запа (аз лично винаги го слушам по време на избори) – композитор, китарист, пърформър, импровизатор, експериментатор, сатирик, но и… страстен радетел на свободния вот. От 1971 г. във всеки свой албум той включва призива Register to Vote. С помощта на Лигата на гласуващите жени Запа за първи път урежда места за регистрация на гласоподаватели в залите, където прави концерти.

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

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

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

Тази седмица отново сме в Украйна с Николета Атанасова. На пръв поглед сме като на екскурзия – разхождаме се из красивия Лвов, почти незасегнат от войната. Зяпаме старите сгради и църкви, пием кафета и коктейли с местните… И така, докато Николета не ни среща с един военен лекар и спомените му от фронта отново ни разказват играта. Особено в момент, в който съдбата на Украйна сякаш се разиграва на руска рулетка, само дето, за голямо съжаление, рулетката вече не е само руска. „Това е войната“!

Връщаме се на домашен терен с разговор на Надежда Цекулова с управителя на НЗОК Станимир Михайлов. Има ли опити за политически намеси в дейността на Касата? Разбира се, че да. Така че борбата е за възстановяване и гарантиране на независимостта на ребуса НЗОК. Има и едно изречение в края на интервюто, което, струва ми се, трябва да е изписано със светещи букви във всяко звено, администриращо здравеопазването: „Когато става въпрос за лечение, времето е лукс.“

Часове преди изборите Емилия Милчева фокусира вниманието ни върху постепенното превръщане на представителната демокрация в България в непредставителна благодарение на ниската избирателна активност, която пък е логична последица от трайното обвързване на олигархични структури с управлението на страната. Какво ни чака след изборите, пита Емилия, докато анализира „Технологията на властта и нейните механици“. И дали предстоящите „сглобки“ ще осигурят достатъчно стабилна конструкция, или ще ни докарат поредния безкраен парламентарен хелоуин… Предстои да видим.

Предложенията на Зорница Христова за този месец са две прекрасни книги, които, за щастие, получаваме в хубав превод на български – „Фердидурке“ на модерния класик Витолд Гомбрович и „За разлика от слоновете“ на голямата немска писателка Дагмар Лойполд. Така че да не губим надежда – рубриката „По буквите“ винаги предлага „листи“ с имена, зад които си струва да застанем с читателския си избор.

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

Някой нагълтал вода
Някой се дави
А никой не реагира

Така завършва стихотворението на Силвия Чолева. А утре е ден, в който да слезем от високите си мостове, да нагазим в реката и да реагираме.

Приятно четене и не забравяйте – има и избори, които не приключват в неделя. Всеки ден само и единствено вие избирате дали да ни има.

[$] OSI readies controversial Open AI definition

Post Syndicated from jzb original https://lwn.net/Articles/995159/

The Open Source Initiative
(OSI) has been working on defining Open Source AI—that is what
constitutes an AI system that can be used, studied, modified, and
shared for any purpose—for almost two
years. Its board will
be voting on the Open Source AI Definition (OSAID) on Sunday,
October 27, with the 1.0 version slated to be published on
October 28. It is never possible to please everyone in
such an endeavor, and it would be folly to make that a goal. However,
a number of prominent figures in the open-source community have voiced
concerns that OSI is setting the bar too low with the OSAID—which
will undo decades of community work to cajole vendors into adhering to
or respecting the original Open Source
Definition
(OSD).

How to mitigate bot traffic by implementing Challenge actions in your AWS WAF custom rules

Post Syndicated from Javier Sanchez Navarro original https://aws.amazon.com/blogs/security/how-to-mitigate-bot-traffic-by-implementing-challenge-actions-in-your-aws-waf-custom-rules/

If you are new to AWS WAF and are interested in learning how to mitigate bot traffic by implementing Challenge actions in your AWS WAF custom rules, here is a basic, cost-effective way of using this action to help you reduce the impact of bot traffic in your applications. We also cover the basics of using the Bot Control feature to implement Challenge actions as a more sophisticated and robust option for an additional cost.

AWS WAF is a web application firewall that helps you protect against common web exploits and bots that can affect availability, compromise security, or consume excessive resources. In AWS WAF, you can create web access control lists (ACLs) that you can set with managed or custom rules. There are five possible actions you can define to take when the rules are triggered: Allow, Count, Block, CAPTCHA, or Challenge. The Challenge action, which we focus on in this post, is useful for detecting requests from automated tools without affecting the user experience.

Why is it important to mitigate bot traffic?

In cybersecurity, we typically use the term bot to describe a range of tools that allow the automation or simulation of HTTP requests. These bots can be legitimate (such as search engine crawlers that index your app or site) or malicious (tools that are used to automate unwanted requests), but both types have the potential to impact your app availability and performance. By properly handling bot traffic, you can reduce this impact, which can help you optimize costs and improve the stability of your infrastructure and the availability of your business.

Before starting

If you’ve never used AWS WAF before, we recommend that you read Getting started with AWS WAF to learn the basics of how to set up this service.

How does the Challenge action work, and what are the benefits?

When a request matches your rule that contains a Challenge action, the HTTP client is presented with a challenge, which most web browsers or non-automated clients are able to process. After solving that challenge, the client receives a token that will be included in subsequent requests—that’s how AWS WAF considers the request to be non-automated and permits access. Using a Challenge action adds a protection layer because bots and other automated tools typically can’t process the challenge as a legitimate web browser would.

A more effective mechanism against bots is to present a CAPTCHA action, in which the user must solve a puzzle. However, this action affects the user experience because it requires human interaction, and it typically involves higher costs than the Challenge option. Challenge actions, which consist of a JavaScript function that most web browsers can support and process in the background, are a great first step to monitor web requests because they don’t affect the user experience directly and are more economic than CAPTCHA.

Implementation options

In this blog post, we discuss two options for you to start handling the traffic from bots. Although the focus of this post is implementing the Challenge action through a custom rule (a rule you can create and set yourself), we’ve also included basic instructions for implementing the Challenge action through Bot Control, which allows you to directly use client application integration for more sophisticated detections.

Option 1: Implementing the Challenge action through a custom rule

The first step in setting up a custom rule with the Challenge option is to understand and define clearly what the expected normal behaviors are from users who access your app. Specifically, you need to know the expected number of requests in a given period of time from a single IP and the maximum time length of a typical session.

How do I define the normal rate of requests?

Both the maximum session length and the rate of requests expected will vary depending on each webpage or app, and this information needs to come from the business and application teams. When a user browses a page, they might trigger several requests (for example, the user will trigger a separate request for each image the page contains). You can use this information to estimate and define how many requests per IP a valid user can generate in a given time.

Additionally, you can enable web ACL logging, which will allow you to query logs from Amazon CloudWatch Logs Insights. From these logs, you can get an understanding of the current behaviors and trends in your web traffic and compare that with the expected behavior that you defined.

What parameters should I use to trigger the challenge?

  • Implementing challenges based on the headers in the request or the user-agent isn’t a good idea. Although you can act based on either of these fields for valid crawlers like those used by search engines, malicious bots might evolve and tamper with these fields as their creators notice they are being stopped.
  • Filtering by static IP won’t always work. Only valid crawlers tend to use the same IP range over time and malicious bots often change IP ranges.
  • Filtering by path might be a good option. If there are parts of your app that shouldn’t be indexed or crawled, you can declare that in your robots.txt file. Bots that disregard these directives can be considered suspicious, and you can present them with the challenge. However, this approach isn’t always good enough: A bot might be set to respect the directives.
  • A rate-limit rule is an effective option for triggering your challenge when you’re attempting to handle malicious bots. You can define the normal rate of requests that you expect valid users to make as described earlier in this section. Users that go over that rate will be presented with the challenge. You should set this rule as the top priority in order for it to be more efficient.

To create and set the rate-limit rule

  1. Open the AWS WAF & Shield console, choose Web ACLs, and then choose the web ACL to which you will add the rule.

    Figure 1: AWS WAF web ACLs

    Figure 1: AWS WAF web ACLs

  2. On the Web ACL page, choose the Rules tab.
  3. In the Add rules drop-down list, choose Add my own rules and rule groups. If you already have your rate-based custom rule in place, select the checkbox to the left of the rule, and then choose Edit.

    Figure 2: Add your own rules and rule groups

    Figure 2: Add your own rules and rule groups

  4. For Rule type, choose Rule builder. For Rule, enter a name for your rule. For Type, choose Rate-based rule.

    Figure 3: Start the rule builder

    Figure 3: Start the rule builder

  5. Under Rate-limiting criteria, set the rate limit and define the evaluation window, which is customizable.
  6. For Request aggregation, choose Source IP address. For Scope of inspection and rate limiting, choose Consider all requests.

    Figure 4: Set the rate-limiting criteria

    Figure 4: Set the rate-limiting criteria

  7. For Action, choose Challenge.
  8. For Immunity time (which specifies how long a Challenge token is valid before a new one is needed), choose a value according to the maximum time a normal session could last.

    When you set a challenge through custom rules and the token expires, subsequent requests will include an invalid cookie and will therefore be rejected until a new session is started. For example, if a normal session’s maximum duration is 5 minutes, you can leave immunity set to the default, but if the maximum duration can be longer (as in an online shop), then you will need to increase the immunity time according to your use case. (Note that SDK application integration, which we cover in the next section, takes care of presenting a new token if the current one expires, without impacting human users.)

    Figure 5: Set the action to Challenge

    Figure 5: Set the action to Challenge

  9. Choose Add rule.
  10. Set the rule priority by selecting the rule and moving it up in the list. Note that we’re considering a scenario where you set a web ACL for a single account. In this case, remember to place the rate-limiting rule at the top of the list, so that you prevent undesired traffic from triggering additional rules. This is even more important if you have paid rules later in the list.

    Figure 6: Set the rule priority

    Figure 6: Set the rule priority

Option 2: Implementing the Challenge action by using Bot Control

Implementing Challenge actions through the Bot Control feature in AWS WAF is an easier, more robust and flexible solution than using a custom rule. However, it has extra costs associated that you should be aware of and evaluate.

Bot Control is a managed rules group that provides improved visibility and automated detection and mitigation mechanisms for bots. You are charged differently depending on the tier of Bot Control you use (Common or Targeted). The Common tier detects a variety of self-identifying bots by using static request data analysis. The Targeted tier adds active analysis of client blueprints and behavior as well as machine learning, and is capable of detection and mitigation of more sophisticated agents. You can read more about the Bot Control protection levels in the documentation.

Some of the main features of Bot Control include the following:

An in-depth explanation of how to use Bot Control is beyond the scope of this post, but we provide instructions on how to enable it here. For further recommendations, see the AWS WAF Bot Control main page and the topics in the AWS WAF Developer Guide.

To enable Bot Control and configure the rule

  1. Open the WAF & Shield console, choose Web ACLs, and choose the web ACL you want Bot Control enabled on.
  2. On the Rules tab, in the Add rules drop-down list, instead of adding your own rules, choose Add managed rule groups.

    Figure 7: Add managed rule groups to your web ACL

    Figure 7: Add managed rule groups to your web ACL

  3. On the Add managed rule groups page, expand the first option, AWS managed rule groups, and scroll down to find Bot Control. Then select the Add to web ACL toggle button to enable Bot Control.

    Figure 8: Enable the Bot Control rule group

    Figure 8: Enable the Bot Control rule group

  4. You will need to customize the configuration. To do so, choose Edit.
  5. First, choose the level of inspection you want to use. Common detects a variety of self-identifying bots, but, in this example, we chose Targeted because it adds advanced detection for sophisticated bots by using machine learning and allows the challenge application integration that we mentioned earlier.
  6. Choose the scope of inspection. You can keep the scope set to Inspect all web requests or choose to use scope-down statements if you want a more granular filtering.
  7. Choose the action on a per-bot category basis or choose a single action for all the categories. In this example, we used the same settings for the Challenge action for all the categories.

    Figure 9: Set Bot Control actions

    Figure 9: Set Bot Control actions

  8. Similar to the recommendations for Option 1 earlier in this post, we recommend that you define your use cases and how you want to handle each bot category in the Common section and each rule in the Targeted The settings need to be aligned with your business needs, with the understanding that your needs can change over time. The settings you choose might also be specific to each application—for example, in the case of search engine bots, you need to consider the impact of blocking or mitigating them on your search engine optimization (SEO) and find a balance with app performance.

    Figure 10: Targeted rules

    Figure 10: Targeted rules

  9. Choose Save rule and then choose Add rules.
  10. On the Set rule priority page, set the rule priority by selecting the rule and moving it up or down in the list. Make sure you set the Bot Control managed rule group (AWS-AWSManagedRulesBotControlRuleSet) to be lower in priority than the free rules (both custom and managed). Because Bot Control rules pricing is based on the number of requests processed and the number of CAPTCHA or Challenge actions presented, putting Bot Control rules at the bottom of the list helps you to optimize your costs.
  11. You can now integrate the challenge into your application by using the SDK. For more information, see AWS WAF client application integration.

Next steps

As your cloud infrastructure grows, you need to start managing your protection at scale and centrally. AWS Firewall Manager provides you with a single place to centrally configure, manage, and monitor your AWS WAF firewall, AWS Shield Advanced protections, Amazon Virtual Private Cloud (Amazon VPC) security groups, VPC network ACLs, AWS Network Firewall instances, and Amazon Route 53 Resolver DNS Firewall rules across multiple AWS accounts and resources.

For more information, see the Security Blog posts Centrally manage AWS WAF and AWS Managed Rules at scale with Firewall Manager and How to enforce a security baseline for an AWS WAF ACL across your organization using AWS Firewall Manager.

Conclusion

In this post, we reviewed how you can mitigate bot traffic by implementing Challenge actions. By implementing this action type through a custom rule, you can set up basic, cost-effective measures to handle basic bots and control automated traffic to your applications. As your business grows, you can achieve higher efficiency and better protection against more sophisticated bots by enabling Bot Control rules, which use machine learning for advanced detection. To learn more about these topics, see the following links.

Recommended reading

If you have feedback about this post, submit comments in the Comments section below. If you have questions about this post, contact AWS Support.

Javier Sanchez Navarro
Javier Sanchez Navarro

Javier is a Technical Account Manager at AWS, based in Argentina. He is passionate about cybersecurity, the game industry, and knowledge sharing. In his current role, he supports customers’ business success by helping them operate their workloads efficiently in the cloud.

[$] Kernel optimization with BOLT

Post Syndicated from jake original https://lwn.net/Articles/993828/

A pair of talks in the toolchains
track
at the 2024 Linux
Plumbers Conference
covered different tools that can be used to
optimize the kernel. First up was Maksim Panchenko to describe the binary
optimization and layout tool
(BOLT) that Meta uses on its production
kernels. It optimizes the kernel binary by rearranging it to improve its
code locality for
better performance. A subsequent article will cover the second talk, which
looked at automatic
feedback-directed optimization
(AutoFDO) and other related techniques
that are used to optimize Google’s kernels.

Metasploit Weekly Wrap-Up 10/25/2024

Post Syndicated from Brendan Watters original https://blog.rapid7.com/2024/10/25/metasploit-weekly-wrap-up-10-25-2024/

Hackers and Vampires Agree: Every Byte Counts

Metasploit Weekly Wrap-Up 10/25/2024

Headlining the release today is a new exploit module by jheysel-r7 that chains two vulnerabilities to target Magento/Adobe Commerce systems: the first, CVE-2024-34102 is an arbitrary file read used to determine the version and layout of the glibc library, and the second, CVE-2024-2961 is a single-byte buffer overflow, and it is impressive what can be done with a single byte. By creating an intricate heap layout though specific memory allocation calls in php, an attacker can groom the heap contents in such a way that they can use the single-byte overflow to change a flag in the custom_heap structure, which then results in a system call containing arbitrary data.

New module content (1)

CosmicSting: Magento Arbitrary File Read (CVE-2024-34102) + PHP Buffer Overflow in the iconv() function of glibc (CVE-2024-2961)

Authors: Charles Fol, Heyder, Sergey Temnikov, and jheysel-r7
Type: Exploit
Pull request: #19544 contributed by jheysel-r7
Path: linux/http/magento_xxe_to_glibc_buf_overflow
AttackerKB reference: CVE-2024-34102

Description: Adds a new module exploit/linux/http/magento_xxe_to_glibc_buf_overflow which uses a combination of an Arbitrary File Read (CVE-2024-34102) and a Buffer Overflow in glibc (CVE-2024-2961) to gain unauthenticated Remote Code Execution on multiple versions of Magento and Adobe Commerce, including versions less than 2.4.6-p5.

Enhancements and features (2)

  • #19536 from GhostlyBox – Updated the post/windows/gather/enum_unattend.rb module to now include checks for ‘.vmimport’ files which may have been created by the AWS EC2 VMIE service which will contain cleartext credentials.
  • #19567 from bcoles – Adds default vendor passwords for common single-board computers (SBCs) to wordlists.

Bugs fixed (4)

  • #19571 from sjanusz-r7 – Fixes an issue that stopped users from using navigational arrow keys in msfconsole on newer Windows 11 installs.
  • #19572 from cdelafuente-r7 – Fixes an issue in the UPDATE action of admin/ldap/ad_cs_cert_template.
  • #19576 from adfoster-r7 – Fixes crash when importing a Metasploit xml file with Ruby 3.2 and above.
  • #19577 from adfoster-r7 – Fixes a crash when running the shell command with a Meterpreter session.

Documentation

You can find the latest Metasploit documentation on our docsite at docs.metasploit.com.

Get it

As always, you can update to the latest Metasploit Framework with msfupdate
and you can get more details on the changes since the last blog post from
GitHub:

If you are a git user, you can clone the Metasploit Framework repo (master branch) for the latest.
To install fresh without using git, you can use the open-source-only Nightly Installers or the
commercial edition Metasploit Pro

Analyze Amazon EMR on Amazon EC2 cluster usage with Amazon Athena and Amazon QuickSight

Post Syndicated from Boon Lee Eu original https://aws.amazon.com/blogs/big-data/analyze-amazon-emr-on-amazon-ec2-cluster-usage-with-amazon-athena-and-amazon-quicksight/

Gaining granular visibility into application-level costs on Amazon EMR on Amazon Elastic Compute Cloud (Amazon EC2) clusters presents an opportunity for customers looking for ways to further optimize resource utilization and implement fair cost allocation and chargeback models. By breaking down the usage of individual applications running in your EMR cluster, you can unlock several benefits:

  • Informed workload management – Application-level cost insights empower organizations to prioritize and schedule workloads effectively. Resource allocation decisions can be made with a better understanding of cost implications, potentially improving overall cluster performance and cost-efficiency.
  • Cost optimization – With granular cost attribution, organizations can identify cost-saving opportunities for individual applications. They can right-size underutilized resources or prioritize optimization efforts for applications that are driving high usage and costs.
  • Transparent billing – In multi-tenant environments, organizations can implement fair and transparent cost allocation models based on individual application resource consumption and associated costs. This fosters accountability and enables accurate chargebacks to tenants.

In this post, we guide you through deploying a comprehensive solution in your Amazon Web Services (AWS) environment to analyze Amazon EMR on EC2 cluster usage. By using this solution, you will gain a deep understanding of resource consumption and associated costs of individual applications running on your EMR cluster. This will help you optimize costs, implement fair billing practices, and make informed decisions about workload management, ultimately enhancing the overall efficiency and cost-effectiveness of your Amazon EMR environment. This solution has been only tested on Spark workloads running on EMR on EC2 that uses YARN as its resource manager. It hasn’t been tested on workloads from other frameworks that run on YARN, such as HIVE or TEZ.

Solution overview

The solution works by running a Python script on the EMR cluster’s primary node to collect metrics from the YARN resource manager and correlate them with cost usage details from the AWS Cost and Usage Reports (AWS CUR). The script activated by a cronjob makes HTTP requests to the YARN resource manager to collect two types of metrics from paths /ws/v1/cluster/metrics for cluster metrics and /ws/v1/cluster/apps for application metrics. The cluster metrics contain utilization information of cluster resources, and the application metrics contain utilization information of an application or job. These metrics are stored in an Amazon Simple Storage Service (Amazon S3) bucket.

There are two YARN metrics that capture the resource utilization information of an application or job.

  • memorySeconds – This is the memory (in MB) allocated to an application times the number of seconds the application ran
  • vcoreSeconds – This is the number of YARN vcores allocated to an application times the number of seconds application ran

The solution uses memorySeconds to derive the cost of running the application or job. It can be modified to use vcoreSeconds instead if necessary.

The metadata of the YARN metrics collected in Amazon S3 is created, stored, and represented as database and tables in AWS Glue Data Catalog, which is in turn available to Amazon Athena for further processing. You can now write SQL queries in Athena to correlate the YARN metrics with the cost usage information from AWS CUR to derive the detailed cost breakdown of your EMR cluster by infrastructure and application. This solution creates two corresponding Athena views of the respective cost breakdown that will become the data source to Amazon QuickSight for visualization.

The following diagram shows the solution architecture.

EMR Cluster Usage Utility Solution Architecture

Prerequisites

To perform the solution, you need the following prerequisites:

  1. Confirm that a CUR is created in your AWS account. It needs an S3 bucket to store the report files. Follow the steps described in Creating Cost and Usage Reports to create the CUR on the AWS Management Console. When creating the report, make sure the following settings are enabled:
    • Include resource IDs
    • Time granularity is set to hourly
    • Report data integration to Athena

It can take up to 24 hours for AWS to start delivering reports to your S3 bucket. Thereafter, your CUR gets updated at least one time a day.

  1. The solution needs Athena to run queries against the data from the CUR using standard SQL. To automate and streamline the integration of Athena with CUR, AWS provides an AWS CloudFormation template, crawler-cfn.yml, which is automatically generated in the same S3 bucket during CUR creation. Follow the instructions in Setting up Athena using AWS CloudFormation templates to integrate Athena with the CUR. This template will create an AWS Glue database that references to the CUR, an AWS Lambda event and an AWS Glue crawler that gets invoked by S3 event notification to update the AWS Glue database whenever the CUR gets updated.
  2. Make sure to activate the AWS generated cost allocation tag, aws:elasticmapreduce:job-flow-id. This enables the field, resource_tags_aws_elasticmapreduce_job_flow_id, in the CUR to be populated with the EMR cluster ID and is used by the SQL queries in the solution. To activate the cost allocation tag from the management console, follow these steps:
    • Sign in to the payer account’s AWS Management Console and open the AWS Billing and Cost Management console
    • In the navigation pane, choose Cost Allocation Tags
    • Under AWS generated cost allocation tags, choose the aws:elasticmapreduce:job-flow-id tag
    • Choose Activate. It can take up to 24 hours for tags to activate.

The following screenshot shows an example of the aws:elasticmapreduce:job-flow-id tag being activated.

CostAllocationTag

You can now test out this solution on an EMR cluster in a lab environment. If you’re not already familiar with EMR, follow the detailed instructions provided in Tutorial: Getting started with Amazon EMR to launch a new EMR cluster and run a sample Spark job.

Deploying the solution

To deploy the solution, follow the steps in the next sections.

Installing scripts to the EMR cluster

Download two scripts from the GitHub repository and save them into an S3 bucket:

  • emr_usage_report.py – Python script that makes the HTTP requests to YARN Resource Manager
  • emr_install_report.sh  – Bash script that creates a cronjob to run the python script every minute

To install the scripts, add a step to the EMR cluster through the console or AWS Command Line Interface (AWS CLI) using aws emr add-step command.

Replace:

  • REGION with the AWS Regions where the cluster is running (for example, Europe (Ireland) eu-west-1)
  • MY-BUCKET with the name of the bucket where the script is stored (for example, my.artifact.bucket)
  • MY_REPORT_BUCKET with the bucket name where you want to collect YARN metrics (for example, my.report.bucket)
aws emr add-steps \
--cluster-id j-XXXXXXXXXXXXX \
--steps Type=CUSTOM_JAR,Name="Install YARN reporter",Jar=s3://REGION.elasticmapreduce/libs/script-runner/script-runner.jar,Args=[s3://<MY-BUCKET>/emr-install_reporter.sh,s3://<MY-BUCKET>/emr_usage_reporter.py,MY_REPORT_BUCKET]

You can now run some Spark jobs on your EMR cluster to start generating application usage metrics.

Launching the CloudFormation stack

When the prerequisites are met and you have the scripts deployed so that your EMR clusters are sending YARN metrics to an S3 bucket, the rest of the solution can be deployed using CloudFormation.

Before launching the stack, upload a copy of this QuickSight definition file into an S3 bucket required by the CloudFormation template to build the initial analysis in QuickSight. When ready, proceed to launch your stack to provision the remaining resources of the solution.

  1. Choose

This automatically launches AWS CloudFormation in your AWS account with a template. It prompts you to sign in as needed and make sure you create the stack in your intended Region.

The CloudFormation stack requires a few parameters, as shown in the following screenshot.

CloudFormationStack

The following table describes the parameters.

Parameter Description
Stack name A meaningful name for the stack; for example, EMRUsageReport
S3 configuration
YARNS3BucketName Name of S3 bucket where YARN metrics are stored
Cost Usage Report configuration
CURDatabaseName Name of Cost Usage Report database in AWS Glue
CURTableName Name of Cost Usage Report table in AWS Glue
AWS Glue Database configuration
EMRUsageDBName Name of AWS Glue database to be created for the EMR Cost Usage Report
EMRInfraTableName Name of AWS Glue table to be created for infrastructure usage metrics
EMRAppTableName Name of AWS Glue table to be created for application usage metrics
QuickSight configuration
QSUserName Name of QuickSight user in default namespace to manage the EMR Usage Report resources in QuickSight.
QSDefinitionsFile S3 URI of the definition JSON file for the EMR Usage Report.
  1. Enter the parameter values from the preceding table.
  2. Choose Next.
  3. On the next screen, enter any necessary tags, an AWS Identity and Access Management (IAM) role, stack failure, or advanced options if necessary. Otherwise, you can leave them as default.
  4. Choose Next.
  5. Review the details on the final screen and select the check boxes confirming AWS CloudFormation might create IAM resources with custom names or require CAPABILITY_AUTO_EXPAND.
    CloudFormationCheckbox
  6. Choose Create.

The stack will take a couple of minutes to create the remaining resources for the solution. After the CloudFormation stack is created, on the Outputs tab, you can find the details of the resources created.

Reviewing the correlation results

The CloudFormation template creates two Athena views containing the correlated cost breakdown details of the YARN cluster and application metrics with the CUR. The CUR aggregates cost hourly and therefore correlation to derive the cost of running an application is prorated based on the hourly running cost of the EMR cluster.

The following screenshot shows the Athena view for the correlated cost breakdown details of YARN cluster metrics.

CorrelationResults

The following table describes the fields in the Athena view for YARN cluster metrics.

Field Type Description
cluster_id string ID of the cluster.
family string Resource type of the cluster. Possible values are compute instance, elastic map reduce instance, storage and data transfer.
billing_start timestamp Start billing hour of the resource.
usage_type string A specific type or unit of the resource such as BoxUsage:m5.xlarge of compute instance.
cost string Cost associated with the resource.

The following screenshot shows the Athena view for the correlated cost breakdown details of YARN application metrics.

CostBreakdownYARNAppMetrics

The following table describes the fields in the Athena view for YARN application metrics.

Field Type Description
cluster_id string ID of the cluster
id string Unique identifier of the application run
user string User name
name string Name of the application
queue string Queue name from YARN resource manager
finalstatus string Final status of application
applicationtype string Type of the application
startedtime timestamp Start time of the application
finishedtime timestamp End time of the application
elapsed_sec double Time taken to run the application
memoryseconds bigint The memory (in MB) allocated to an application times the number of seconds the application ran
vcoreseconds int The number of YARN vcores allocated to an application times the number of seconds application ran
total_memory_mb_avg double Total amount of memory (in MB) available to the cluster in the hour
memory_sec_cost double Derived unit cost of memoryseconds
application_cost double Derived cost associated with the application based on memoryseconds
total_cost double Total cost of resources associated with the cluster for the hour

Building your own visualization

In QuickSight, the CloudFormation template creates two datasets that reference Athena views as data sources and a sample analysis. The sample analysis has two sheets, EMR Infra Spend and EMR App Spend. They have a prepopulated bar chart and pivot tables to demonstrate how you can use the datasets to build your own visualization to present the cost breakdown details of your EMR clusters.

EMR Infra Spend sheet references to the YARN cluster metrics dataset. There is a filter for date range selection and a filter for cluster ID selection. The sample bar chart shows the consolidated cost breakdown of the resources for each cluster during the period. The pivot table breaks them down further to show their daily expenditure.

The following screenshot shows the EMR Infra Spend sheet from sample analysis created by the CloudFormation template.

EMR App Spend sheet references to the YARN application metrics. There is a filter for date range selection and a filter for cluster ID selection. The pivot table in this sheet shows how you can use the fields in the dataset to present the cost breakdown details of the cluster by users to observe the applications that were run, whether they were completed successfully or not, the time and duration of each run, and the derived cost of the run.

The following screenshot shows the EMR App Spend sheet from sample analysis created by the CloudFormation template.

Cleanup

If you no longer need the resources you created during this walkthrough, delete them to prevent incurring additional charges. To clean up your resources, complete the following steps:

  1. On the CloudFormation console, delete the stack that you created using the template
  2. Terminate the EMR cluster
  3. Empty or delete the S3 bucket used for YARN metrics

Conclusion

In this post, we discussed how to implement a comprehensive cluster usage reporting solution that provides granular visibility into the resource consumption and associated costs of individual applications running on your Amazon EMR on EC2 cluster. By using the power of Athena and QuickSight to correlate YARN metrics with cost usage details from your Cost and Usage Report, this solution empowers organizations to make informed decisions. With these insights, you can optimize resource allocation, implement fair and transparent billing models based on actual application usage, and ultimately achieve greater cost-efficiency in your EMR environments. This solution will help you unlock the full potential of your EMR cluster, driving continuous improvement in your data processing and analytics workflows while maximizing return on investment.


About the authors

Boon Lee Eu is a Senior Technical Account Manager at Amazon Web Services (AWS). He works closely and proactively with Enterprise Support customers to provide advocacy and strategic technical guidance to help plan and achieve operational excellence in AWS environment based on best practices. Based in Singapore, Boon Lee has over 20 years of experience in IT & Telecom industries.

Kyara Labrador is a Sr. Analytics Specialist Solutions Architect at Amazon Web Services (AWS) Philippines, specializing in big data and analytics. She helps customers in designing and implementing scalable, secure, and cost-effective data solutions, as well as migrating and modernizing their big data and analytics workloads to AWS. She is passionate about empowering organizations to unlock the full potential of their data.

Vikas Omer is the Head of Data & AI Solution Architecture for ASEAN at Amazon Web Services (AWS). With over 15 years of experience in the data and AI space, he is a seasoned leader who leverages his expertise to drive innovation and expansion in the region. Vikas is passionate about helping customers and partners succeed in their digital transformation journeys, focusing on cloud-based solutions and emerging technologies.

Lorenzo Ripani is a Big Data Solution Architect at AWS. He is passionate about distributed systems, open source technologies and security. He spends most of his time working with customers around the world to design, evaluate and optimize scalable and secure data pipelines with Amazon EMR.

The collective thoughts of the interwebz