Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker build fails for desktop container #574

Closed
joecasanova opened this issue Aug 26, 2022 · 4 comments
Closed

Docker build fails for desktop container #574

joecasanova opened this issue Aug 26, 2022 · 4 comments

Comments

@joecasanova
Copy link

joecasanova commented Aug 26, 2022

I'm trying to build a docker image based on ubuntu 20.04 desktop for use in Kasm Workspaces.

DISCLAIMER: I honestly do not believe this is an issue with SIFT and more an issue of my inexperience with building such docker containers.

If I try to build using sift-linux-cli it results in an issue with /etc/sift-version with the following output:

Error: Update returned exit code not zero
    at ChildProcess.<anonymous> (/snapshot/sift-cli/sift-cli.js:556:23)
    at ChildProcess.emit (events.js:400:28)
    at maybeClose (internal/child_process.js:1058:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)`

My Dockerfile in that instance looks like:

`FROM kasmweb/core-ubuntu-focal:1.11.0
USER root

ENV HOME /home/kasm-default-profile
ENV STARTUPDIR /dockerstartup
ENV INST_SCRIPTS $STARTUPDIR/install
WORKDIR $HOME

######### Customize Container Here ###########

RUN  wget https://github.com/teamdfir/sift-cli/releases/download/v1.14.0-rc1/sift-cli-linux https://github.com/teamdfir/sift-cli/releases/download/v1.14.0-rc1/sift-cli-linux.sig https://github.com/teamdfir/sift-cli/releases/download/v1.14.0-rc1/sift-cli.pub https://github.com/sigstore/cosign/releases/download/v1.11.1/cosign_1.11.1_amd64.deb \
    && dpkg -i cosign_1.11.1_amd64.deb \
    && cosign verify-blob --key sift-cli.pub --signature sift-cli-linux.sig sift-cli-linux \
    && mv sift-cli-linux /usr/local/bin/sift \
    && chmod 755 /usr/local/bin/sift \
    && apt install sudo 

######### End Customizations ###########

RUN chown 1000:0 $HOME
RUN $STARTUPDIR/set_user_permission.sh $HOME

ENV HOME /home/kasm-user
WORKDIR $HOME
RUN mkdir -p $HOME && chown -R 1000:0 $HOME

RUN sudo /usr/local/bin/sift install --user=kasm-user

USER 1000

With a pretty vanilla docker build:

sudo docker build -t sift-workstation:latest -f Dockerfile .

If I comment out the sift install line in the Dockerfile and then run that command inside a session of that running image I get the same issue. It seems to be an issue with the use of timedatectl looking for init. I get the following error message when I try to run timedatectl within the container:

System has not been booted with systemd as init system (PID 1). Can't operate. Failed to create bus connection: Host is down

If I set --mode=server the install process works fine however my analysts are looking for the desktop flavor. (I'm not familiar with the intricacies of SIFT - just the guy who builds platforms/tools/solutions for analysts to use - but absolutely willing to learn.)

I also tried performing the manual install via SIFT from here: https://github.com/teamdfir/sift-saltstack

However, and I could be mistaken with my interpretation here, but it appears the instructions may be outdated as the repo URLs are no longer available - they have switched to something like "https://repo.saltproject.io/py3/ubuntu/20.04/amd64/3004/SALTSTACK-GPG-KEY.pub". But when I try 3004, which SIFT 1.14.0-rc1 references in the diff between it and 1.13, I receive several errors which research indicates a version mismatch between SIFT and salt.

I feel like I'm close but scraping the bottom of the barrel and could use some assistance from someone who objectively know better than I.

@digitalsleuth
Copy link

Hi @joecasanova , I've actually got a sift Dockerfile created which you should be able to modify for your purposes, but I haven't updated it recently for Saltstack 3004. If you give me an hour I can have it finished for you. You can find it here when it's done. Alternatively, I also have one which has SIFT and REMnux as well here. I'll let you know when they're updated!

@digitalsleuth
Copy link

Hi @joecasanova , I was just re-reading your original message and realized I skipped over the error message you provided. The message occurs because the operating system within the docker container doesn't run with system level operation, and as such cannot run system-level commands such as timedatectl. Your best bet to set the timezone might be to set it manually using configuration files.

As for the errors between the two SIFT CLI versions, if you're still encountering those with the Dockerfile I provided, let me know and I'll help you out with resolving that as well.

@digitalsleuth
Copy link

Hi @joecasanova , just checking in to see how things have progressed with this.

@ekristen
Copy link
Contributor

ekristen commented Feb 1, 2023

Closing due to stale.

@ekristen ekristen closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants