Jia Tanning Go code

Post Syndicated from arp242.net original https://www.arp242.net/jia-tan-go.html

The Go compiler skips files ending with _test.go during normal compilation.
They are compiled with go test command (together will all other .go files),
which also inserts some chutney to run the test functions. The standard way to
do testing is to have a foo.go and foo_test.go file next to each other.

If you have a file that appears to end with _test.go but doesn’t actually end
with _test.go, then it will get compiled for a regular build. For example:

a_test\uFE0E.go

U+FE0E is a variation selector. These are typically very invisible. Or more
traditional homoglyph trickery:

b_t\u0435\u0455t.go"

Those Cyrillic letters appear virtually identical on my machine: b_tеѕt.go /
b_test.go, or as monospace: b_tеѕt.go / b_test.go.

This can also be done with zero-width space, zero-width joiner, and perhaps a
few other codepoints, but variation selectors tend to be the “most invisible” of
them.

This is pretty sneaky, something like this:

// user.go
var bcryptCost = bcrypt.DefaultCost

func hashPassword(pwd []byte) []byte {
    pwd, _ := bcrypt.GenerateFromPassword(pwd, bcryptCost)
    return pwd
}
// user_test.go
func init() { // The special "init" function gets run on import.
    // Lower bcrypt cost in tests, because otherwise any test will take
    // well over a second as it's so slow.
    bcryptCost = bcrypt.MinCost
}

Is perfectly valid, but with a doctored “non-test” user_test.go it will now
lower the security of all passwords, and effectively inserts a backdoor.

There are many variants one can think of: code that looks innocent and would
probably pass many reviews, but will backdoor the codebase by weakening the
security, or adds in “test users”, “test keys”, “default passwords”, and things
like that.

Who is carefully auditing tests for security in the first place? I’ve audited a
bunch of packages over the years, but I’ve never paid much attention to the test
files.


Most tools don’t display this: Vim, VSCode, macOS finder, Windows Explorer,
/bin/ls, GitHub, GitLab, etc. – they all just display user_test.go with no
indication there’s something more there. Take a look at the test repo; all
seems fairly innocent. Arguably, that’s how it should be, at least for some of
these programs. Variation selectors are a Unicode feature and required to
display certain types of text. That said, filenames are not really “normal
text”, certainly not in the context of code.

The major exception is the git CLI with core.quotePath=true (the default),
which displays the byte sequences for anything that’s not ASCII. You need to
enable that setting to have any non-ASCII path display correctly, and
depending on locality it’s probably a somewhat common setting. And how many
people use the git CLI to review files (instead of GitHub web UI, VSCode
integration, etc?) I’m a pretty heavy git CLI user, but typically don’t use “git
diff” or “git log” for viewing differences between releases, and even if I did,
there’s a good chance I’d miss this in a “git diff”.

Another way to detect this is to carefully pay attention to the URL in e.g.
GitHub when viewing files, which displays escapes for some – but not all – of
the variants. But this isn’t displayed in the PR view, only when browsing files,
and is very easy to miss.


I reported this to GitHub, GitLab, and BitBucket back in June. None of them
considered this to be a security issue. I don’t really understand why, because
it doesn’t seem too dissimilar to LTR trickery to hide code. Also GitHub will
display a warning for PRs with this sort of trickery:

The head ref may contain hidden characters: "a\uFE0Eb"

Crafted branch names is an issue but crafted files are not? Well okay 🤷

Also emailed the [email protected], but they never got back to me, so I guess
they don’t consider it an issue either.

Is it viable to do a real-world attack with this? I don’t know, I haven’t tried.
I am not employed at the University of Minnesota so I don’t go around sending
malicious patches just to see what would happen.

But if I were tasked to Jia Tan a Go codebase, this seems a promising method.
There’s very little obfuscation and with a bit of careful design from a
malicious actor everything can seem legitimate test code that’s there for valid
reasons, being only malicious because it gets compiled in the regular program,
and because it still gets compiled in the test program the tests will still
work. Seems like a great way to hide malicious code in plain sight.

Doing a full Jia Tan and compromising ssh is still tricky, because that requires
doing the sort of stuff that typically has no business being in a test file.
That’s why in xz it was hidden in binary test data. Still, with the right
project and a bit of creativity I could envision this as a step in a similar
scheme, especially when done by the maintainer itself.

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

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.