Skip to content

Commit 36928f7

Browse files
Merge pull request #7 from jenkinsci/api_integration
docs: addressed Jenkins plugin comments and feedback
2 parents 4329f2b + 8c9a152 commit 36928f7

File tree

18 files changed

+106
-51
lines changed

18 files changed

+106
-51
lines changed

README.md

Lines changed: 77 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,65 @@
33
[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/vigilnz-security.svg)](https://plugins.jenkins.io/vigilnz-security)
44
[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/vigilnz-security.svg?color=blue)](https://plugins.jenkins.io/vigilnz-security)
55

6-
Vigilnz Security Plugin integrates comprehensive security scanning capabilities into Jenkins CI/CD pipelines. Run CVE, SAST, SBOM, and other security scans as part of your build process.
6+
Vigilnz Security Plugin integrates comprehensive security scanning capabilities into Jenkins CI/CD pipelines.
77

88
## Features
99

10-
- 🔒 **Multiple Scan Types**: Support for CVE, SAST, SBOM, and more
11-
- 🔐 **Secure Credential Management**: Store and manage Vigilnz API credentials securely
12-
- 🚀 **Freestyle & Pipeline Support**: Works with both traditional and modern Jenkins jobs
13-
- 📊 **Detailed Results**: View scan results directly in the Jenkins build sidebar
14-
- **Flexible Configuration**: Select which scan types to run per build
15-
- 🔄 **Credential Management**: Automatic refresh and caching
10+
- **Multiple Scan Types**: Support for SCA, SAST, SBOM, and more
11+
- **Secure Credential Management**: Store and manage Vigilnz API credentials securely
12+
- **Freestyle & Pipeline Support**: Works with both traditional and modern Jenkins jobs
13+
- **Detailed Results**: View scan results directly in the Jenkins build sidebar
14+
-**Flexible Configuration**: Select which scan types to run per build
15+
- **Credential Management**: Automatic refresh and caching
1616

1717
## Requirements
1818

19-
- Jenkins 2.516.3 or later
19+
- Jenkins 2.528.3 or later
2020
- Java 17 or later
2121
- Vigilnz API access (API key required)
2222

23+
## Usage
24+
To use the plugin you will need to take the following steps in order:
25+
26+
1. [Install the Vigilnz Security Plugin](#installation)
27+
2. [Generate API Key From Vigilnz Security](#api-Key-generation)
28+
3. [Configure a Vigilnz API Key Credential](#configure-vigilnz-credentials)
29+
4. [Add Vigilnz Security to your Project](#add-vigilnz-security-to-your-project)
30+
5. [View Your Vigilnz Scan Report](#viewing-results)
31+
2332
## Installation
2433

25-
### From Jenkins Update Center
34+
### Option A: From Jenkins Update Center
2635

2736
1. Go to **Manage Jenkins****Manage Plugins**
2837
2. Search for "Vigilnz Security"
2938
3. Click **Install without restart** or **Download now and install after restart**
3039

31-
### Manual Installation
40+
![Plugin Manager search result](src/main/resources/images/search_result.png)
41+
42+
### Option B: Manual Upload
3243

33-
1. Download the latest `.hpi` file from [GitHub Releases](https://github.com/your-org/vigilnz-security-plugin/releases)
44+
1. Download the latest `.hpi` file from [GitHub Releases](https://github.com/jenkinsci/vigilnz-security-plugin/releases)
3445
2. Go to **Manage Jenkins****Manage Plugins****Advanced**
3546
3. Upload the `.hpi` file under **Upload Plugin**
3647
4. Restart Jenkins
3748

38-
## Getting Started
49+
![Upload Plugin screen](src/main/resources/images/manual_upload.png)
50+
51+
52+
## API Key Generation
53+
54+
### To generate your Vigilnz API Key:
3955

40-
### 1. Configure Vigilnz Credentials
56+
1. Login to the [Vigilnz](https://vigilnz.com/) application.
57+
2. Navigate to Settings → API Keys.
58+
3. Click Generate New Key or View API Key (If exits).
59+
4. Copy the API Key and store it securely.
60+
61+
![API Key generation screen](src/main/resources/images/vigilnz_api.png)
62+
63+
64+
## Configure Vigilnz Credentials
4165

4266
1. Go to **Manage Jenkins****Manage Credentials**
4367
2. Click **Add Credentials**
@@ -48,17 +72,24 @@ Vigilnz Security Plugin integrates comprehensive security scanning capabilities
4872
- **Description**: Description for this credential
4973
5. Click **OK**
5074

51-
### 2. Use in Freestyle Job
75+
![Add Vigilnz credential](src/main/resources/images/vigilnz_credential.png)
76+
77+
## Add Vigilnz Security to your Project
78+
79+
### 1. Using Vigilnz in Freestyle Jobs
5280

5381
1. Create a new Freestyle project or edit an existing one
5482
2. In **Build Steps**, click **Add build step****Invoke Vigilnz Security Task**
5583
3. Configure:
5684
- **Credentials**: Select your Vigilnz credential
5785
- **Target File**: (Optional) File or path to scan
58-
- **Scan Types**: Select at least one scan type (CVE, SAST, SBOM)
86+
- **Scan Types**: Select at least one scan type (SCA, SAST, SBOM)
5987
4. Save and run the build
6088

61-
### 3. Use in Pipeline
89+
![Freestyle job configuration](src/main/resources/images/freestyle.png)
90+
91+
92+
### 2. Using Vigilnz in Pipeline Jobs
6293

6394
```groovy
6495
pipeline {
@@ -69,7 +100,7 @@ pipeline {
69100
steps {
70101
vigilnzScan(
71102
credentialsId: 'my-vigilnz-creds',
72-
scanTypes: 'cve,sast,sbom'
103+
scanTypes: 'sca,sast,sbom'
73104
)
74105
}
75106
}
@@ -78,30 +109,44 @@ pipeline {
78109
79110
```
80111

112+
![Pipeline job configuration](src/main/resources/images/pipeline.png)
113+
114+
## Parameters Reference
115+
116+
| Parameter | Required | Description |
117+
|---------------|----------|---------------------------------------|
118+
| credentialsId | True | ID of Vigilnz credential |
119+
| scanTypes | True | Comma-separated list: `sca,sast,sbom` |
120+
121+
[//]: # (| targetFile | False | File/path to scan (optional) |)
122+
123+
81124
## Configuration
82125

83126
### Scan Types
84127

85-
- **CVE**: Common Vulnerabilities and Exposures scan
86-
- **SAST**: Static Application Security Testing
128+
- **SCA**: Software Composition Analysis
87129
- **SBOM**: Software Bill of Materials
130+
- **SAST**: Static Application Security Testing
88131

89132
## Viewing Results
90133

91-
After a build completes:
134+
### After a build completes:
92135

93136
1. **Sidebar Summary**: View a quick summary in the build page sidebar
94-
2. **Full Details**: Click "View Details →" in the sidebar to see complete scan results
137+
2. **Full Details**: Click "Vigilnz Scan Results" in the sidebar to see complete scan results
95138
3. **Console Output**: Check the build console for detailed scan logs
96139

140+
![Vigilnz Scan Result screen](src/main/resources/images/vigilnz_result.png)
141+
97142
## Pipeline Examples
98143

99144
### Basic Usage
100145

101146
```groovy
102147
vigilnzScan(
103148
credentialsId: 'my-vigilnz-token',
104-
scanTypes: 'cve'
149+
scanTypes: 'sca'
105150
)
106151
```
107152

@@ -110,7 +155,7 @@ vigilnzScan(
110155
```groovy
111156
vigilnzScan(
112157
credentialsId: 'my-vigilnz-token',
113-
scanTypes: 'cve,sast,sbom'
158+
scanTypes: 'sca,sast,sbom'
114159
)
115160
```
116161

@@ -126,7 +171,7 @@ pipeline {
126171
withCredentials([string(credentialsId: 'vigilnz-token', variable: 'VIGILNZ_TOKEN')]) {
127172
vigilnzScan(
128173
credentialsId: 'vigilnz-token',
129-
scanTypes: 'cve,sast'
174+
scanTypes: 'sca,sast'
130175
)
131176
}
132177
}
@@ -141,7 +186,7 @@ pipeline {
141186

142187
- Verify your API key is correct
143188
- Check that the authentication URL is accessible
144-
- Ensure the token has not expired
189+
- Ensure the API Key has not expired
145190

146191
### Scan Types Not Selected
147192

@@ -156,20 +201,21 @@ pipeline {
156201

157202
## Support
158203

159-
- **Issues**: Report issues on [GitHub Issues](https://github.com/your-org/vigilnz-security-plugin/issues)
160-
- **Documentation**: [Plugin Wiki](https://github.com/your-org/vigilnz-security-plugin/wiki)
161-
- **Email**: support@vigilnz.com
204+
- **Issues**: Report issues on [GitHub Issues](https://github.com/jenkinsci/vigilnz-security-plugin/issues)
205+
- **Documentation**: [Plugin](https://github.com/jenkinsci/vigilnz-security-plugin)
206+
207+
[//]: # (- **Email**: support@vigilnz.com)
162208

163-
## Contributing
209+
[//]: # (## Contributing)
164210

165-
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
211+
[//]: # (Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.)
166212

167213
## Changelog
168214

169215
### Version 1.0
170216

171217
- Initial release
172-
- Support for CVE, SAST, SBOM scan types
218+
- Support for SCA, SAST, SBOM scan types
173219
- Freestyle and Pipeline job support
174220
- Secure credential management
175221
- Build sidebar results display

src/main/java/io/jenkins/plugins/vigilnz/api/ApiService.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ public class ApiService {
2222
*/
2323
public static AuthResponse authenticate(String apiKey, TaskListener listener) {
2424
try {
25-
String authUrl = DEFAULT_AUTH_URL;
26-
URL url = new URL(authUrl);
25+
URL url = new URL(DEFAULT_AUTH_URL);
2726

2827
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
2928
conn.setRequestMethod("POST");
@@ -95,8 +94,7 @@ public static String triggerScan(
9594
listener.getLogger().println("Using access token for multi-scan API call...");
9695

9796
// Step 2: Call multi-scan API with access token
98-
String scanUrl = DEFAULT_SCAN_URL;
99-
URL url = new URL(scanUrl);
97+
URL url = new URL(DEFAULT_SCAN_URL);
10098

10199
String branch = env.get("GIT_BRANCH");
102100
String repoUrl = env.get("GIT_URL");
@@ -105,7 +103,6 @@ public static String triggerScan(
105103
listener.getLogger().println("Branch: " + branch);
106104
listener.getLogger().println("Repo URL: " + repoUrl);
107105
listener.getLogger().println("Commit: " + commit);
108-
listener.getLogger().println("Scan Url: " + scanUrl);
109106

110107
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
111108

src/main/java/io/jenkins/plugins/vigilnz/build/SecurityCheckBuilder.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ public ListBoxModel doFillCredentialsIdItems(@AncestorInPath Item project) {
204204
}
205205
items.add(label, c.getId());
206206
}
207+
items.add("None", "");
207208
return items;
208209
}
209210

src/main/java/io/jenkins/plugins/vigilnz/pipeline/PipelineStep.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import java.util.Arrays;
99
import java.util.List;
1010
import java.util.Set;
11+
import java.util.stream.Collectors;
1112
import org.jenkinsci.plugins.workflow.steps.Step;
1213
import org.jenkinsci.plugins.workflow.steps.StepContext;
1314
import org.jenkinsci.plugins.workflow.steps.StepDescriptor;
@@ -27,7 +28,10 @@ public PipelineStep(String credentialsId, String scanTypes) {
2728

2829
// Split comma-separated string into a list
2930
if (scanTypes != null && !scanTypes.trim().isEmpty()) {
30-
this.scanTypes = Arrays.asList(scanTypes.split("\\s*,\\s*"));
31+
List<String> scanTypeList = Arrays.asList(scanTypes.split("\\s*,\\s*"));
32+
this.scanTypes = scanTypeList.stream()
33+
.map(s -> s.equalsIgnoreCase("sca") ? "cve" : s)
34+
.collect(Collectors.toList());
3135
} else {
3236
this.scanTypes = List.of();
3337
}

src/main/java/io/jenkins/plugins/vigilnz/utils/VigilnzConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
public class VigilnzConfig {
44

55
// Default URLs (for development)
6-
public static final String DEFAULT_BASE_URL = "https://devapi.vigilnz.com";
6+
public static final String DEFAULT_BASE_URL = "https://api.vigilnz.com";
77
public static final String DEFAULT_AUTH_URL = DEFAULT_BASE_URL + "/auth/api-key";
88
public static final String DEFAULT_SCAN_URL = DEFAULT_BASE_URL + "/scan-targets/multi-scan";
99
}
36.4 KB
Loading
53.3 KB
Loading
39.3 KB
Loading
60.5 KB
Loading
61.8 KB
Loading

0 commit comments

Comments
 (0)