Yes, this is possible.
In essence you need to verify the signature (digest vmod), pick out the timestamp from whatever header it is in (regsub), and compare it to the current time.
Use std.integer()
to cast the timestamp:
https://www.varnish-cache.org/docs/trunk/reference/vmod_std.html#integer
use the built in now
variable in VCL to find the current timestamp. You might want to do (now + 0s)
to force Varnish to give you a unix timestamp.
https://www.varnish-cache.org/docs/trunk/reference/vcl.html#variables
The digest vmod is on github:
https://github.com/varnish/libvmod-digest