Logging successful connections shows only sessions that were allowed through. Logging attempted connections captures both allowed and blocked access, which is more useful for detecting configuration errors, failed authentication, and suspicious probing. For cloud security and compliance, attempted-connection logging provides a fuller control picture because it reveals how the service is being reached, not just who got in.
What each logging approach tells you
Successful-connection logging tells you only that a database session made it past the gate and became active. Attempted-connection logging captures the full request pattern, including denials, failures, and probes. That difference matters because the first view answers “who got in,” while the second answers “who tried, what failed, and what the service exposed on the way in.”
For operational visibility, attempted logging is the stronger control signal. It helps you distinguish routine authentication failures from repeated probing, misconfigured clients, expired credentials, or access paths that should not exist. In cloud environments, that wider view is often the difference between seeing a healthy workload and seeing a noisy perimeter.
Why attempted-connection logs are more useful for investigation
Attempted connections preserve failure context, which is what you need when diagnosing access issues or suspicious behaviour. A successful-only log can hide the fact that many blocked attempts preceded the one allowed session, or that a configuration change suddenly increased failures. If you are trying to understand service reachability, auth friction, or early signs of abuse, the attempted record is the more complete evidence trail.
That fuller record is also better for compliance and control validation. It shows whether blocked access is actually being blocked, whether authentication is failing in expected ways, and whether the system is being reached from unexpected sources. In practice, that makes it easier to prove the control is operating, not just to prove that some sessions eventually succeeded.
Where the difference becomes material in cloud security
In cloud and managed database services, successful-connection logs can understate exposure because they miss rejected traffic, brute-force-style probing, and repeated misconfiguration noise. Attempted-connection logging gives security teams a better basis for tuning network policy, reviewing authentication events, and spotting access patterns that deserve escalation. It also supports correlation with other telemetry, such as firewall events and identity signals, when a database is only one step in a broader attack path.
The practical distinction is that successful logs describe outcome, while attempted logs describe reachability plus control effectiveness. If you only log successes, you may conclude the system is quiet when it is actually being tested, scanned, or misused. If you log attempts, you can measure both the pressure on the control and the behaviour around it.
Risk and Threat Considerations
Logging only successful connections creates blind spots around probing, credential stuffing, misconfiguration, and repeated failed authentication. Those failures are often the earliest signs that a database endpoint is being discovered, tested, or attacked, especially where external exposure is limited but not eliminated.
Failure mechanism: The control records only allowed sessions, so denied requests and failed authentication events disappear from the audit trail. That reduces visibility into attack precursors, weak client configuration, and access control gaps.
Impact: Teams lose the ability to detect abuse patterns early, prove that blocking controls are working, and investigate why connection pressure increased before a successful session appeared.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
CIS Controls v8, NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| CIS Controls v8 | CIS-8 — Audit Log Management | Connection outcomes need auditable logs to detect failures and suspicious access patterns. |
| Recommendation — Collect and review connection-attempt logs to spot denials, failed authentications, and probing. | ||
| NIST SP 800-53 Rev 5 | AU-2 — Event Logging | Database connection attempts are security-relevant events that need defined logging. |
| AU-6 — Audit Record Review, Analysis, and Reporting | Attempt logs support analysis of failed access, anomalies, and suspicious access patterns. | |
| Recommendation — Define and log both successful and attempted access events for the database service. Review failed and denied connection records for anomalies and investigate repeated probing. | ||
| ISO/IEC 27001:2022 | A.8.15 — Logging | Logging control effectiveness depends on capturing both allowed and blocked access attempts. |
| Recommendation — Configure logging to record connection attempts, outcomes, and relevant security context. | ||
| NIST CSF 2.0 | DE.CM-01 — Monitoring for Anomalies and Events | Attempted-connection logs improve monitoring for unusual access behaviour. |
| Recommendation — Monitor attempted connections for unexpected failures, spikes, and probing patterns. | ||
Practitioner Guidance
What to prioritise: Log attempted connections wherever the database is reachable from anything outside a tightly trusted boundary, because that is where failed access attempts carry the most diagnostic and threat value. Successful-only logging is usually too thin for investigation or control assurance.
What to verify: Confirm that the log stream distinguishes success, failure, and denial, and that it preserves enough context to identify source, target, time, and authentication outcome. If those fields are missing, the log may look complete but still be operationally weak.
Common mistake: Treating successful-session logs as an access-control audit trail. They are useful, but they do not show rejected access, which is often the most important evidence when the question is whether the service is being probed or misconfigured.
Practitioner takeaway: If the logging goal is security visibility rather than basic activity reporting, attempted-connection logging is the safer default because it exposes both control failures and attacker or operator behaviour that successful-only logs hide.
Related resources from NHI Mgmt Group
- What is the difference between keeping AI gateway analytics in customer-owned object storage and running a managed logging database in the provider cloud?
- What is the difference between balancing database connections and retrying failed queries in a distributed authorization service?
- What is the difference between logging actions and logging intent for AI agents?
- What is the difference between session logging and audit-ready evidence?