File tree Expand file tree Collapse file tree 5 files changed +24
-15
lines changed Expand file tree Collapse file tree 5 files changed +24
-15
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -o errexit
4
4
5
- source ./.evergreen/env.sh
6
-
7
- . ${DRIVERS_TOOLS} /.evergreen/find-python3.sh
8
- PYTHON=$( find_python3)
5
+ if [ -t 0 ] ; then
6
+ # Interactive shell
7
+ PYTHON3=${PYTHON3:- " python3" }
8
+ else
9
+ # Evergreen run (probably)
10
+ source ./.evergreen/env.sh
11
+ source ${DRIVERS_TOOLS} /.evergreen/find-python3.sh
12
+ PYTHON3=$( find_python3)
13
+ fi
9
14
10
15
if [[ -f " semgrep/bin/activate" ]]; then
11
- echo ' using existing virtualenv'
16
+ echo ' Using existing virtualenv... '
12
17
. semgrep/bin/activate
13
18
else
14
- echo ' Creating new virtualenv'
15
- ${PYTHON } -m venv semgrep
16
- echo ' Activating new virtualenv'
19
+ echo ' Creating new virtualenv... '
20
+ ${PYTHON3 } -m venv semgrep
21
+ echo ' Activating new virtualenv... '
17
22
. semgrep/bin/activate
23
+ echo ' Installing semgrep...'
18
24
python3 -m pip install semgrep
19
25
fi
20
26
27
+ # Show human-readable output
28
+ semgrep --config p/rust --error
21
29
# Generate a SARIF report
22
- semgrep --config p/rust --sarif > mongo-rust-driver.json.sarif
23
- # And human-readable output
24
- semgrep --config p/rust --error
30
+ semgrep --config p/rust --quiet --sarif -o sarif.json
Original file line number Diff line number Diff line change @@ -12,4 +12,6 @@ Cargo.lock
12
12
# we install cargo and rustup in the project directory on Evergreen.
13
13
.cargo
14
14
.rustup
15
- mongocryptd.pid
15
+ mongocryptd.pid
16
+ semgrep /
17
+ sarif.json
Original file line number Diff line number Diff line change 1
1
benchmarks/
2
- src/test/
2
+ src/test/
3
+ etc/
Original file line number Diff line number Diff line change @@ -317,7 +317,7 @@ impl ScramVersion {
317
317
let normalized_password = match self {
318
318
ScramVersion :: Sha1 => {
319
319
// nosemgrep: insecure-hashes
320
- let mut md5 = Md5 :: new ( ) ;
320
+ let mut md5 = Md5 :: new ( ) ; // mongodb rating: No Fix Needed
321
321
md5. update ( format ! ( "{}:mongo:{}" , username, password) ) ;
322
322
Cow :: Owned ( hex:: encode ( md5. finalize ( ) ) )
323
323
}
Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ fn make_rustls_config(cfg: TlsOptions) -> Result<rustls::ClientConfig> {
143
143
144
144
if let Some ( true ) = cfg. allow_invalid_certificates {
145
145
// nosemgrep: rustls-dangerous
146
- config
146
+ config // mongodb rating: No Fix Needed
147
147
. dangerous ( )
148
148
. set_certificate_verifier ( Arc :: new ( NoCertVerifier { } ) ) ;
149
149
}
You can’t perform that action at this time.
0 commit comments