Skip to content

Commit b352e5b

Browse files
update: bumping cargo edition to 2024 to fix build error and bumping release
1 parent acf6a35 commit b352e5b

File tree

15 files changed

+58
-39
lines changed

15 files changed

+58
-39
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,7 @@
3737
## 1.0.11
3838
- The update from 1.0.10 caused a major bug where choctaw_hog was reporting 0 results. This was due to a change in the
3939
behavior of the Rust Git library. The change is fixed and tested on MacOS.
40-
- Added the Slack hog - hante hog
40+
- Added the Slack hog - hante hog
41+
42+
## 1.0.12
43+
- Updating Cargo edition from 2021 to 2024

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ members = [
55

66
[package]
77
name = "rusty_hogs"
8-
version = "1.0.11"
8+
version = "1.0.12"
99
authors = ["Scott Cutler <[email protected]>"]
10-
edition = "2021"
10+
edition = "2024"
1111
description = "This project provides a set of scanners that will use regular expressions to try and detect the presence of sensitive information such as API keys, passwords, and personal information. It includes a set of regular expressions by default, but will also accept a JSON object containing your custom regular expressions."
1212
homepage = "https://github.com/newrelic/rusty-hog"
1313
keywords = ["secret", "scanner", "regex", "rusty", "hog"]

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Download and unzip the [latest ZIP](https://github.com/newrelic/rusty-hog/releas
5252
on the releases tab. Then, run each binary with `-h` to see the usage.
5353

5454
```shell script
55-
wget https://github.com/newrelic/rusty-hog/releases/download/v1.0.11/rustyhogs-darwin-choctaw_hog-1.0.11.zip
56-
unzip rustyhogs-darwin-choctaw_hog-1.0.11.zip
55+
wget https://github.com/newrelic/rusty-hog/releases/download/v1.0.12/rustyhogs-darwin-choctaw_hog-1.0.12.zip
56+
unzip rustyhogs-darwin-choctaw_hog-1.0.12.zip
5757
darwin_releases/choctaw_hog -h
5858
```
5959

@@ -62,8 +62,8 @@ Rusty Hog Docker images can be found at the authors personal DockerHub page [her
6262
A Docker Image is built for each Hog and for each release. So to use choctaw_hog you would run the following commands:
6363

6464
```shell script
65-
docker pull wetfeet2000/choctaw_hog:1.0.10
66-
docker run -it --rm wetfeet2000/choctaw_hog:1.0.10 --help
65+
docker pull wetfeet2000/choctaw_hog:1.0.12
66+
docker run -it --rm wetfeet2000/choctaw_hog:1.0.12 --help
6767
```
6868

6969
## How to build

crates/rusty-hog-scanner/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "rusty_hog_scanner"
3-
version = "0.1.0"
4-
edition = "2021"
3+
version = "0.1.1"
4+
edition = "2024"
55

66
[dependencies]
77
serde = "1.0"

crates/rusty-hog-scanner/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
extern crate clap;
6969

7070
use anyhow::Result;
71-
use base64::{engine::general_purpose as Base64Engine, Engine as _};
71+
use base64::{Engine as _, engine::general_purpose as Base64Engine};
7272
use clap::ArgMatches;
73-
use log::{self, debug, error, info, LevelFilter};
73+
use log::{self, LevelFilter, debug, error, info};
7474
use regex::bytes::{Match, Matches, Regex, RegexBuilder};
7575
use serde::Serialize;
7676
use serde_derive::Deserialize;
@@ -486,7 +486,10 @@ impl SecretScannerBuilder {
486486
let json_string: String = match json_string_result {
487487
Ok(s) => s,
488488
Err(e) => {
489-
error!("Error reading allowlist JSON file, falling back to default allowlist rules: {:?}", e);
489+
error!(
490+
"Error reading allowlist JSON file, falling back to default allowlist rules: {:?}",
491+
e
492+
);
490493
String::from(DEFAULT_ALLOWLIST_JSON)
491494
}
492495
};
@@ -557,7 +560,7 @@ impl SecretScannerBuilder {
557560
return Err(SimpleError::with(
558561
"Failed to parse the regex pattern from JSON",
559562
e,
560-
))
563+
));
561564
}
562565
};
563566
Ok((x.0, v))

src/bin/ankamali_hog.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ use std::path::Path;
4141
#[tokio::main]
4242
async fn main() {
4343
let matches = Command::new("ankamali_hog")
44-
.version("1.0.11")
44+
.version("1.0.12")
4545
.author("Scott Cutler <[email protected]>")
4646
.about("Google Drive secret scanner in Rust.")
4747
.arg(
@@ -152,8 +152,20 @@ async fn run(arg_matches: ArgMatches) -> Result<(), SimpleError> {
152152
let auth = drive3::oauth2::InstalledFlowAuthenticator::builder(
153153
secret,
154154
drive3::oauth2::InstalledFlowReturnMethod::HTTPRedirect,
155-
).build().await.unwrap();
156-
let mut hub = DriveHub::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
155+
)
156+
.build()
157+
.await
158+
.unwrap();
159+
let mut hub = DriveHub::new(
160+
hyper::Client::builder().build(
161+
hyper_rustls::HttpsConnectorBuilder::new()
162+
.with_native_roots()
163+
.https_or_http()
164+
.enable_http1()
165+
.build(),
166+
),
167+
auth,
168+
);
157169

158170
// get some initial info about the file
159171
let gdriveinfo = GDriveFileInfo::new(file_id, &hub).await.unwrap();

src/bin/berkshire_hog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use std::collections::HashSet;
4444
/// Main entry function that uses the [clap crate](https://docs.rs/clap/2.33.0/clap/)
4545
fn main() {
4646
let matches = Command::new("berkshire_hog")
47-
.version("1.0.11")
47+
.version("1.0.12")
4848
.author("Scott Cutler <[email protected]>")
4949
.about("S3 secret hunter in Rust. Avoid bandwidth costs, run this within a VPC!")
5050
.arg(Arg::new("REGEX").long("regex").action(ArgAction::Set).help("Sets a custom regex JSON file"))

src/bin/berkshire_hog_lambda.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
1717
extern crate s3;
1818

19-
use lambda_runtime::{handler_fn, Context, Error};
20-
use log::{self, warn, LevelFilter};
19+
use lambda_runtime::{Context, Error, handler_fn};
20+
use log::{self, LevelFilter, warn};
2121
use rusty_hog_scanner::SecretScannerBuilder;
2222
use rusty_hogs::aws_scanning::{S3Finding, S3Scanner};
2323
use s3::bucket::Bucket;

src/bin/choctaw_hog.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use rusty_hogs::git_scanning::GitScanner;
5151
/// Main entry function that uses the [clap crate](https://docs.rs/clap/2.33.0/clap/)
5252
fn main() {
5353
let matches = Command::new("choctaw_hog")
54-
.version("1.0.11")
54+
.version("1.0.12")
5555
.author("Scott Cutler <[email protected]>")
5656
.about("Git secret scanner in Rust")
5757
.arg(Arg::new("REGEX").short('r').long("regex").action(ArgAction::Set).value_name("REGEX").help("Sets a custom regex JSON file"))

src/bin/duroc_hog.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub struct FileFinding {
5858
pub path: String,
5959
pub reason: String,
6060
pub linenum: usize,
61-
pub lineindextuples: Vec<(usize, usize)>
61+
pub lineindextuples: Vec<(usize, usize)>,
6262
}
6363

6464
const ZIPEXTENSIONS: &[&str] = &["zip"];
@@ -68,7 +68,7 @@ const GZEXTENSIONS: &[&str] = &["gz", "tgz"];
6868
/// Main entry function that uses the [clap crate](https://docs.rs/clap/2.33.0/clap/)
6969
fn main() {
7070
let matches = Command::new("duroc_hog")
71-
.version("1.0.11")
71+
.version("1.0.12")
7272
.author("Scott Cutler <[email protected]>")
7373
.about("File system secret scanner in Rust")
7474
.arg(
@@ -385,15 +385,15 @@ fn scan_bytes(input: Vec<u8>, ss: &SecretScanner, path: String) -> HashSet<FileF
385385
.decode(&new_line[m.start()..m.end()], DecoderTrap::Ignore)
386386
.unwrap_or_else(|_| "<STRING DECODE ERROR>".parse().unwrap());
387387
strings_found.push(result);
388-
lineindextuples.push((m.start(),m.end()));
388+
lineindextuples.push((m.start(), m.end()));
389389
}
390390
if !strings_found.is_empty() {
391391
findings.insert(FileFinding {
392392
strings_found,
393393
reason: r.clone(),
394394
path: path.clone(),
395395
linenum: index + 1,
396-
lineindextuples
396+
lineindextuples,
397397
});
398398
}
399399
}
@@ -408,7 +408,7 @@ mod tests {
408408
use std::io::Result;
409409
use std::io::Write;
410410
use std::process::Output;
411-
use tempfile::{tempdir, NamedTempFile, TempDir};
411+
use tempfile::{NamedTempFile, TempDir, tempdir};
412412

413413
fn run_command_in_dir(dir: &TempDir, command: &str, args: &[&str]) -> Result<Output> {
414414
let dir_path = dir.path().to_str().unwrap();

0 commit comments

Comments
 (0)