You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tooling.apache.org by "andrewmusselman (via GitHub)" <gi...@apache.org> on 2026/02/19 06:22:16 UTC
[I] Implement authentication failure logging (tooling-trusted-releases)
andrewmusselman opened a new issue, #725:
URL: https://github.com/apache/tooling-trusted-releases/issues/725
**ASVS Reference:** 6.3.1 (Finding MEDIUM-002)
### Description
Authentication failures are not consistently logged with sufficient context for security monitoring. Currently, only successful authentications are recorded in audit logs. Failed PAT validation, failed JWT verification, and failed SSH key authentication produce exceptions but no structured security log entries.
### Affected Code
- `atr/storage/writers/tokens.py` — `issue_jwt()` only logs on success
- `atr/jwtoken.py` — `require` decorator
- `atr/ssh.py` — `validate_public_key()`
### Recommendation
Add structured logging for all authentication failures, including: the targeted `asf_uid` (if available), client IP address, failure reason, and timestamp. This enables security monitoring and incident response.
```python
# Example for PAT failure in tokens.py
if (pat is None) or (pat.expires < datetime.datetime.now(datetime.UTC)):
log.warning(
"Authentication failed",
extra={"asf_uid": self.__asf_uid, "client_ip": quart.request.remote_addr, "reason": "invalid_or_expired_pat"}
)
raise storage.AccessError("Authentication failed")
```
Add separate auth and access logs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org
Re: [I] Implement authentication failure logging (tooling-trusted-releases)
Posted by "alitheg (via GitHub)" <gi...@apache.org>.
alitheg closed issue #725: Implement authentication failure logging
URL: https://github.com/apache/tooling-trusted-releases/issues/725
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tooling.apache.org
For additional commands, e-mail: dev-help@tooling.apache.org