Conversation
…BTechLab/uid2-operator into ccm-UID2-6489-add-sync-fix-time-drift
…ator into ccm-UID2-6489-drift
…ator into ccm-UID2-6489-drift
…ator into ccm-UID2-6489-drift
scripts/aws/entrypoint.sh
Outdated
| fi | ||
| } | ||
|
|
||
| start_time_sync_loop() { |
There was a problem hiding this comment.
I feel this is a bit complex.
Why not something much simpler like
sync_enclave_time() {
curl -s -f -x socks5h://127.0.0.1:3305 "${TIME_SYNC_URL}" | xargs -I{} date -u -s "{}"
}
Trust the parent instance clock without the condition ?
scripts/aws/entrypoint.sh
Outdated
|
|
||
| start_time_sync_loop() { | ||
| while true; do | ||
| sleep "${TIME_SYNC_INTERVAL_SECONDS}" |
There was a problem hiding this comment.
suggest using cron. Python sleep is process based, if process crashes (this process running, isn't a requirement for our enclave), it stops.
Using cron on systemd timer would be better IMO
There was a problem hiding this comment.
Updated to cronjob
| name: nmap-ncat | ||
| state: latest | ||
|
|
||
| - name: Install chrony for time sync |
There was a problem hiding this comment.
I am not sure if we need this. This AMI is the parent instance which already has time sync configured with AWS time server
…ator into ccm-UID2-6489-drift
…ator into ccm-UID2-6489-drift
| dest: /etc/cron.d/uid2-time-sync | ||
| mode: "0644" | ||
| content: | | ||
| 0 0 * * * root /usr/local/bin/uid2-time-sync |
There was a problem hiding this comment.
/usr/local/bin/uid2-time-sync
what's that ? how do you get that? (I would suggest creating that over your implementation of adding start_time_sync_server in entrypoint.sh (cleaner)
…ator into ccm-UID2-6489-drift
Correct the time drift once a day
For testing, I added a function to manually changed the time and use the cron job to set it back.
Test:

Cron job in enclave:
Cronjob in host (out of date):
Previous python version: