Skip to content

Commit

Permalink
feat: add functions for scanning jenkins, elasticsearch and huggingface
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Aug 6, 2024
1 parent c58d21f commit 42029d4
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[package]
authors = [
"Tsiry Sandratraina <[email protected]>"
"Tsiry Sandratraina <[email protected]>",
]
description = "Set up your CI/CD Pipeline with a specific version of trufflehog"
edition = "2021"
license = "MIT"
name = "trufflehog"
version = "0.1.0"
version = "0.1.1"

[lib]
crate-type = [
"cdylib"
"cdylib",
]

[dependencies]
anyhow = "1.0.82"
extism-pdk = "1.1.0"
fluentci-pdk = "0.1.9"
fluentci-pdk = "0.1.9"
35 changes: 19 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,31 @@ fluentci run --wasm trufflehog setup

## Functions

| Name | Description |
| ---------- | -------------------------------------------- |
| setup | Installs a specific version of trufflehog. |
| git | Find credentials in git repositories |
| github | Find credentials in GitHub repositories. |
| gitlab | Find credentials in GitLab repositories. |
| filesystem | Find credentials in a filesystem. |
| s3 | Find credentials in S3 buckets. |
| gcs | Find credentials in GCS buckets |
| syslog | Scan syslog |
| circleci | Scan CircleCI |
| docker | Scan Docker Image |
| travisci | Scan TravisCI |
| postman | Scan Postman |
| Name | Description |
| ------------- | -------------------------------------------- |
| setup | Installs a specific version of trufflehog. |
| git | Find credentials in git repositories |
| github | Find credentials in GitHub repositories. |
| gitlab | Find credentials in GitLab repositories. |
| filesystem | Find credentials in a filesystem. |
| s3 | Find credentials in S3 buckets. |
| gcs | Find credentials in GCS buckets |
| syslog | Scan syslog |
| circleci | Scan CircleCI |
| docker | Scan Docker Image |
| travisci | Scan TravisCI |
| postman | Scan Postman |
| jenkins | Scan Jenkins |
| elasticsearch | Scan Elasticsearch |
| huggingface | Scan Huggingface |

## Code Usage

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

```toml
[dependencies]
fluentci-pdk = "0.1.9"
fluentci-pdk = "0.2.1"
```

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

// ...

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

## 📚 Examples
Expand Down
2 changes: 1 addition & 1 deletion fluentci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ authors = [
description = "CI/CD Plugin for TruffleHog"
license = "MIT"
name = "trufflehog"
version = "0.1.0"
version = "0.1.1"
27 changes: 27 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,3 +116,30 @@ pub fn postman(flags: String) -> FnResult<String> {
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn jenkins(flags: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec!["pkgx", "trufflehog", "jenkins", &flags])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn elasticsearch(flags: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec!["pkgx", "trufflehog", "elasticsearch", &flags])?
.stdout()?;
Ok(stdout)
}

#[plugin_fn]
pub fn huggingface(flags: String) -> FnResult<String> {
let stdout = dag()
.pkgx()?
.with_exec(vec!["pkgx", "trufflehog", "huggingface", &flags])?
.stdout()?;
Ok(stdout)
}

0 comments on commit 42029d4

Please sign in to comment.