
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
screwdriver-executor-base
Advanced tools
Base class defining the interface for executor implementations
Base class defining the interface for executor implementations
An executor is an engine that is capable of running a set of docker containers together.
i.e. Jenkins, Kubernetes, ECS, Mesos
The intention of an executor is to run the launch
script defined in the screwdriver job-tools docker container, which is mounted to a container defined by a screwdriver task
This means:
launch
script as the entry point to the task containerSD_TOKEN=${token} $MOUNT_POINT/launch --api-uri ${api_uri} ${build_id}
npm install screwdriver-executor-base
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.annotations | Object | Optional key/value object |
config.apiUri | String | Screwdriver's API |
config.buildId | String | The unique ID for a build |
config.container | String | Container for the build to run in |
config.token | String | Temporary JWT which Executor must exchange with API to get JWT which can act on behalf of the build |
The start function is expected to create a task in the execution engine.
A Promise that resolves if the task is created correctly, or rejects if it fails.
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.buildId | String | The unique ID for a build |
The stop function is expected to stop/cleanup a task in the execution engine.
A Promise that resolves if the task is cleaned up correctly, or rejects if it fails.
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.annotations | Object | Optional key/value object |
config.apiUri | String | Screwdriver's API |
config.buildId | String | The unique ID for a build |
config.container | String | Container for the build to run in |
config.token | String | Temporary JWT which Executor must exchange with API to get JWT which can act on behalf of the build |
The verify function is expected to check the pods health and status.
A Promise that resolves and returns the message for pod health error or success.
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.buildId | String | The unique ID for a build |
The status function is expected to get a human readable status of a task in the execution engine.
A Promise that resolves with the current build status, or rejects if it fails.
The stats
function is expected to return an object of statistics
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.token | String | Temporary JWT for a build |
buildTimeout | Number | Build timeout in minutes |
The exchangeTokenForBuild
function will call API to exchange temporary build JWT with actual build JWT.
A Promise which resolves to actual build JWT
The cleanUp function is expected to handle any housekeeping operations like closing connections, queues during the SIGTERM event. Default is no-op
A Promise that resolves or rejects.
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.annotations | Object | Optional key/value object |
config.buildStatus | String | The status of the build |
config.buildId | String | The unique ID for a build |
config.startTime | String | ISO start time of the build |
config.jobId | String | job id of the build |
The StartTimer function is expected to add buildId as key and timeout config value to timeout queue Default is no-op
A Promise that resolves or rejects.
Parameter | Type | Description |
---|---|---|
config | Object | Configuration Object |
config.buildId | String | The unique ID for a build |
The StopTimer function is expected to remove key/value buildId from timeout queue Default is no-op
A Promise that resolves or rejects.
To make use of the validation function for start and stop, you need to
override the _start
, _stop
and _cleanUp
methods.
class MyExecutor extends Executor {
// Implement the interface
_start(config) {
if (config.buildId) {
return this.exchangeTokenForBuild(config.token, buildTimeout).then(buildToken => {
// do stuff here...
return Promise.resolve(null);
});
}
return Promise.reject(new Error('Error starting executor'));
}
}
const executor = new MyExecutor({});
executor.start({
buildId: '4b8d9b530d2e5e297b4f470d5b0a6e1310d29c5e',
container: 'node:4',
apiUri: 'http://localhost:8080',
token: 'abcdefg'
}, (err) => {
// do something...
});
npm test
Code licensed under the BSD 3-Clause license. See LICENSE file for terms.
FAQs
Base class defining the interface for executor implementations
The npm package screwdriver-executor-base receives a total of 244 weekly downloads. As such, screwdriver-executor-base popularity was classified as not popular.
We found that screwdriver-executor-base demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.