Skip to content

rust programing detecterlib added#26

Open
syzabeer wants to merge 1 commit intoaws-samples:mainfrom
syzabeer:rustdetecterlib
Open

rust programing detecterlib added#26
syzabeer wants to merge 1 commit intoaws-samples:mainfrom
syzabeer:rustdetecterlib

Conversation

@syzabeer
Copy link
Copy Markdown

added rust detecter library test cases for completed rules

*/

// {fact rule=insecure-hashing@v1.0 defects=0}
// Compliant: secured hasing algorithm `Sha256` used
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct the Hashing spell "Secure hashing algorithm SHA256 used"

*/

// {fact rule=os-command-injection@v1.0 defects=0}
// Compliant: string arguments instead of user input
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String arguments instead of user input

*/

// {fact rule=untrusted-data-in-decision@v1.0 defects=1}
// Noncompliant: Insecure hashing algorithm `Md2` used
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insecure due to the potential for arbitrary user input, non-existent file paths, and unreliable data

*/

// {fact rule=insecure-connection@v1.0 defects=0}
// Compliant: Used suppaftp for connection
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of suppaftp for connection

*/

// {fact rule=untrusted-data-in-decision@v1.0 defects=0}
// Compliant: secured hasing algorithm `Sha256` used
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use of external crates and creating CLI applications with clap


fn vulnerable_remove_dir_all(dir_path: &str) {
if fs::metadata(dir_path).unwrap().is_dir() {
// ruleid: rust-race-condition-remove-dir-all
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line "// ruleid: rust-race-condition-remove-dir-all"

*/

// {fact rule=incorrect-conversion-of-numeric-types@v1.0 defects=0}
// Compliant: verify that the resulting rounded value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recheck this sentence, unclear what you wanted to conevey

*/

// {fact rule=incorrect-conversion-of-numeric-types@v1.0 defects=1}
// Noncompliant: not verify that the resulting rounded value
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recheck this sentence, unclear what you wanted to conevey

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants