Commit Graph
7625 Commits
Author SHA1 Message Date
Kohsuke Kawaguchi 5db8cecae3 Added a AdminMonitor to to warn when this subsystem is disabled
... unless a few conditions indicate that it is likely irrelevant.
2014-10-18 18:51:25 -07:00
Kohsuke Kawaguchi e24ceef22a Disabling this subsystem by default.
As much as we'd like to enable this by default, what we've learned over
the past few days indicate that this is just too disruptive a change. In a nutshell,

 - The change is just too big. It touches more than 4000 lines just in the core and remoting,
   which makes this by far the biggest change we've done in secret. The chance of something
   going wrong is just too high. As recently as yesterday we are still finding significant
   problems with this subsystem.

 - We've learnt that Subversion 1.x contains Callables that we cannot just whitelist, but
   that version is used by roughly a third of users. If we put this on by default, they will
   see their builds break.

 - Every time we come up with a new way to scan plugins to find impacted code, we always
   find several plugins that are affected, indicating that we probably have missed more
   plugins that will be impacted.

 - We haven't really analyzed past versions of any plugins at all, but as the Subversion
   version distribution indicates, considerable portion of people run old plugins.

As we see in the Wiki page (http://jenkins-ci.org/security-144), vast majority of Jenkins
installations will fit in the category of "I have set up Jenkins master and all slaves by
myself", for whom this subsystem is entirely redundant.

Based on the knowledge we now have about the impact of this addition, and considering people
who benefit from this vs people who don't benefit from this, I'm not enabling this feature
out of the box, just yet.

Our plan is to advertise this feature, then get necesary plugin updates in place over time.
At some later point, we can make this feature on by default, which will only impact new
installations. Further down the road, we can inch up the warning given to people who run
without this feature, or remove the GUI configuration and force this feature on, to get
close to the ideal state of having everyone run with this feature on.

Jesse doesn't like this, but I think he understands where I'm coming from. Sorry Jesse,
this time I'm having this my way.
2014-10-18 18:20:09 -07:00
Kohsuke Kawaguchi 8a105ce57c Adding separate check for symlink to prevent jailbreak
Otherwise a symlink can be created to point to a file outside $JENKINS_HOME and be read
2014-10-17 19:03:55 -07:00
Kohsuke Kawaguchi ec1e47c053 Change the name because this directory is shared by all secrets 2014-10-17 18:55:05 -07:00
Kohsuke Kawaguchi 9342558ab1 Based on a discussion with Daniel Beck, implemented a master kill switch as an admin configurable feature.
The wiki page already talks about how an admin can do this: https://wiki.jenkins-ci.org/display/JENKINS/Slave+To+Master+Access+Control#SlaveToMasterAccessControl-Disabletheaccesscontrolmechanismaltogether

There's a risk in making this too easy, but we keep finding more plugins that need SECURITY-144 adjustments, and I'm really worried
about SECURITY-144 fix blowing up in the face of too many people.
2014-10-17 18:51:57 -07:00
Kohsuke Kawaguchi 7c9c5c73e8 Path related changes & Windows fix
- Added <JOBDIR> based on Daniel's comment
- Path macros need to be translated if on Windows
- Windows treat '/' as a valid path separator, so it needs to be normalized to '\\'.
2014-10-17 18:08:35 -07:00
Kohsuke Kawaguchi 37a3ddaaed Path has to be in Windows format on Windows 2014-10-17 16:07:41 -07:00
Kohsuke Kawaguchi ee16f8b63b Fixing another inconsistency.
Most other files are local, so 'gui.conf' better explains what they are.
2014-10-17 15:37:08 -07:00
Kohsuke Kawaguchi aec88b73b5 Fixing inconsistency.
Daniel Beck pointed out that if we ask people to create files not writable from Jenkins as a means to suppress edit to gui.conf,
then we should just stick to the same approach all the way.
2014-10-17 15:37:08 -07:00
Kohsuke Kawaguchi 050b0e7588 set a shorter ID to make URL bit nicer 2014-10-17 15:37:08 -07:00
Kohsuke Kawaguchi bc4d0e1824 Adding new line like elsewhere 2014-10-17 15:37:08 -07:00
Kohsuke Kawaguchi 6ff47b37f6 Need to guide the users to SECURITY-144 landing page 2014-10-17 15:37:08 -07:00
Jesse Glick e89da8d52d Also removing BYPASS_CALLABLES, which should have been superseded by richer admin UI. 2014-10-17 10:21:00 -04:00
Jesse Glick f327fc284a Removing BYPASS_LOG here as well. 2014-10-17 10:18:46 -04:00
Jesse Glick ba9525336b Presumably <JENKIN_HOME> was a typo. 2014-10-17 10:15:28 -04:00
Kohsuke Kawaguchi 19f9b63d74 [FIXED JENKINS-24046]
Warn users if the pinning is preventing Jenkins from overwriting older versions with bundled versions.
2014-10-16 18:18:25 -07:00
Kohsuke Kawaguchi 65e2a757f9 ConcurrentList cannot be sorted because iterator doesn't support set() 2014-10-16 17:09:30 -07:00
Kohsuke Kawaguchi bb3b68079c Should be only active when there's non-whitelisted Callable 2014-10-16 17:00:02 -07:00
Kohsuke Kawaguchi 6f622df761 Tweak the order of the extensions to make sure the bypass switch works 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi e5a1e82e11 Higer priority one should come first 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 8d1f9d56c0 Removed code that's marked as "delete before release" 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 5794c5d337 provide faster version that doesn't touch I/O 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi d4efe71219 Adding default callable whitelist 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 50a7ba09a1 End of iteration handling was buggy 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 6d6e19ebf2 if it's already whitelisted, don't bother listing it 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi d495f144bd redirect access to this monitor to the rule setting UI 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi e1a0935919 report a better error 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi b077d9e7b5 This isn't created via injection 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi fbf3b2658a Now loading upon the first use 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 5c4a3bbdde Added default rules 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 9300e7eb15 Support for conf.d pattern to help people deploy rules via configuration management tools 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 5a9b3b4ea5 Hooked up the rule configuration in the UI 2014-10-16 16:55:18 -07:00
Kohsuke Kawaguchi 187e246ab9 Added persistence logic for FilePathRules 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi f3283ca4cc Refactoring: code that handles I/O to a file is moved to a separate class 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi 07809fc12f Added a convenience method 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi 356764dced Moved the rules into a separate class 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi cb65dd65f3 Moving related code into a separate package and adding a scaffolding to do FilePathFilter 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi 7d5b098bf2 Promoting this common pattern into a convenience class 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi 21ead8532a Most ordinals will be zero, and it is undesirable for the order to be affected by the order of insertion, which is not necessarily predictable. 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi bbf0162610 doc improvement 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi ef848c67e1 Expose the ordinal control to FilePathFilter 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi b2deccb771 Now the order of FilePathFilter is significant, so we need to let the caller control that 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi c062e7b426 Final rejection is no longer a job of FilePathFilter 2014-10-16 16:55:17 -07:00
Kohsuke Kawaguchi c20308c3fa Making FilePathFilter itself more composable 2014-10-16 16:55:17 -07:00
Jesse Glick 11b240c361 Merge branch 'security' into SECURITY-144
Conflicts:
	core/src/main/java/hudson/slaves/Channels.java
	pom.xml
2014-10-16 12:27:45 -04:00
Kohsuke Kawaguchi 547cc241c0 untar() has the same problem as unzip() about the directionality of the read.
This code duplication in two sides of the if statement is undesirable.
Post-release, I need to come back here to introduce a variant of FileCallable that runs on the given FilePath but with InputStream to another FilePath.
2014-10-15 22:15:30 -07:00
Kohsuke Kawaguchi db5f184981 Preserve fidelity of the whitelist 2014-10-15 22:05:42 -07:00
Kohsuke Kawaguchi 1aebd6fd49 Implemented the basics of Callable whitelisting
Still has to extend this to cover FilePaths
2014-10-15 19:51:49 -07:00
Kohsuke Kawaguchi 36f32a7fb3 Navigate the user to the website where we can explain the details, mitigations, etc. 2014-10-15 19:51:49 -07:00
Kohsuke Kawaguchi 225935af5a Added the extension point to whitelist Callables 2014-10-15 19:51:49 -07:00