Skip to content

Conversation

@EsadCetiner
Copy link
Member

@EsadCetiner EsadCetiner commented Jul 26, 2025

Adds some commands for AppArmor, bubblewrap, auditd, ping6, pip and capabilities commands.

I couldn't get the AppArmor commands to be blocked at PL-1 because it uses the ~ operator to detect permutations and that operator is broken with some rules. The Unix rules are hard to work with, evasion operators are defined inconsistently and all over the place, and there seems to be some overlapping rules too.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 26, 2025

📊 Quantitative test results for language: eng, year: 2023, size: 10K, paranoia level: 1:
🚀 Quantitative testing did not detect new false positives

@theseion
Copy link
Contributor

What do you mean by "broken"?

And yes. The RCE rules are a pain.

@EsadCetiner
Copy link
Member Author

@theseion

What do you mean by "broken"?

the ~ Suffix doesn't work at all for some rules, AppArmor commands are being blocked via aa-~ in unix-shell-upto3.ra. See test 932250-15

And yes. The RCE rules are a pain.

I'll open an issue on this so we can get some movement on this

@theseion
Copy link
Contributor

the ~ Suffix doesn't work at all for some rules, AppArmor commands are being blocked via aa-~ in unix-shell-upto3.ra. See test 932250-15

Can you give me an example? Apparently, aa-~ works as intended, doesn't it?

@EsadCetiner
Copy link
Member Author

@theseion

It doesn't, see the output below:

no_expect_ids: [932250]

aa-disable and friends aren't being blocked at all at PL-1 even though they should, it's not being excluded anywhere.

@EsadCetiner
Copy link
Member Author

@theseion I noticed the script in unix-shell-4andup.ra is referencing a non-existent shell script (spell.sh), I tried to replace it with the one integrated in crs-toolchain but I encountered some issues. See coreruleset/crs-toolchain#248

@theseion
Copy link
Contributor

theseion commented Aug 1, 2025

Thanks. Let me look at some stuff :)

@theseion
Copy link
Contributor

theseion commented Aug 1, 2025

932250 is written in such a way that the modifiers are ignored. It will only append an approximation of the @ modifier. In that sense, what you're seeing is expected behavior. I have to look into it a bit more though to see whether this is really what we want.

@EsadCetiner EsadCetiner added release:new-feature This PR introduces a new feature release:new-detection In this PR we introduce a new detection and removed release:new-feature This PR introduces a new feature labels Aug 4, 2025
@theseion
Copy link
Contributor

The issue with 932250 should be fixed with #4231.

Copy link
Contributor

@theseion theseion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume this is for plain pip, as opposed to pip3. Please add a test.

@EsadCetiner
Copy link
Member Author

@theseion Done

Is go-ftw not supposed to urlencode payloads? I assumed it always encoded payloads like curl does before it sent the request, it's harder to read the payloads in their encoded variant.

@theseion
Copy link
Contributor

@theseion Done

Is go-ftw not supposed to urlencode payloads? I assumed it always encoded payloads like curl does before it sent the request, it's harder to read the payloads in their encoded variant.

For URLs only. Data is sent verbatim.

EsadCetiner and others added 3 commits August 17, 2025 08:05
theseion
theseion previously approved these changes Aug 17, 2025
@EsadCetiner EsadCetiner requested a review from theseion August 20, 2025 06:25
@theseion theseion added this pull request to the merge queue Aug 21, 2025
Merged via the queue into coreruleset:main with commit da7b70a Aug 21, 2025
7 checks passed
@EsadCetiner EsadCetiner deleted the feat-update-unix-commands branch August 21, 2025 05:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:new-detection In this PR we introduce a new detection

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants