Repository navigation
Add expired_tls_hotel_reservation problem - #784
Conversation
- Added expired_tls_hotel_reservation.py which is the main python script that simulates the expired TLS failure - Added a new mitigation oracle since the default MitigationOracle was insufficient for this failure - Updated registry.py to reflect the new problem added to the benchmark - fixed small issue in cli.py which caused the command line interface to crash whenever 'enter' was pressed with no additional text
|
@gAngelov24 Thanks for the PR! I will try to review it by tomorrow.
Definitely a bug. Good catch! |
There was a problem hiding this comment.
@gAngelov24 Thanks for the effort! I left some comments below.
I am not sure if this fault is working correctly right now. The major issue I found is that IngressNginx().deploy() is missing from inject_fault.
the NGINX Ingress controller logs chow certificate validation errors
What controller did you mean by this? I don't think one is getting deployed currently. There is no ingress-nginx namespace or any Ingress controller running in the cluster.
Requests to https://hotel.local result in a failed TLS handshake
I wasn't able to reproduce this either. hotel.local doesn't resolve, and without a running Ingress controller, nothing is serving TLS on that hostname.
Can you please share the commands you used to test these claims and the logs they're based on? Not sure if I am missing something here.
Feel free to ping us if you have any questions or confusions!
8f443d4 to
4a436dd
Compare
|
Okay, I addressed all the issues you had commented on. I changed variable names to be more realistic, I made the oracle inherit from the base oracle, and I fixed the fault so that NGINX controller reads the expired certificate. Terminal 2: Now, you should be able to see that the certificate being used by the NGINX is expired. The openssl command should output something like this: The notAfter date in the past proves the expired cert is being served to clients rather than the NGINX default fallback. |
|
@gAngelov24 Thanks for addressing my comments! The fault is working correctly now. Also, @gAngelov24 and @gAngel28 I got confused for a moment XD |
|
WoW!! This is awesome! Congrats!! |
|
On a side note, agents really suffer in this problem. They get lost in the app namespace chasing random stuff and never checks the |
|
@Saadmrp1038 I feel you have so much materials to write another research paper :))
Bingo! |
* Add expired_tls_hotel_reservation problem - Added expired_tls_hotel_reservation.py which is the main python script that simulates the expired TLS failure - Added a new mitigation oracle since the default MitigationOracle was insufficient for this failure - Updated registry.py to reflect the new problem added to the benchmark - fixed small issue in cli.py which caused the command line interface to crash whenever 'enter' was pressed with no additional text * Fix: add IngressNginx deploy, fix secret name, fix oracle inheritance --------- Co-authored-by: Saad Mohammad Rafid Pial <saadmrp222@gmail.com>
* Add expired_tls_hotel_reservation problem - Added expired_tls_hotel_reservation.py which is the main python script that simulates the expired TLS failure - Added a new mitigation oracle since the default MitigationOracle was insufficient for this failure - Updated registry.py to reflect the new problem added to the benchmark - fixed small issue in cli.py which caused the command line interface to crash whenever 'enter' was pressed with no additional text * Fix: add IngressNginx deploy, fix secret name, fix oracle inheritance --------- Co-authored-by: Saad Mohammad Rafid Pial <saadmrp222@gmail.com>
Real-World Failure
An expired TLS certificates are an extremely common cause of system outages. Unlike most failures, they are completely predictable since every certificate has a know expiry date; however, they still manage to take down major services. I previously mentioned in issue #763 some large cases where this has happened.
How I Simulated The Failure
The fault is injected into the Hotel Reservation app on its
hotel-reservationnamespace. The simulation required two additional Kubernetes resources:cryptographylibrary. At first I thought to use OpenSSL to generate the certificate however that library is strict about the date you set and wouldn't allow me to create an already expire certificate.frontend-ingress) which is applied to the namespace. It references the expired secret via the standard Kubernetes TLS Ingress configuration.Like I stated above, I used Pythons
cryptographypackage to generate the expired x509 certificate, and to parse thetls.crtPEM bytes from the Kubernetes Secret in order to read thenot_valid_after_utc.In order to use it I ran:
If not installed, both the
inject_faultand the oracle's_get_cert_expirymethods log anImportErrorwith the fix command rather than producing a confusing traceback.Problem Runtime
After the
inject_fault()runs, the cluster has the following observable state:Kubernetes resources:
Certificate:
Pod health:
HTTPS Behaviour:
https://hotel.localresult in a failed TLS handshakessl-redirect: "true"infrontend-ingress) so there are no unencrypted fallback paths. Any path will be affected.The challenge for an AI agent is that at first glance everything seems to be working:
kubectl get pods -Ashows all greenIn order to find the underlying issue, the agent must specifically inspect the Ingress TLS configuration then cross reference the secret, and finally decode and inspect the certificate inside the secret.
Oracle Behavior
Before I get into Agent behavior, I want to talk about the new Oracle I had to design in order for this failure to work as expected. The default
MitigationOraclechecks pod health, which in this case is always fine since the expired TLS certificate does not affect pod health.Therefore I made
ExpiredTlsMitigationOracleto inspect the frontend Ingress at submission time and checks the expiry of any TLS secret it references. It will accept any of the following as valid mitigations: deleting the Ingress, deleting the secret, removing the TLS block from the Ingress, or replacing the secret with a valid certificate.It will reject the submission if any referenced secret still contains an expired certificate.
I tested it in both cases:
submit()with failure active:success: false,"Secret 'expired-frontend-cert' still contains a certificate that expired on <timestamp>"submit()after removing the Ingress and secret:success: true,"frontend-ingress has been deleted — mitigation accepted"The Agent Behavior
Human Agent (me):
While I may have had some insider information about the problem, I was able to diagnose the issue and resolve it. I ran the following command to diagnose the failure:
This showed me the
frontend-ingressreferencing theexpired-frontend-certyou could then inspect the cert to verify it is expired. Then I ran:This way I deleted the Ingress and secret to mitigate the failure.
AI Agent (Stratus,
gemini/gemini-3.1-flash-lite)The AI agent failed both stages across multiple attempts. During diagnosis, it checked the Jaeger for telemtry traces, found none, and submitted an incorrect root cause about services not sending data to Jaeger. Then, during mitigation, the agent read the frontend logs and found
connection refusederrors from the frontend trying to reach Consul. These errors are normal and go away on their own. It spent all 20 steps investing this error and never rankubectl get ingress -n hotel-reservationNote: Testing was also attempted with gemini/gemini-2.5-flash but hit the free-tier rate limit (5 RPM, 20 RPD). gemini/gemini-3.1-flash-lite was used for all completed runs.
Additional Change
Outside of the actual problem, I noticed that whenever I pressed enter without a prompt in the CLI, it would crash. I added a check that way anytime you press enter, whether on accident or not, the CLI doesn't just crash. If that was a feature and not a bug let me know I will remove that addition.
/validate-problem expired_tls_hotel_reservation