Why we cannot use environment with settings? #3959
-
Ref: #3909 To reduce the amount of the same type of code, I use a simple plugin to deploy docker in swarm. That's why I need settings, secrets, and an environment. Can we enable this behavior in the settings? For example for the trusted plugins??? steps:
- name: deploy-to-staging
image: ${ORG_REGISTRY}/drone_plugins/docker_stack
pull: true
settings:
name: mailer
secrets:
- secret_key
environment:
API_IMAGE: ${ORG_REGISTRY}/${CI_REPO}:${CI_COMMIT_SHA:0:8} At the moment i force to use 2.6.0 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
Sorry for letting you waiting so long for an answer, but I'll try to explain it: Plugins can have access to special, possibly dangerous features without additional validations (some of them like What you can do now:
I hope this helps you. |
Beta Was this translation helpful? Give feedback.
-
OfftopicFirst off, from application design and spirit of plugins I agree, that environment and secrets should be removed from plugin syntax. Activity around both of the issues reminds me But some time is passed and we have a better understanding of the issues. So, what do we have today? Some issues are fixed/hacked, some aren't.
It is hard to understand without the examples, TBH. And details of the issues would be revealed ... when, BTW?
Do you have a statistic?
But let me go back to the examples. I started to write some in reply to xoxys. But almost all examples crash against
So, you can execute arbitrary code, right? What is this "dangerous" thing then?
How? If isolation doesn't work. Why? Because you run container in
So, GHSA-3wf2-2pq4-4rvc has high severity only in case when some privileged plugin can be executed. That is Also, that is why I proposed to remove all default privileged plugins in |
Beta Was this translation helpful? Give feedback.
-
I actually see a problem there I wasn't aware of that it's completely blocked to use env and settings… |
Beta Was this translation helpful? Give feedback.
-
This is possible again now. |
Beta Was this translation helpful? Give feedback.
Sorry for letting you waiting so long for an answer, but I'll try to explain it:
Plugins can have access to special, possibly dangerous features without additional validations (some of them like
docker-buildx
are set asprivilieged: true
by default). However, you can use environment variables to control the behaviour of the plugin and this could allow executing what you want, not what the plugin is built for. In the worst case, this can allow taking over the agent. Plugins should only be used with thesettings
because then the plugin authors can control what's configurable and therefore prevent dangerous options.What you can do now:
privileged:…