Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trusted environment switch #2809

Closed
wants to merge 2 commits into from
Closed

Trusted environment switch #2809

wants to merge 2 commits into from

Conversation

vyckou
Copy link

@vyckou vyckou commented Aug 30, 2019

No description provided.

This environment variable will allow to make repositories trusted, when enabling them in drone by default
It is recommended to use `DRONE_TRUSTED_ENVIRONMENT=true` only in scenarios, where you are running drone master and drone agents for single trusted organization
@bradrydzewski
Copy link

thanks! I will take a look and provide feedback.

tboerger
tboerger previously approved these changes Aug 31, 2019
@tboerger tboerger dismissed their stale review August 31, 2019 18:54

Got to revoke, need to properly review and think about it

@bradrydzewski
Copy link

bradrydzewski commented Sep 1, 2019

First of all, thanks for the pull request. I have been thinking of how we might want to implement this, and I am thinking we may want to implement this at the runner level [1]. We could set DRONE_RUNNER_TRUST_ALWAYS (for example) and the runner would always run the linter under the assumption that the repository is trusted.

+	trusted := m.Repo.Trusted || r.Trusted
+	err = linter.Lint(pipeline, trusted)
-	err = linter.Lint(pipeline, m.Repo.Trusted)
	if err != nil {
		logger = logger.WithError(err)
		logger.Warnln("runner: yaml lint errors")
		return r.handleError(ctx, m.Stage, err)
	}

The benefit to this approach is that we can globally trust (or distrust) all repositories without having to update the trusted flag in the database.

[1] https://github.com/drone/drone/blob/master/operator/runner/runner.go#L234

@vyckou
Copy link
Author

vyckou commented Sep 2, 2019

OK will change to this approach.

But @bradrydzewski, wouldn't it be a bit misleading? As in database you would have trusted / untrusted settings and then simply would ignore that setting on runner(s)

Also just popped the idea, that this type of flag would actually make the default setting of newly enabled repo as trusted and still would allow to set the repo(s) as untrusted

@vyckou vyckou closed this Sep 4, 2019
@vyckou vyckou deleted the trusted-environment-switch branch September 4, 2019 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants