Rule Definition
The purpose of custom exception type is to provide information on the error when that cannot be provided using standard exception types.
If these custom exception types are made private or internal the purpose of having them itself is not served.
Remediation
Define custom exception types as Public
Violation Code Sample
internal class MyException : Exception // violation
{
// ...
}
Fixed Code Sample
public class MyException : Exception
{
// ...
}
Reference
OWASP 2017-A10- Insufficient Logging and Monitoring
https://owasp.org/www-project-top-ten/2017/A10_2017-Insufficient_Logging%2526Monitoring
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1064
Related Technologies
Technical Criterion
CWE-778 - Insufficient Logging
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.