Skip to content

Comments

Implement static code analysis rule to analyse weak encryption algorithm usage#599

Closed
nureka-rodrigo wants to merge 2 commits intoballerina-platform:masterfrom
nureka-rodrigo:rule-1
Closed

Implement static code analysis rule to analyse weak encryption algorithm usage#599
nureka-rodrigo wants to merge 2 commits intoballerina-platform:masterfrom
nureka-rodrigo:rule-1

Conversation

@nureka-rodrigo
Copy link
Contributor

@nureka-rodrigo nureka-rodrigo commented May 27, 2025

Purpose

Fixes ballerina-platform/ballerina-library#7940

Note

This PR depends on #598

Description

  1. The analyzer is triggered when a FUNCTION_CALL node is encountered in the syntax tree.

  2. It checks for a QualifiedNameReferenceNode with any prefixes used for the crypto module (both default crypto and any custom prefixes) and identifier encryptAesEcb or encryptAesCbc.

  3. On match, the analyzer reports the vulnerability.

Checklist

  • Linked to an issue
  • Updated the changelog
  • Added tests
  • Updated the spec
  • Checked native-image compatibility

@nureka-rodrigo
Copy link
Contributor Author

nureka-rodrigo commented May 27, 2025

Note

This PR depends on #598

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jun 3, 2025

@nureka-rodrigo nureka-rodrigo deleted the rule-1 branch June 18, 2025 06:08
@nureka-rodrigo nureka-rodrigo restored the rule-1 branch June 18, 2025 06:11
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.

Implement static analysis rule "Encryption algorithms should be used with secure mode and padding scheme" in Crypto module

1 participant