Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
io.cucumber:ci-environment
Advanced tools
This library detects the CI environment based on environment variables defined by CI servers.
If a CI server is detected, a CiEnvironment
struct is returned:
{
"name": "...",
"url": "...",
"buildNumber": "...", // optional
"git": { // optional
"remote": "...",
"revision": "...",
"branch": "...", // optional
"tag": "..." // optional
}
}
Note that some fields are optional (they may not be set if the corresponding environment variables are not defined).
Some CI servers expose usernames and passwords in the environment variable
that is used to detect git.remote
. For security reasons, this library removes
the username and password from the git.remote
field in the CiEnvironment
struct.
npm install @cucumber/ci-environment
import detectCiEnvironment from '@cucumber/ci-environment'
const ciEnvironment = detectCiEnvironment(process.env)
console.log(JSON.stringify(ciEnvironment, null, 2))
<dependency>
<groupId>io.cucumber</groupId>
<artifactId>ci-environment</artifactId>
</dependency>
import static io.cucumber.cienvironment.DetectCiEnvironment.detectCiEnvironment;
public class CiEnvironmentExample {
public static void main(String[] args) {
CiEnvironment ciEnvironment = detectCiEnvironment(System.getenv()).orElseThrow(() -> new RuntimeException("No CI environment detected"));
System.out.println("ciEnvironment = " + ciEnvironment);
}
}
gem 'cucumber-ci-environment'
require 'cucumber/ci_environment'
ci_environment = Cucumber::CiEnvironment.detect_ci_environment(ENV)
p ci_environment
go get github.com/cucumber/ci-environment/go@latest
import (
"fmt"
cienvironment "github.com/cucumber/ci-environment/go"
)
func main() {
ci := cienvironment.DetectCIEnvironment()
if ci == nil {
fmt.Println("No CI environment detected")
}
}
import os
from ci_environment import detect_ci_environment
ci_environment = detect_ci_environment(os.environ)
Please see CONTRIBUTING.md for more information.
FAQs
Detect CI Environment from environment variables
We found that io.cucumber:ci-environment 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.