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

Build, sign, and publish packages and docker images automatically #1059

Merged
merged 33 commits into from
Feb 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
580c915
new(.circleci): initial job to publish deb package
leodido Feb 25, 2020
85af750
chore(docker,cmake,scripts): correct maintainers email
leodido Feb 25, 2020
2182b57
fix(.circleci): version + xenial
leodido Feb 26, 2020
26f2c9d
fix(.circleci): obtain FALCO_VERSION without executing Falco
leodido Feb 26, 2020
aa13ec6
update(cmake/modules): declare cpack version component variables
leodido Feb 26, 2020
e70378b
fix(.circleci): specify target path for deb packages
leodido Feb 26, 2020
2ededc8
new(.circleci): publish packages for rpm, debian stretch, debian sid,…
leodido Feb 26, 2020
c998292
fix(.circleci): push to deb-dev and rpm-dev
leodido Feb 26, 2020
d9e8083
new(.circleci): release stable packages from git tags
leodido Feb 26, 2020
d33d003
update(.circleci): publish packages only from master
leodido Feb 26, 2020
b447a34
new(.circleci): debug build on ubuntu bionic (CI)
leodido Feb 26, 2020
31a7672
new(.circleci): run the debug build on centos7 on CI (USE_BUNDLED_DEP…
leodido Feb 26, 2020
5020972
update(docker/rhel): using the new falcosecurity repo and falcosecuri…
leodido Feb 26, 2020
bdffe66
update(docker): slim images to use falcosecurity new repo and new GPG…
leodido Feb 26, 2020
2c7b582
new(.circleci): publish binary distributions (tar.gz)
leodido Feb 27, 2020
ce4f834
update(docker/minimal): download falco binary
leodido Feb 27, 2020
398ee3a
update(docker/stable): use the falcosecurity deb repo
leodido Feb 27, 2020
f3f7573
fix(docker): falcosecurity sources list
leodido Feb 27, 2020
4ba4a88
update(docker/stable): use the new debian packages infrastructure
fntlnz Feb 27, 2020
dd490c5
new(docker): update local to use our own repositories
fntlnz Feb 27, 2020
980579b
new(docker/dev): update local dockerfile to use our own repositories
fntlnz Feb 27, 2020
a9d417c
new(.circleci): build and publish docker images (skeleton)
leodido Feb 27, 2020
765c6ae
update(.circleci): create version before uploading it
leodido Feb 27, 2020
b8b87dd
update(.circleci): split run steps for publishing artifacts
leodido Feb 28, 2020
a5ca00c
fix(.circleci): bintray auth for version creation
leodido Feb 28, 2020
e2cfbf8
new(.circleci): sign rpm packages
fntlnz Feb 28, 2020
63a2951
new(.circleci): rpm sign for release workflow too
leodido Feb 28, 2020
0469904
fix(.circleci): rpmsign needs enter for empty passphrases
leodido Feb 28, 2020
9c1ba75
fix(.circleci): expect script needs eof
leodido Feb 28, 2020
7a28015
update(docker): reorganize docker images with build arguments
leodido Feb 28, 2020
8e52b36
new(.circleci): build and publish docker images
leodido Feb 28, 2020
4e5075c
fix(.circleci): sign RPMs
leodido Feb 28, 2020
9ff7408
update(.circleci): build and publish from master
leodido Feb 28, 2020
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
252 changes: 252 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,38 @@ jobs:
pushd build
make tests
popd
# Debug build using ubuntu LTS
# This build is dynamic, most dependencies are taken from the OS
"build/ubuntu-bionic-debug":
docker:
- image: ubuntu:bionic
steps:
- checkout
- run:
name: Update base image
command: apt update -y
- run:
name: Install dependencies
command: apt install libssl-dev libyaml-dev libncurses-dev libc-ares-dev libprotobuf-dev protobuf-compiler libjq-dev libyaml-cpp-dev libgrpc++-dev protobuf-compiler-grpc rpm linux-headers-$(uname -r) libelf-dev cmake build-essential libcurl4-openssl-dev -y
- run:
name: Prepare project
command: |
mkdir build
pushd build
cmake -DCMAKE_BUILD_TYPE=debug ..
popd
- run:
name: Build
command: |
pushd build
make -j4 all
popd
- run:
name: Run unit tests
command: |
pushd build
make tests
popd
# Build using our own builder base image using centos 7
# This build is static, dependencies are bundled in the falco binary
"build/centos7":
Expand Down Expand Up @@ -69,6 +101,28 @@ jobs:
- store_artifacts:
path: /tmp/packages
destination: /packages
# Debug build using our own builder base image using centos 7
# This build is static, dependencies are bundled in the falco binary
"build/centos7-debug":
docker:
- image: falcosecurity/falco-builder:latest
environment:
BUILD_TYPE: "debug"
steps:
- checkout:
path: /source/falco
- run:
name: Prepare project
command: /usr/bin/entrypoint cmake
- run:
name: Build
command: /usr/bin/entrypoint all
- run:
name: Run unit tests
command: /usr/bin/entrypoint tests
- run:
name: Build packages
command: /usr/bin/entrypoint package
# Execute integration tests based on the build results coming from the "build/centos7" job
"tests/integration":
docker:
Expand All @@ -84,12 +138,210 @@ jobs:
- run:
name: Execute integration tests
command: /usr/bin/entrypoint test
# Sign rpm packages
"rpm/sign":
docker:
- image: falcosecurity/falco-builder:latest
steps:
- attach_workspace:
at: /
- run:
name: Install rpmsign
command: |
yum update -y
yum install rpm-sign -y
- run:
name: Sign rpm
command: |
echo "%_signature gpg" > ~/.rpmmacros
echo "%_gpg_name Falcosecurity Package Signing" >> ~/.rpmmacros
cd /build/release/
echo '#!/usr/bin/expect -f' > sign
echo 'spawn rpmsign --addsign {*}$argv' >> sign
echo 'expect -exact "Enter pass phrase: "' >> sign
echo 'send -- "\n"' >> sign
echo 'expect eof' >> sign
chmod +x sign
echo $GPG_KEY | base64 -d | gpg --import
./sign *.rpm
test "$(rpm -qpi *.rpm | awk '/Signature/' | grep -i none | wc -l)" -eq 0
- persist_to_workspace:
root: /
paths:
- build/release/*.rpm
# Publish the packages
"publish/packages-dev":
docker:
- image: docker.bintray.io/jfrog/jfrog-cli-go:latest
steps:
- attach_workspace:
at: /
- run:
name: Create versions
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt vc falcosecurity/deb-dev/falco/${FALCO_VERSION} --desc="Falco (master)" --github-rel-notes=CHANGELOG.md --released=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") --vcs-tag=${CIRCLE_SHA1} --user poiana --key ${BINTRAY_SECRET}
jfrog bt vc falcosecurity/rpm-dev/falco/${FALCO_VERSION} --desc="Falco (master)" --github-rel-notes=CHANGELOG.md --released=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") --vcs-tag=${CIRCLE_SHA1} --user poiana --key ${BINTRAY_SECRET}
jfrog bt vc falcosecurity/bin-dev/falco/${FALCO_VERSION} --desc="Falco (master)" --github-rel-notes=CHANGELOG.md --released=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") --vcs-tag=${CIRCLE_SHA1} --user poiana --key ${BINTRAY_SECRET}
- run:
name: Publish deb-dev
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.deb falcosecurity/deb-dev/falco/${FALCO_VERSION} stable/ --deb stable/main/amd64 --user poiana --key ${BINTRAY_SECRET} --publish
- run:
name: Publish rpm-dev
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.rpm falcosecurity/rpm-dev/falco/${FALCO_VERSION} --user poiana --key ${BINTRAY_SECRET} --publish
- run:
name: Publish tgz-dev
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.tar.gz falcosecurity/bin-dev/falco/${FALCO_VERSION} x86_64/ --user poiana --key ${BINTRAY_SECRET} --publish
# Publish docker packages
"publish/docker-dev":
docker:
- image: docker:stable
steps:
- checkout
- setup_remote_docker
- run:
name: Build and publish slim-dev
command: |
docker build --build-arg VERSION_BUCKET=deb-dev -t falcosecurity/falco:master-slim docker/slim
docker push falcosecurity/falco:master-slim
- run:
name: Build and publish minimal-dev
command: |
docker build --build-arg VERSION_BUCKET=bin-dev -t falcosecurity/falco:master-minimal docker/minimal
docker push falcosecurity/falco:master-minimal
- run:
name: Build and publish dev
command: |
docker build --build-arg VERSION_BUCKET=deb-dev -t falcosecurity/falco:master docker/stable
docker push falcosecurity/falco:master
# Publish the packages
"publish/packages":
docker:
- image: docker.bintray.io/jfrog/jfrog-cli-go:latest
steps:
- attach_workspace:
at: /
- run:
name: Create versions
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt vc falcosecurity/deb/falco/${FALCO_VERSION} --desc="Falco (${CIRCLE_TAG})" --github-tag-rel-notes --released=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") --vcs-tag=${CIRCLE_TAG}
jfrog bt vc falcosecurity/rpm/falco/${FALCO_VERSION} --desc="Falco (${CIRCLE_TAG})" --github-tag-rel-notes --released=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") --vcs-tag=${CIRCLE_TAG}
jfrog bt vc falcosecurity/bin/falco/${FALCO_VERSION} --desc="Falco (${CIRCLE_TAG})" --github-tag-rel-notes --released=$(date -u +"%Y-%m-%dT%H:%M:%S.000Z") --vcs-tag=${CIRCLE_TAG}
- run:
name: Publish deb
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.deb falcosecurity/deb/falco/${FALCO_VERSION} stable/ --deb stable/main/amd64 --user poiana --key ${BINTRAY_SECRET} --publish --labels="falco","security","cncf","kubernetes"
- run:
name: Publish rpm
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.rpm falcosecurity/rpm/falco/${FALCO_VERSION} --user poiana --key ${BINTRAY_SECRET} --publish
- run:
name: Publish tgz
command: |
FALCO_VERSION=$(sed -e 's/^"//' -e 's/"$//' <<< $(cat /build/release/userspace/falco/config_falco.h | grep 'FALCO_VERSION ' | cut -d' ' -f3))
jfrog bt u /build/release/falco-${FALCO_VERSION}-x86_64.tar.gz falcosecurity/bin/falco/${FALCO_VERSION} x86_64/ --user poiana --key ${BINTRAY_SECRET} --publish
# Publish docker packages
"publish/docker":
docker:
- image: docker:stable
steps:
- checkout
- setup_remote_docker
- run:
name: Build and publish slim
command: |
docker build --build-arg VERSION_BUCKET=deb -t "falcosecurity/falco:${CIRCLE_TAG}-slim" docker/slim
docker tag "falcosecurity/falco:${CIRCLE_TAG}-slim" falcosecurity/falco:latest-slim
docker push "falcosecurity/falco:${CIRCLE_TAG}-slim"
docker push "falcosecurity/falco:latest-slim"
- run:
name: Build and publish minimal
command: |
docker build --build-arg VERSION_BUCKET=bin -t "falcosecurity/falco:${CIRCLE_TAG}-minimal" docker/minimal
docker tag "falcosecurity/falco:${CIRCLE_TAG}-minimal" falcosecurity/falco:latest-minimal
docker push "falcosecurity/falco:${CIRCLE_TAG}-minimal"
docker push "falcosecurity/falco:latest-minimal"
- run:
name: Build and publish stable
command: |
docker build --build-arg VERSION_BUCKET=deb -t "falcosecurity/falco:${CIRCLE_TAG}" docker/stable
docker tag "falcosecurity/falco:${CIRCLE_TAG}" falcosecurity/falco:latest
docker push "falcosecurity/falco:${CIRCLE_TAG}"
docker push "falcosecurity/falco:latest"
workflows:
version: 2
build_and_test:
jobs:
- "build/ubuntu-bionic"
- "build/ubuntu-bionic-debug"
- "build/centos7"
- "build/centos7-debug"
- "tests/integration":
requires:
- "build/centos7"
- "rpm/sign":
context: falco
filters:
branches:
only:
- master
requires:
- "tests/integration"
- "publish/packages-dev":
context: falco
filters:
branches:
only:
- master
requires:
- "rpm/sign"
- "publish/docker-dev":
filters:
branches:
only:
- master
requires:
- "publish/packages-dev"
release:
jobs:
- "build/centos7":
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "rpm/sign":
context: falco
requires:
- "build/centos7"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/packages":
context: falco
requires:
- "rpm/sign"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
- "publish/docker":
requires:
- "publish/packages"
filters:
tags:
only: /.*/
branches:
ignore: /.*/
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ else()
set(CMAKE_BUILD_TYPE "release")
set(KBUILD_FLAGS "${DRAIOS_FEATURE_FLAGS}")
endif()
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")

set(CMAKE_COMMON_FLAGS "-Wall -ggdb ${DRAIOS_FEATURE_FLAGS}")

Expand Down
2 changes: 1 addition & 1 deletion brand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The CNCF now owns The Falco Project.
### What is Runtime Security?

Runtime security refers to an approach to preventing unwanted activity on a computer system.
With runtime security an operator deploys **both** prevention tooling (access control, policy enforcement, etc) along side detection tooling (systems observability, anomaly detection, etc).
With runtime security, an operator deploys **both** prevention tooling (access control, policy enforcement, etc) along side detection tooling (systems observability, anomaly detection, etc).
Runtime security is the practice of using detection tooling to detect unwanted behavior, such that it can then be prevented using prevention techniques.
Runtime security is a holistic approach to defense, and useful in scenarios where prevention tooling either was unaware of an exploit or attack vector, or when defective applications are ran in even the most secure environment.

Expand Down
5 changes: 4 additions & 1 deletion cmake/modules/CPackConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
set(CPACK_PACKAGE_NAME "${PACKAGE_NAME}")
set(CPACK_PACKAGE_VENDOR "Cloud Native Computing Foundation (CNCF) cncf.io.")
set(CPACK_PACKAGE_CONTACT "[email protected]") # todo: change this once we've got @falco.org addresses
set(CPACK_PACKAGE_CONTACT "[email protected]") # todo: change this once we've got @falco.org addresses
leodido marked this conversation as resolved.
Show resolved Hide resolved
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Falco - Container Native Runtime Security")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${PROJECT_SOURCE_DIR}/scripts/description.txt")
set(CPACK_PACKAGE_VERSION "${FALCO_VERSION}")
set(CPACK_PACKAGE_VERSION_MAJOR "${FALCO_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${FALCO_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${FALCO_VERSION_PATCH}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-${CMAKE_SYSTEM_PROCESSOR}")
set(CPACK_PROJECT_CONFIG_FILE "${PROJECT_SOURCE_DIR}/cmake/cpack/CMakeCPackOptions.cmake")
set(CPACK_STRIP_FILES "ON")
Expand Down
2 changes: 1 addition & 1 deletion docker/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM centos:7

LABEL name="falcosecurity/falco-builder"
LABEL usage="docker run -v $PWD/..:/source -v $PWD/build:/build falcosecurity/falco-builder cmake"
LABEL maintainer="[email protected]"
LABEL maintainer="[email protected]"

ARG BUILD_TYPE=release
ARG BUILD_DRIVER=OFF
Expand Down
Loading