security-wg icon indicating copy to clipboard operation
security-wg copied to clipboard

Script execution control on Linux

Open l0kod opened this issue 1 year ago • 1 comments

This is a recap of yesterday's meeting (see #1382) about script execution control on Linux, and how it compares to #1364 (see https://github.com/nodejs/node/pull/54364). @RafaelGSS, @mhdawson, @rdw-msft, and I were attending.

LWN published an article about this new feature: Restricting execution of scripts — the third approach

I gave a talk last week that explains the goal, the challenges, and the current approach: Closing the script execution control gap

The changes required for Node.js would be:

  • To check all files containing code with execveat(2) + AT_CHECK
  • To restrict according to 2 complementary securebits: SECBIT_EXEC_RESTRICT_FILE and SECBIT_EXEC_DENY_INTERACTIVE

Here is a proof of concept for Python (using the original securebits): https://github.com/zooba/spython/pull/12

Latest kernel patch series: https://lore.kernel.org/all/[email protected]/

I'll update this issue with the next patches (which will include an enlighten toy script interpreter).

l0kod avatar Sep 27 '24 13:09 l0kod

@l0kod thanks for createing the issue and the links to additional info.

mhdawson avatar Oct 01 '24 14:10 mhdawson

This issue has been inactive for 90 days. It will be closed in 14 days unless there is further activity or the stale label is taken off.

github-actions[bot] avatar Dec 31 '24 00:12 github-actions[bot]

The kernel changes to support control of script execution has been merged (6 years after the first version) 🥳 https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=21266b8df5224c4f677acf9f353eecc9094731f0

It provides tests, examples, and documentation.

l0kod avatar Jan 23 '25 09:01 l0kod

This issue has been inactive for 90 days. It will be closed in 14 days unless there is further activity or the stale label is taken off.

github-actions[bot] avatar Apr 24 '25 00:04 github-actions[bot]

It looks like the never-stale label doesn't work...

l0kod avatar May 07 '25 10:05 l0kod

I think that maybe never stale will work

UlisesGascon avatar May 09 '25 13:05 UlisesGascon

This issue has been inactive for 90 days. It will be closed in 14 days unless there is further activity or the stale label is taken off.

github-actions[bot] avatar Aug 08 '25 00:08 github-actions[bot]