Commit Graph
7588 Commits
Author SHA1 Message Date
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
Kohsuke Kawaguchi e37597a81d Unzipping a local zip into a remote directory results in the file getting read from remote.
This change flips the order so that the read happens locally, and pipe gets forwarded to the other side.
2014-10-15 19:51:49 -07:00
Jesse Glick adc218825d FilePath.read should rethrow any FileNotFoundException, SecurityException, etc. 2014-10-15 16:36:12 -04:00
Jesse Glick 698858fd92 Changes in remoting make wrapping IOException less necessary.
Still do it so we capture FilePath.remote (which many JRE methods suppress),
but fix the wrapper Throwable.message to include cause.toString() according to convention.
2014-10-15 16:12:10 -04:00
Kohsuke Kawaguchi be195b0e19 [FIXED SECURITY-150]
Integrated the change
2014-10-01 08:21:06 -07:00
Kohsuke Kawaguchi 28d997704f [FIXED SECURITY-159]
Bumping up dependencies to 1.3.1, with extra precaution to make
DiskFileItem non-serializable
2014-09-27 15:51:47 -07:00
Jesse Glick 695a66f196 1af88e8b7f incorrectly disabled all logging.
When we are allowing all callables through, we want to enable remote class loading
(just in case someone is using it legitimately), but continue logging callable issues.
Currently there is no remoting flag to allow remote class loading while logging it.
2014-09-25 09:25:15 -04:00
Kohsuke Kawaguchi 40c4a2f356 Got rid of the unused constants 2014-09-24 19:04:24 -07:00
Kohsuke Kawaguchi 4f733244e6 Moving MasterToSlaveFileCallable/SlaveToMasterFileCallable to the top level classes.
If we ever decide to develop a compatibility thunk library for these changes to help promote deployment in plugins,
then these classes being a nested type is problematic as they'll fail to load under onld Jenkins
2014-09-24 19:04:24 -07:00
Kohsuke Kawaguchi 1af88e8b7f Disable classloading from slaves and other VMs connected to the master 2014-09-24 19:04:24 -07:00
Kohsuke Kawaguchi c3a2069603 Added a 'ChannelConfigurator' extension point
... to intercept new Channel creation, which provides the opportunity to set up the new channel.
2014-09-24 19:04:24 -07:00
Jesse Glick c5bda70bee Reverting e47dc1d555.
The result of a misunderstanding.
BYPASS_LOG can be deleted by the time we release, and for its temporary purpose, runtime modification is not necessary.
2014-09-24 15:51:49 -04:00
Kohsuke Kawaguchi e47dc1d555 I'm begging Jesse to keep those properties modifiable at runtime!
It would just provide so much flexibility that would come in handy for operators.

  - One can control this feature from $JENKINS_HOME/groovy.init.d/*.groovy. When these are managed by Chef/puppet,
    this make it very clean to apply this as a patch.
  - The log file is getting too big and wants to rotate? No problem with quick groovy script from the console
    (or from CLI if you need to do the same with 12 masters)
  - Shipping the log over to network instead of local file? No problem!

I thought your primary concern of field being unreachable from outside is already addressed via @Restricted(NoExternalUse).
2014-09-24 10:51:21 -07:00
Kohsuke Kawaguchi 71fe6e6650 Signature update complete for RoleChecker change 2014-09-24 09:51:31 -07:00
Kohsuke Kawaguchi 201b035cfc Updated to reflect the signature change around role checking in remoting 2014-09-24 09:43:31 -07:00
Jesse Glick f343595b43 Make sure new APIs are marked with @since. 2014-09-24 08:38:19 -04:00
Jesse Glick 42b2f22c25 Utility class, no constructor. 2014-09-24 08:36:20 -04:00
Jesse Glick c1116a765e CallableDecorator is newly added, so belongs in the package for new classes. 2014-09-24 08:14:43 -04:00
Jesse Glick e640fd4dbc BYPASS_LOG is meant to _replace_ all logging, and log what _would have been_ violations.
(It supersedes other bypass properties.)
2014-09-24 07:51:31 -04:00
Jesse Glick 9a5e8e975d BYPASS_LOG is only needed for testing, not regular operation, so it need not be settable at runtime. 2014-09-24 07:48:30 -04:00
Kohsuke Kawaguchi 91c516200f Reimplemented the checker as RoleChecker 2014-09-23 19:12:43 -07:00
Kohsuke Kawaguchi ffb5b65093 Switched from annotation based scheme to a function based scheme. 2014-09-23 19:12:43 -07:00
Kohsuke Kawaguchi 59456c734a Defined three remoting roles in Jenkins.
(This requires 82211d10bfc7d066121ba80c8a6755d1dae97bf2 in remoting)
2014-09-23 19:03:49 -07:00
Kohsuke Kawaguchi 1295aa9180 I prefer strongly typed named variable for controlling feature flags.
It's faster, it's typed, and failing to use the correct name results in an error, so you know when the flag gets removed.
Making it more friendly for Groovy script.
2014-09-23 14:54:50 -07:00
Kohsuke Kawaguchi 140d929516 Fixed the computation of effective FilePathFilter.
If a @SlaveToMaster Callable gets sent to the master, and if inside its call() method the code directly/indirectly performs file system access (for example on files and directories that it didn't receive as parameters), that is not meant to be the subject of the filter check.

Rather, the check is meant for FilePath that the other side sends to us, when it points to a local file.

So it makes more sense to compute the effective FilePathFilter during the deserialization, as opposed to doing so when the actual operation is attempted.

Various FileCallable impls in FilePath fits this pattern, as it drags outer FilePath instance with itself. In addition, this change addresses other situations correctly, where FilePath is used as arguments and return values of other Callables, such as the following:

FilePath f = channel.call(new SlaveWillDoSomeComputationAndGiveMeTheResultAsFile());
f.copyTo(build.getRootDir().child("data.xml"))

"f.copyTo" happens in the context of Channel.current()==null, but we need to check that 'f' is legit and not something like
new FilePath(new File("/etc/shadow"))
2014-09-23 14:53:31 -07:00
Kohsuke Kawaguchi c0260056e5 in pre-cursor for the next change, make all remoting call go through FileCallable 2014-09-23 14:53:31 -07:00
Jesse Glick 2fe5b96f55 For testing purposes, adding dry-run system properties allowing potential violations to be written to log files. 2014-09-23 16:26:27 -04:00
Jesse Glick 47f61e55da Better toString(). 2014-09-23 15:56:45 -04:00
Jesse Glick 735ba83148 Installing a default FilePathFilter that rejects everything. 2014-09-22 12:54:05 -04:00
Jesse Glick 755f55cbdf installTo/uninstallFrom methods ought to be final. 2014-09-22 10:58:48 -04:00
Jesse Glick 1869eac536 No real reason to mention node name in exception. 2014-09-22 10:00:05 -04:00
Jesse Glick 308cf24227 Adding logging to CallableDirectionChecker.
Also clarified that this is impl, not API.
2014-09-22 09:25:07 -04:00
Jesse Glick 4fabe92368 One-letter typo caused massive test failures, obscuring any real problems. 2014-09-20 15:44:12 -04:00
Jesse Glick f7840f428f Enforcing callable checking by default, with system properties to selectively or globally disable. 2014-09-19 16:09:42 -04:00
Jesse Glick a42f7667e4 Rewriting method body to more legible flow. 2014-09-19 15:49:28 -04:00
Jesse Glick 1df5ed000d @since, warnings. 2014-09-19 15:45:10 -04:00
Jesse Glick b1084f8c38 Unnecessary override. 2014-09-19 15:44:15 -04:00
Jesse Glick c80741615b Revert "This is failing the animal sniffer test"
This reverts commit 3e15684f75.
Not necessary after getting 5e7b844b6.
2014-09-19 15:27:05 -04:00