Skip to content

Commit f40bd75

Browse files
Merge pull request #6 from Vigilnz/api_integration
Api integration
2 parents 9c06b65 + c5a1c11 commit f40bd75

File tree

15 files changed

+719
-63
lines changed

15 files changed

+719
-63
lines changed

README.md

Lines changed: 171 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,185 @@
1-
# .
1+
# Vigilnz Security Plugin
22

3-
## Introduction
3+
[![Jenkins Plugin](https://img.shields.io/jenkins/plugin/v/vigilnz-security.svg)](https://plugins.jenkins.io/vigilnz-security)
4+
[![Jenkins Plugin Installs](https://img.shields.io/jenkins/plugin/i/vigilnz-security.svg?color=blue)](https://plugins.jenkins.io/vigilnz-security)
45

5-
TODO Describe what your plugin does here
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.
67

7-
## Getting started
8+
## Features
89

9-
TODO Tell users how to configure your plugin here, include screenshots, pipeline examples and
10-
configuration-as-code examples.
10+
- 🔒 **Multiple Scan Types**: Support for CVE, SAST, SBOM, and more
11+
- 🔐 **Secure Credential Management**: Store and manage Vigilnz API tokens 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+
- 🔄 **Token Management**: Automatic token refresh and caching
1116

12-
## Issues
17+
## Requirements
1318

14-
TODO Decide where you're going to host your issues, the default is Jenkins JIRA, but you can also enable GitHub issues,
15-
If you use GitHub issues there's no need for this section; else add the following line:
19+
- Jenkins 2.516.3 or later
20+
- Java 17 or later
21+
- Vigilnz API access (API key required)
1622

17-
Report issues and enhancements in the [Jenkins issue tracker](https://issues.jenkins.io/).
23+
## Installation
24+
25+
### From Jenkins Update Center
26+
27+
1. Go to **Manage Jenkins****Manage Plugins**
28+
2. Search for "Vigilnz Security"
29+
3. Click **Install without restart** or **Download now and install after restart**
30+
31+
### Manual Installation
32+
33+
1. Download the latest `.hpi` file from [GitHub Releases](https://github.com/your-org/vigilnz-security-plugin/releases)
34+
2. Go to **Manage Jenkins****Manage Plugins****Advanced**
35+
3. Upload the `.hpi` file under **Upload Plugin**
36+
4. Restart Jenkins
37+
38+
## Getting Started
39+
40+
### 1. Configure Vigilnz Credentials
41+
42+
1. Go to **Manage Jenkins****Manage Credentials**
43+
2. Click **Add Credentials**
44+
3. Select **Vigilnz Security Token** from the kind dropdown
45+
4. Enter:
46+
- **Token**: Your Vigilnz API key
47+
- **ID**: Unique identifier (optional, auto-generated if not provided)
48+
- **Description**: Description for this credential
49+
5. Click **OK**
50+
51+
### 2. Use in Freestyle Job
52+
53+
1. Create a new Freestyle project or edit an existing one
54+
2. In **Build Steps**, click **Add build step****Invoke Vigilnz Security Task**
55+
3. Configure:
56+
- **Token**: Select your Vigilnz credential
57+
- **Target File**: (Optional) File or path to scan
58+
- **Scan Types**: Select at least one scan type (CVE, SAST, SBOM)
59+
4. Save and run the build
60+
61+
### 3. Use in Pipeline
62+
63+
```groovy
64+
pipeline {
65+
agent any
66+
67+
stages {
68+
stage('Security Scan') {
69+
steps {
70+
vigilnzScan(
71+
token: 'my-vigilnz-token',
72+
scanTypes: ['cve', 'sast', 'sbom']
73+
)
74+
}
75+
}
76+
}
77+
}
78+
```
79+
80+
## Configuration
81+
82+
### Environment Variables
83+
84+
You can configure API endpoints using environment variables or system properties:
85+
86+
- `VIGILNZ_AUTH_URL` or `-Dvigilnz.auth.url`: Authentication API URL (default: `http://localhost:1337/auth/api-key`)
87+
- `VIGILNZ_SCAN_URL` or `-Dvigilnz.scan.url`: Multi-scan API URL (default: `http://localhost:8000/scan-targets/multi-scan`)
88+
89+
### Scan Types
90+
91+
- **CVE**: Common Vulnerabilities and Exposures scan
92+
- **SAST**: Static Application Security Testing
93+
- **SBOM**: Software Bill of Materials
94+
95+
## Viewing Results
96+
97+
After a build completes:
98+
99+
1. **Sidebar Summary**: View a quick summary in the build page sidebar
100+
2. **Full Details**: Click "View Details →" in the sidebar to see complete scan results
101+
3. **Console Output**: Check the build console for detailed scan logs
102+
103+
## Pipeline Examples
104+
105+
### Basic Usage
106+
107+
```groovy
108+
vigilnzScan(
109+
token: 'my-vigilnz-token',
110+
scanTypes: ['cve']
111+
)
112+
```
113+
114+
### Multiple Scan Types
115+
116+
```groovy
117+
vigilnzScan(
118+
token: 'my-vigilnz-token',
119+
scanTypes: ['cve', 'sast', 'sbom']
120+
)
121+
```
122+
123+
### With Credentials Binding
124+
125+
```groovy
126+
pipeline {
127+
agent any
128+
129+
stages {
130+
stage('Security Scan') {
131+
steps {
132+
withCredentials([string(credentialsId: 'vigilnz-token', variable: 'VIGILNZ_TOKEN')]) {
133+
vigilnzScan(
134+
token: 'vigilnz-token',
135+
scanTypes: ['cve', 'sast']
136+
)
137+
}
138+
}
139+
}
140+
}
141+
}
142+
```
143+
144+
## Troubleshooting
145+
146+
### Authentication Failed
147+
148+
- Verify your API key is correct
149+
- Check that the authentication URL is accessible
150+
- Ensure the token has not expired
151+
152+
### Scan Types Not Selected
153+
154+
- At least one scan type must be selected
155+
- Check the checkbox selections in the build configuration
156+
157+
### No Results in Sidebar
158+
159+
- Ensure the build completed successfully
160+
- Check the build console for any errors
161+
- Verify the API response was successful
162+
163+
## Support
164+
165+
- **Issues**: Report issues on [GitHub Issues](https://github.com/your-org/vigilnz-security-plugin/issues)
166+
- **Documentation**: [Plugin Wiki](https://github.com/your-org/vigilnz-security-plugin/wiki)
167+
- **Email**: [email protected]
18168

19169
## Contributing
20170

21-
TODO review the default [CONTRIBUTING](https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md) file and make sure it is appropriate for your plugin, if not then add your own one adapted from the base file
171+
Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
172+
173+
## Changelog
22174

23-
Refer to our [contribution guidelines](https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md)
175+
### Version 1.0
24176

25-
## LICENSE
177+
- Initial release
178+
- Support for CVE, SAST, SBOM scan types
179+
- Freestyle and Pipeline job support
180+
- Secure credential management
181+
- Build sidebar results display
26182

27-
Licensed under MIT, see [LICENSE](LICENSE.md)
183+
## License
28184

185+
Licensed under MIT License. See [LICENSE](LICENSE.md) for details.

pom.xml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717

1818
<!-- Plugin Name -->
1919
<name>Vigilnz Security</name>
20-
<url>https://dev.vigilnz.com/</url>
20+
<description>Vigilnz Security Plugin integrates security scanning capabilities into Jenkins. Run CVE, SAST, SBOM, and other security scans as part of your CI/CD pipeline.</description>
21+
<url>https://github.com/${gitHubRepo}</url>
2122
<licenses>
2223
<license>
2324
<name>MIT License</name>
@@ -31,10 +32,18 @@
3132
<tag>${scmTag}</tag>
3233
<url>https://github.com/${gitHubRepo}</url>
3334
</scm>
35+
36+
<developers>
37+
<developer>
38+
<id>vigilnz</id>
39+
<name>Vigilnz Team</name>
40+
<email>[email protected]</email>
41+
</developer>
42+
</developers>
3443

3544
<properties>
3645
<revision>1.0</revision>
37-
<changelist>-SNAPSHOT</changelist>
46+
<changelist></changelist>
3847
<!-- https://www.jenkins.io/doc/developer/plugin-development/choosing-jenkins-baseline/ -->
3948
<jenkins.baseline>2.516</jenkins.baseline>
4049
<jenkins.version>${jenkins.baseline}.3</jenkins.version>
@@ -43,6 +52,7 @@
4352
<spotless.check.skip>false</spotless.check.skip>
4453
<ban-junit4-imports.skip>false</ban-junit4-imports.skip>
4554
<hpi.strictBundledArtifacts>true</hpi.strictBundledArtifacts>
55+
<hpi.bundledArtifacts>jackson-annotations,jackson-core,jackson-databind</hpi.bundledArtifacts>
4656
</properties>
4757

4858
<dependencyManagement>
@@ -101,6 +111,13 @@
101111
<version>1.3.2</version>
102112
<scope>provided</scope>
103113
</dependency>
114+
115+
<dependency>
116+
<groupId>com.fasterxml.jackson.core</groupId>
117+
<artifactId>jackson-databind</artifactId>
118+
<version>2.20.1</version>
119+
</dependency>
120+
104121
</dependencies>
105122

106123
<repositories>

0 commit comments

Comments
 (0)