Thoughts on arbitrary scripts

Hey,
Just wanna share something I was thinking about today.

We do have one well known instance of a use case that requires that the user passes an arbitrary script that will be run in a worker, which is the signing servcies. And because we know that’s very dangerous, we gate-keep it as an admin-only operation, not available at all via API.

But I feel like there are some desire for passing scripts in some places. For instance, we just learned that pulp_workflow allows that via API, and we’ve heard people wanting to have custom “linting” of packages, or things like that.

What if we allow passing a signing script via API (for singing, for example), but then require that it’s signed by the admin? The admin register it’s public key via a management command in Pulp, and it’s used to verify that a script got the blessing of the admin. I guess that reduces the attack surface, while removing the incovenience of having to ssh into the system. Of course, it introduces another point of friction, which is that there must be some manual interaction to approve the script, but that’s the trade-off security, right? The difference, as far as I understand, is that it is particularly impractical to execute these manual system interventions in an environments like k8s.

Anyway, just some thoughts.

We could also go the other way around and just get rid of custom scripts!
Implement something like a remote service protocol, a service definition that the worker can use to talk to, exchange files, messages, etc. And then people just have to implement their services behind this API contract.