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

Update builder image and fix CI target for bandit #5749

Merged
merged 4 commits into from
Jan 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,13 @@ jobs:
name: Check Python dependencies for CVEs
command: |
fromtag=$(docker images |grep securedrop-test-xenial-py3 |head -n1 |awk '{print $2}')
DOCKER_BUILD_ARGUMENTS="--cache-from securedrop-test-xenial-py3:${fromtag:-latest}" securedrop/bin/dev-shell bash -c "sudo pip3 install -q --upgrade safety && make -C .. safety"
DOCKER_BUILD_ARGUMENTS="--cache-from securedrop-test-xenial-py3:${fromtag:-latest}" securedrop/bin/dev-shell bash -c "pip3 install -U -q --upgrade safety && make -C .. safety"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-U is redundant with --upgrade already in the task list. Seems like it's lack of sudo privileges that would have resolved #5748. Not a blocker, since today is release day and CI runs take a long time, just pointing it out in case I'm missing something.

- run:
name: Run static security testing on source code
command: |
fromtag=$(docker images |grep securedrop-test-xenial-py3 |head -n1 |awk '{print $2}')
DOCKER_BUILD_ARGUMENTS="--cache-from securedrop-test-xenial-py3:${fromtag:-latest}" securedrop/bin/dev-shell bash -c "sudo pip3 install -q --upgrade pip && sudo pip3 install -q --upgrade bandit && make -C .. bandit"
DOCKER_BUILD_ARGUMENTS="--cache-from securedrop-test-xenial-py3:${fromtag:-latest}" securedrop/bin/dev-shell bash -c "pip3 install -U -q --upgrade pip && pip3 install -U -q --upgrade bandit && make -C .. bandit"
staging-test-with-rebase:
Expand Down
6 changes: 2 additions & 4 deletions molecule/builder-focal/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ RUN apt-get -y update && apt-get upgrade -y && apt-get install -y \

# TEMPORARY: install dh-virtualenv from debian unstable, pending focal package:
# https://github.com/spotify/dh-virtualenv/issues/298
RUN echo "deb https://deb.debian.org/debian unstable main contrib" > /etc/apt/sources.list.d/debian-unstable.list
COPY aptpreferences.conf /etc/apt/preferences.d/debian-unstable
RUN apt-get install -y debian-archive-keyring
RUN ln -s /usr/share/keyrings/debian-archive-keyring.gpg /etc/apt/trusted.gpg.d/
RUN echo "deb http://archive.ubuntu.com/ubuntu/ groovy universe" > /etc/apt/sources.list.d/ubuntu-groovy.list
COPY aptpreferences.conf /etc/apt/preferences.d/ubuntu-groovy

RUN apt-get update && apt-get install -y dh-virtualenv

Expand Down
2 changes: 1 addition & 1 deletion molecule/builder-focal/aptpreferences.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Pin: release a=focal
Pin-Priority: 700

Package: *
Pin: release a=unstable
Pin: release a=groovy
Pin-Priority: 1
4 changes: 2 additions & 2 deletions molecule/builder-focal/image_hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# sha256 digest quay.io/freedomofpress/sd-docker-builder-focal:2020_09_11
10d4b7f28a3de6f2bd9e6a55dd5fdb448fb90442d15a013f73942b4d2e5ce259
# sha256 digest quay.io/freedomofpress/sd-docker-builder-focal:2021_01_26
60436817a1e7a2b1f2abe19ef456b73e0b6e6d4064f2edb27e1ae0da3fcccef3
4 changes: 2 additions & 2 deletions molecule/builder-xenial/image_hash
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# sha256 digest quay.io/freedomofpress/sd-docker-builder-xenial:2020_10_07
35b70776cf5139ed2c597063579d74f0458416e4cbbe443bfebef2596ce5a48c
# sha256 digest quay.io/freedomofpress/sd-docker-builder-xenial:2021_01_26
f17105ea2618621d2de42ee6ef4d2cff507845fbf4d26581581bcf7c99d47217