4

I'm hoping there exists something like sudo for AppArmor, so I can run something in a context like:

aado -hat my-hat command arg arg arg

Does this exist?

wowest
  • 141
  • 3

2 Answers2

2

I think this can be done by creating hardlinks to e.g. /bin/bash. You then create a profile for /bin/bash-my-hat and start your command:

/bin/bash-my-hat -c command '$0' arg1 arg2
Hauke Laging
  • 5,285
  • 2
  • 24
  • 40
0

The aa-exec command can run a command with a specific named profile (or unconfined). For example:

aa-exec -p my-profile -- command arg arg arg
aa-exec -p unconfined -- command arg arg arg

kanaka
  • 291
  • 1
  • 6