Skip to content

Commit 42029d4

Browse files
committed
feat: add functions for scanning jenkins, elasticsearch and huggingface
1 parent c58d21f commit 42029d4

File tree

5 files changed

+52
-22
lines changed

5 files changed

+52
-22
lines changed

Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
[package]
22
authors = [
3-
"Tsiry Sandratraina <[email protected]>"
3+
"Tsiry Sandratraina <[email protected]>",
44
]
55
description = "Set up your CI/CD Pipeline with a specific version of trufflehog"
66
edition = "2021"
77
license = "MIT"
88
name = "trufflehog"
9-
version = "0.1.0"
9+
version = "0.1.1"
1010

1111
[lib]
1212
crate-type = [
13-
"cdylib"
13+
"cdylib",
1414
]
1515

1616
[dependencies]
1717
anyhow = "1.0.82"
1818
extism-pdk = "1.1.0"
19-
fluentci-pdk = "0.1.9"
19+
fluentci-pdk = "0.1.9"

README.md

+19-16
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,31 @@ fluentci run --wasm trufflehog setup
1515

1616
## Functions
1717

18-
| Name | Description |
19-
| ---------- | -------------------------------------------- |
20-
| setup | Installs a specific version of trufflehog. |
21-
| git | Find credentials in git repositories |
22-
| github | Find credentials in GitHub repositories. |
23-
| gitlab | Find credentials in GitLab repositories. |
24-
| filesystem | Find credentials in a filesystem. |
25-
| s3 | Find credentials in S3 buckets. |
26-
| gcs | Find credentials in GCS buckets |
27-
| syslog | Scan syslog |
28-
| circleci | Scan CircleCI |
29-
| docker | Scan Docker Image |
30-
| travisci | Scan TravisCI |
31-
| postman | Scan Postman |
18+
| Name | Description |
19+
| ------------- | -------------------------------------------- |
20+
| setup | Installs a specific version of trufflehog. |
21+
| git | Find credentials in git repositories |
22+
| github | Find credentials in GitHub repositories. |
23+
| gitlab | Find credentials in GitLab repositories. |
24+
| filesystem | Find credentials in a filesystem. |
25+
| s3 | Find credentials in S3 buckets. |
26+
| gcs | Find credentials in GCS buckets |
27+
| syslog | Scan syslog |
28+
| circleci | Scan CircleCI |
29+
| docker | Scan Docker Image |
30+
| travisci | Scan TravisCI |
31+
| postman | Scan Postman |
32+
| jenkins | Scan Jenkins |
33+
| elasticsearch | Scan Elasticsearch |
34+
| huggingface | Scan Huggingface |
3235

3336
## Code Usage
3437

3538
Add `fluentci-pdk` crate to your `Cargo.toml`:
3639

3740
```toml
3841
[dependencies]
39-
fluentci-pdk = "0.1.9"
42+
fluentci-pdk = "0.2.1"
4043
```
4144

4245
Use the following code to call the plugin:
@@ -46,7 +49,7 @@ use fluentci_pdk::dag;
4649

4750
// ...
4851

49-
dag().call("https://pkg.fluentci.io/[email protected].0?wasm=1", "setup", vec!["latest"])?;
52+
dag().call("https://pkg.fluentci.io/[email protected].1?wasm=1", "setup", vec!["latest"])?;
5053
```
5154

5255
## 📚 Examples

fluentci.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ authors = [
55
description = "CI/CD Plugin for TruffleHog"
66
license = "MIT"
77
name = "trufflehog"
8-
version = "0.1.0"
8+
version = "0.1.1"

src/lib.rs

+27
Original file line numberDiff line numberDiff line change
@@ -116,3 +116,30 @@ pub fn postman(flags: String) -> FnResult<String> {
116116
.stdout()?;
117117
Ok(stdout)
118118
}
119+
120+
#[plugin_fn]
121+
pub fn jenkins(flags: String) -> FnResult<String> {
122+
let stdout = dag()
123+
.pkgx()?
124+
.with_exec(vec!["pkgx", "trufflehog", "jenkins", &flags])?
125+
.stdout()?;
126+
Ok(stdout)
127+
}
128+
129+
#[plugin_fn]
130+
pub fn elasticsearch(flags: String) -> FnResult<String> {
131+
let stdout = dag()
132+
.pkgx()?
133+
.with_exec(vec!["pkgx", "trufflehog", "elasticsearch", &flags])?
134+
.stdout()?;
135+
Ok(stdout)
136+
}
137+
138+
#[plugin_fn]
139+
pub fn huggingface(flags: String) -> FnResult<String> {
140+
let stdout = dag()
141+
.pkgx()?
142+
.with_exec(vec!["pkgx", "trufflehog", "huggingface", &flags])?
143+
.stdout()?;
144+
Ok(stdout)
145+
}

0 commit comments

Comments
 (0)