Enhance documentation regarding trivy server and redis cache use in the server and client #7528
Replies: 7 comments 3 replies
-
|
I can help with the writing, but would need some insights from the team and other users. |
Beta Was this translation helpful? Give feedback.
-
|
Perhaps a short enhancement note on both the client/server, redis and DB pages regarding the java DB. I see that the Java DB note mentions a little bit how the workload is distributed - https://aquasecurity.github.io/trivy/v0.55/docs/configuration/db/#java-index-database |
Beta Was this translation helpful? Give feedback.
-
|
https://aquasecurity.github.io/trivy/v0.55/docs/references/modes/client-server/ have a section on which scans runs server side, and which scans runs client side. This could also be a good place to outline where a redis / external cache fits in with a client/server setup. |
Beta Was this translation helpful? Give feedback.
-
|
The |
Beta Was this translation helpful? Give feedback.
-
|
Redis: rm -rf ~/tmp/redis &&
mkdir -p ~/tmp/redis &&
(docker stop trivy-backend ; docker rm trivy-backend) >/dev/null 2>&1 ;
docker run --publish 6379:6379 --name trivy-backend --detach redis:7-alpineTrivy server: rm -rf ~/tmp/trivy &&
mkdir -p ~/tmp/trivy &&
trivy server --listen 127.0.0.1:8080 --token foobar --cache-dir $HOME/tmp/trivy --cache-backend redis://localhost:6379 --cache-ttl 10m --debugIn another shell # Observe that we have 500Mb + downloaded
ls -l ~/tmp/trivy/db
du -hs ~/tmp/trivy/db
# ...and no new keys in the redis backend
redis-cli keys "*" |
Beta Was this translation helpful? Give feedback.
-
|
Hello @sastorsl, there is something that I don't understand with the response from the example request from the client/server documentation page: https://trivy.dev/docs/latest/references/modes/client-server/#version. Why does it return trivy/pkg/rpc/server/listen_test.go Line 220 in fa195b4 I find this line in the documentation a bit confusing.
Isn't this only possible if the server and the client are running on the same machine as they would share the same cache directory? From my understanding java db and checks bundle repositories are downloaded from the client side (and not served by the Trivy server). Is this correct? |
Beta Was this translation helpful? Give feedback.
-
|
If running in server/client mode, is the in-memory cache used by default? If that is the case, I would assume the caches would all be empty/cold when a server is restarted. What would happen if we set the server to use a FS cache where the location is a persistent volume? would the client/server setup then lose its benefit because the FS based cache only allows single user access at a time? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
With regards to client, server and redis cache it would be good to enhance the documentation to explain better what is handled where.
I.e. the Java DB cache is now client side only, re #3560, and with many builds it is of assistanse to have a redis cache backend.
But it is not crystal clear what then is the benefit of having a
trivy serverin addition.Link
Suggestions
Document use cases:
trivy serverhelpstrivy serverdocumentation.Beta Was this translation helpful? Give feedback.
All reactions