CWE-778: Insufficient Logging (Base)

Description: When a security-critical event occurs, the product either does not record the event or omits important details about the event when logging it.

Extended Description: When security-critical events are not logged properly, such as a failed login attempt, this can make malicious behavior more difficult to detect and may hinder forensic analysis after an attack succeeds. As organizations adopt cloud storage resources, these technologies often require configuration changes to enable detailed logging information, since detailed logging can incur additional costs. This could lead to telemetry gaps in critical audit logs. For example, in Azure, the default value for logging is disabled.



Applicable Platforms: ::LANGUAGE CLASS:Not Language-Specific:LANGUAGE PREVALENCE:Undetermined::TECHNOLOGY CLASS:Cloud Computing:TECHNOLOGY PREVALENCE:Undetermined::

Modes of Introduction: ::PHASE:Operation:NOTE:COMMISSION: This weakness refers to an incorrect design related to an architectural security tactic.::



Common Consequences: ::SCOPE:Non-Repudiation:IMPACT:Hide Activities:NOTE:If security critical information is not recorded, there will be no trail for forensic analysis and discovering the cause of problems or the source of attacks may become more difficult or impossible.::

Detection Methods: ::METHOD:Automated Static Analysis:DESCRIPTION:Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect sources (origins of input) with sinks (destinations where the data interacts with external components, a lower layer such as the OS, etc.):EFFECTIVENESS:High::

Potential Mitigations: ::PHASE:Architecture and Design:DESCRIPTION:Use a centralized logging mechanism that supports multiple levels of detail.::PHASE:Implementation:DESCRIPTION:Ensure that all security-related successes and failures can be logged. When storing data in the cloud (e.g., AWS S3 buckets, Azure blobs, Google Cloud Storage, etc.), use the provider's controls to enable and capture detailed logging information.::PHASE:Operation:DESCRIPTION:Be sure to set the level of logging appropriately in a production environment. Sufficient data should be logged to enable system administrators to detect attacks, diagnose errors, and recover from attacks. At the same time, logging too much data (CWE-779) can cause the same problems, including unexpected costs when using a cloud environment.::PHASE:Operation:DESCRIPTION:To enable storage logging using Azure's Portal, navigate to the name of the Storage Account, locate Monitoring (CLASSIC) section, and select Diagnostic settings (classic). For each of the various properties (blob, file, table, queue), ensure the status is properly set for the desired logging data. If using PowerShell, the Set-AzStorageServiceLoggingProperty command could be called using appropriate -ServiceType, -LoggingOperations, and -RetentionDays arguments.::

Observed Examples: ::REFERENCE:CVE-2008-4315:DESCRIPTION:server does not log failed authentication attempts, making it easier for attackers to perform brute force password guessing without being detected:LINK:https://www.cve.org/CVERecord?id=CVE-2008-4315::REFERENCE:CVE-2008-1203:DESCRIPTION:admin interface does not log failed authentication attempts, making it easier for attackers to perform brute force password guessing without being detected:LINK:https://www.cve.org/CVERecord?id=CVE-2008-1203::REFERENCE:CVE-2007-3730:DESCRIPTION:default configuration for POP server does not log source IP or username for login attempts:LINK:https://www.cve.org/CVERecord?id=CVE-2007-3730::REFERENCE:CVE-2007-1225:DESCRIPTION:proxy does not log requests without http:// in the URL, allowing web surfers to access restricted web content without detection:LINK:https://www.cve.org/CVERecord?id=CVE-2007-1225::REFERENCE:CVE-2003-1566:DESCRIPTION:web server does not log requests for a non-standard request type:LINK:https://www.cve.org/CVERecord?id=CVE-2003-1566::