future-architect/vuls


Do you want to work on this issue?
You can request for a bounty in order to promote it!
'.vuls' directory as XDG_CACHE_HOME #1020
jirib posted onGitHub
What did you do?
I do not run Vuls container as root but I defined XDG_CACHE_HOME variable (as other Vuls components honor it).
What did you expect to happen?
Vuls scan would use XDG_CACHE_HOME as a replacement for its '.vuls' in $HOME.
What happened instead?
Permission denied.
- Current Output
/vuls $ vuls scan -config=/vuls/config.toml
[Jul 15 09:36:02] ERROR [localhost] Failed to create .vuls. err: mkdir /.vuls: permission denied
/vuls $ echo $HOME
/
/vuls $ echo $XDG_CACHE_HOME
/cache
Steps to reproduce the behaviour
# docker run --rm -it --entrypoint=/bin/ash \
-v /data/vuls/data:/vuls \
-v /data/vuls/vuls-log:/var/log/vuls \
-v /data/vuls/config.toml:/vuls/config.toml:ro \
-v /etc/localtime:/etc/localtime:ro \
-u <<some uid>>:<<some gid>> \
--mount type=tmpfs,destination=/cache,tmpfs-mode=1777 \
-e XDG_CACHE_HOME=/cache 5803c81b028c
$ vuls scan -config=/vuls/config.toml
- Vuls environment:
# docker inspect 5803c81b028c | jq '.[].RepoDigests'
[
"vuls/vuls@sha256:e39edb92833e7d6f6490620e11221f1a456ca2dec4f5f3ab1c15e12c75ecdcbb"
]
$ vuls -v
$ vuls -v
vuls v0.10.0 build-20200703_050746_11a7a0c