2024-03-22 17:05:59 +01:00
|
|
|
:language_std_outputs: std::cout, std::cerr, printf, std::print
|
2023-10-16 20:57:06 +02:00
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
== Why is this an issue?
|
|
|
|
|
2020-06-30 10:16:44 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
2023-10-16 20:57:06 +02:00
|
|
|
=== Code examples
|
|
|
|
|
|
|
|
The following noncompliant code:
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2023-10-16 20:57:06 +02:00
|
|
|
[source,cpp,diff-id=1,diff-type=noncompliant]
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
2023-10-16 20:57:06 +02:00
|
|
|
void doSomething()
|
|
|
|
{
|
|
|
|
// ...
|
|
|
|
std::cout << "My Message"; // Noncompliant
|
|
|
|
// ...
|
|
|
|
}
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
|
|
|
|
2023-10-16 20:57:06 +02:00
|
|
|
Could be replaced by:
|
2020-06-30 10:16:44 +02:00
|
|
|
|
2023-10-16 20:57:06 +02:00
|
|
|
[source,cpp,diff-id=1,diff-type=compliant]
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
2023-10-16 20:57:06 +02:00
|
|
|
void doSomething()
|
|
|
|
{
|
|
|
|
// ...
|
|
|
|
Log().Get(logINFO) << "My Message";
|
|
|
|
// ...
|
|
|
|
}
|
2020-06-30 10:16:44 +02:00
|
|
|
----
|
|
|
|
|
2023-05-03 11:06:20 +02:00
|
|
|
== Resources
|
2021-09-21 15:40:35 +02:00
|
|
|
|
2024-01-15 17:15:56 +01:00
|
|
|
* OWASP - https://owasp.org/Top10/A09_2021-Security_Logging_and_Monitoring_Failures/[Top 10 2021 Category A9 - Security Logging and Monitoring Failures]
|
|
|
|
* OWASP - https://owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[Top 10 2017 Category A3 - Sensitive Data Exposure]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
2021-09-20 15:38:42 +02:00
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../message.adoc[]
|
|
|
|
|
2021-06-08 15:52:13 +02:00
|
|
|
'''
|
2021-06-02 20:44:38 +02:00
|
|
|
== Comments And Links
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
2023-06-22 10:38:01 +02:00
|
|
|
|
2021-06-03 09:05:38 +02:00
|
|
|
endif::env-github,rspecator-view[]
|