Commit 0c5c0a29 authored by Nong Hoang Tu's avatar Nong Hoang Tu
Browse files

New upstream version 21.4.3

parents
Pipeline #5776 failed with stages
in 0 seconds
version: 2
jobs:
check_format:
docker:
- image: greenbone/build-env-gvm-libs-master-debian-buster-clang-core
steps:
- checkout
- run:
name: Check Source Format
command: clang-format -i -style=file src/*.{c,h} misc/*.{c,h} nasl/*.{c,h} && git diff --exit-code
test_units:
docker:
- image: greenbone/build-env-openvas-scanner-master-debian-buster-gcc-core
steps:
- run:
working_directory: ~/gvm-libs
name: Checkout gvm-libs
command: git clone --depth 1 https://github.com/greenbone/gvm-libs.git -b gvm-libs-21.04
- run:
working_directory: ~/gvm-libs
name: Configure and compile gvm-libs (Release)
command: pushd gvm-libs && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make install && popd
- checkout
- run:
name: Configure and run unit tests
command: mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make tests && CTEST_OUTPUT_ON_FAILURE=1 make test
build_gcc_core:
docker:
- image: greenbone/build-env-openvas-scanner-master-debian-buster-gcc-core
steps:
- run:
working_directory: ~/gvm-libs
name: Checkout gvm-libs
command: git clone --depth 1 https://github.com/greenbone/gvm-libs.git -b gvm-libs-21.04
- run:
working_directory: ~/gvm-libs
name: Configure and compile gvm-libs
command: pushd gvm-libs && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make install && popd
- checkout
- run:
name: Configure and Compile
command: mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Release .. && make install
scan_build:
docker:
- image: greenbone/build-env-openvas-scanner-master-debian-buster-clang-core
steps:
- run:
working_directory: ~/gvm-libs
name: Checkout gvm-libs
command: git clone --depth 1 https://github.com/greenbone/gvm-libs.git -b gvm-libs-21.04
- run:
working_directory: ~/gvm-libs
name: Configure and compile gvm-libs
command: pushd gvm-libs && mkdir build && cd build/ && cmake -DCMAKE_BUILD_TYPE=Debug .. && make install && popd
- checkout
- run:
name: Configure and Scan Build
command: mkdir build && cd build/ && scan-build cmake -DCMAKE_BUILD_TYPE=Debug .. && scan-build -o ~/scan-build-report make
- store_artifacts:
path: ~/scan-build-report
gen_xml_doc:
docker:
- image: greenbone/code-metrics-doxygen-debian-stretch
steps:
- checkout
- run:
name: Generate documentation (XML)
command: mkdir build && cd build/ && cmake -DSKIP_SRC=1 .. && make doc-xml 2> ~/doxygen-stderr.txt
- store_artifacts:
path: ~/doxygen-stderr.txt
- persist_to_workspace:
root: ~/project/build/doc/generated/
paths:
- xml
doc_coverage:
docker:
- image: circleci/python:3.6
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run:
name: Install coverxygen and codecov
command: |
python3 -m venv venv
. venv/bin/activate
pip install 'coverxygen>=1.3.1' codecov
- run:
name: Establish documentation coverage
command: |
. venv/bin/activate
python -m coverxygen --src-dir /root/project --xml-dir /tmp/workspace/xml --output lcov.info
- run:
name: Upload coverage to Codecov
command: |
. venv/bin/activate
codecov -F documentation -X gcov -f lcov.info
workflows:
version: 2
build_and_test:
jobs:
- check_format
- test_units
- build_gcc_core
- scan_build
- gen_xml_doc
- doc_coverage:
requires:
- gen_xml_doc
# clang-format configuration for Greenbone C code
#
# Minimum required clang-format version: 6.0
---
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: 'false'
AlignConsecutiveDeclarations: 'false'
AlignEscapedNewlines: Left
AlignOperands: 'true'
AlignTrailingComments: 'true'
AllowAllParametersOfDeclarationOnNextLine: 'false'
AllowShortBlocksOnASingleLine: 'false'
AllowShortCaseLabelsOnASingleLine: 'false'
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine: 'false'
AllowShortLoopsOnASingleLine: 'false'
AlwaysBreakAfterReturnType: All
AlwaysBreakBeforeMultilineStrings: 'false'
BinPackArguments: 'true'
BinPackParameters: 'true'
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: GNU
BreakBeforeTernaryOperators: 'true'
BreakStringLiterals: 'true'
ColumnLimit: '80'
ContinuationIndentWidth: '2'
DerivePointerAlignment: 'false'
IncludeBlocks: Regroup
IndentCaseLabels: 'false'
IndentWidth: '2'
IndentWrappedFunctionNames: 'false'
KeepEmptyLinesAtTheStartOfBlocks: 'false'
Language: Cpp
MaxEmptyLinesToKeep: '1'
PointerAlignment: Right
ReflowComments: 'true'
SortIncludes: 'true'
SpaceAfterCStyleCast: 'true'
SpaceBeforeAssignmentOperators: 'true'
SpaceBeforeParens: Always
SpaceInEmptyParentheses: 'false'
SpacesInCStyleCastParentheses: 'false'
SpacesInParentheses: 'false'
SpacesInSquareBrackets: 'false'
UseTab: Never
...
comment: off
# Dockerfile for openvas-scanner-$VERSION-$COMPILER-build
# Define ARG we use through the build
ARG VERSION=master
ARG BUILD_TYPE=Debug
ARG COMPILER=gcc
FROM greenbone/openvas-scanner-$VERSION-$COMPILER-testing
# This will make apt-get install without question
ARG DEBIAN_FRONTEND=noninteractive
COPY . /usr/local/src/openvas-scanner
WORKDIR /usr/local/src
# clone and install openvas-scanner
RUN cd openvas-scanner && \
mkdir build && \
cd build && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make install
\ No newline at end of file
# Dockerfile for openvas-scanner-$VERSION-$COMPILER-testing
# Define ARG we use through the build
ARG VERSION=master
ARG BUILD_TYPE=Debug
ARG COMPILER=gcc
# We want gvm-libs to be ready so we use the build docker image of gvm-libs
FROM greenbone/gvm-libs-$VERSION-$COMPILER-build
# This will make apt-get install without question
ARG DEBIAN_FRONTEND=noninteractive
# Install dependencies required for building openvas-scanner
# and not yet installed as dependencies of gvm-libs-core
RUN apt-get update && apt-get install --assume-yes \
bison \
libksba-dev \
libpcap-dev \
libjson-glib-dev \
&& rm -rf /var/lib/apt/lists/*
# default reviewers
* @greenbone/openvas-scanner-maintainers
---
name: Bug Report
about: Report an issue with openvas scanner
title: ''
labels: bug
assignees: ''
---
<!--
If reporting an issue please try to provide the information asked below.
Before reporting an issue please:
1. Be aware that this is not a support forum. If your issue is rather a question
than a bug report, please use our community forum at
https://community.greenbone.net/c/gse instead.
2. Make sure that you're using the latest published GVM components for the
release you are using: https://community.greenbone.net/t/about-the-source-edition-gse-category/176
3. Check the list of issues whether it isn't already reported.
4. Read 1. again and if you still believe you found a software bug please
continue to file this issue. If you are in doubt use
https://community.greenbone.net/c/gse instead.
Thanks for your help to keep the communication channels clean and consistent!
-->
### Expected behavior
<!--
How did you expect openvas to behave?
Please write down how the web interface should work in your opinion.
-->
### Actual behavior
<!--
Did something go wrong?
Is something broken, or not behaving as you expected?
Is this really an bug? If in doubt please use
https://community.greenbone.net/c/gse instead.
Please attach screenshots if possible! They are extremely helpful for
diagnosing issues.
-->
### Steps to reproduce
<!--
How would you describe your issue to someone who doesn’t know openvas?
Try to write a sequence of steps that anybody can repeat to see the issue.
-->
1.
2.
3.
### GVM versions
**gsa:** (gsad --version)
**gvm:** (gvmd --version)
**openvas:** (openvas --version)
**gvm-libs:**
**openvas-smb:**
<!-- ospd-openvas is only necessary for GVM 11/openvas 7 -->
**ospd-openvas:** (ospd-openvas --version)
### Environment
**Operating system:**
<!-- e.g. paste output of uname -a and cat /etc/lsb-release -->
**Installation method / source:** (packages, source installation)
### Logfiles
<!-- in most cases you'll find the logs in /var/log/gvm/ -->
```
```
blank_issues_enabled: false
contact_links:
- name: Greenbone Community Forum
url: https://community.greenbone.net/c/gse
about: Please ask and answer questions here.
**What**:
<!--
Describe what changes are being made, e.g. which feature/bug is being
developed/fixed in this PR?
-->
**Why**:
<!-- Why are these changes necessary? -->
**How**:
<!--
How did you verify the changes in this PR?
If this PR contains tests this section can be considered done.
Otherwise please write down the steps on how you did test your changes and
verified that the changes are working as expected.
See https://www.ministryoftesting.com/dojo/lessons/community-stories-to-shift-left-start-right
for some background.
-->
**Checklist**:
<!-- add "N/A" to the end of each line not applicable to your changes -->
<!-- to check an item, place an "x" in the box like so: "- [x] Tests" -->
- [ ] Tests
- [ ] [CHANGELOG](https://github.com/greenbone/openvas/blob/master/CHANGELOG.md) Entry
name: "Build and Test"
on:
push:
branches: [ master, openvas-21.04, openvas-20.08 ]
pull_request:
branches: [ master, openvas-21.04, openvas-20.08 ]
jobs:
check-format:
name: Check formatting
runs-on: ubuntu-latest
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v2
- name: Check Source Format
run: |
clang-format -i -style=file src/*.{c,h} misc/*.{c,h} nasl/*.{c,h} && git diff --exit-code
gen_xml_doc:
name: Build XML documentation
runs-on: ubuntu-latest
container: greenbone/code-metrics-doxygen-debian-stretch
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v2
- name: Generate documentation (XML)
run: |
mkdir build && cd build/ && cmake -DSKIP_SRC=1 .. \
&& make doc-xml 2> ~/doxygen-stderr.txt
- name: Upload doxygen error output as artifact
uses: actions/upload-artifact@v2
with:
name: doxygen-stderr.txt
path: ~/doxygen-stderr.txt
- name: Upload XML documentation as artifact
uses: actions/upload-artifact@v2
with:
name: xml-doc
path: build/doc/generated/xml/
doc-coverage:
name: Upload doc coverage to Codecov
needs: gen_xml_doc
runs-on: ubuntu-latest
container: greenbone/openvas-scanner-21.04-clang-testing
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v2
- name: Install coverxygen and codecov
run: |
apt-get update && apt-get --assume-yes install python3-venv curl
python3 -m venv .venv
. .venv/bin/activate
pip install setuptools --upgrade
pip install 'coverxygen>=1.3.1' codecov
- name: Download XML documentation artifact
id: xml-doc-download
uses: actions/download-artifact@v2
with:
name: xml-doc
path: /tmp/xml-doc
- name: Establish documentation coverage
run: |
. .venv/bin/activate
python -m coverxygen --src-dir ${{ github.workspace }} \
--xml-dir ${{steps.xml-doc-download.outputs.download-path}} \
--output lcov.info
- uses: codecov/codecov-action@v1
with:
files: lcov.info
build:
name: Build various configs
runs-on: ubuntu-latest
strategy:
matrix:
build_type:
- Debug
- Release
docker_base:
- greenbone/openvas-scanner-21.04-clang-testing
- greenbone/openvas-scanner-21.04-gcc-testing
container: ${{ matrix.docker_base }}
env:
BUILD_TYPE: ${{ matrix.build_type }}
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v2
- name: Find openvas-scanner reference branch
run: |
if [ -n "$GITHUB_BASE_REF" ]; \
then echo "OPENVAS_REF=$GITHUB_BASE_REF" >> $GITHUB_ENV; \
else echo "OPENVAS_REF=$GITHUB_REF" >> $GITHUB_ENV; \
fi
- name: Select gvm-libs branch
run: |
if [ $OPENVAS_REF = "master" ]; \
then GVM_LIBS_REF="master"; \
else GVM_LIBS_REF=$(echo "$OPENVAS_REF" \
| sed 's/refs\/.*\///g' \
| sed 's/openvas-/gvm-libs-/g' -); \
fi; \
echo "GVM_LIBS_REF=$GVM_LIBS_REF" >> $GITHUB_ENV
- name: Check out gvm-libs
uses: actions/checkout@v2
with:
repository: greenbone/gvm-libs
ref: ${{ env.GVM_LIBS_REF }}
path: gvm-libs
- name: Configure and compile gvm-libs (${{ env.BUILD_TYPE }})
working-directory: gvm-libs
run: |
mkdir build && cd build/ && \
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && \
make install
- name: Configure and compile openvas-scanner
run: |
mkdir build && cd build/ && \
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && \
make install
scan-build:
name: Scan-build (clang static analyzer)
runs-on: ubuntu-latest
container: greenbone/openvas-scanner-21.04-clang-testing
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v2
- name: Find openvas-scanner reference branch
run: |
if [ -n "$GITHUB_BASE_REF" ]; \
then echo "OPENVAS_REF=$GITHUB_BASE_REF" >> $GITHUB_ENV; \
else echo "OPENVAS_REF=$GITHUB_REF" >> $GITHUB_ENV; \
fi
- name: Select gvm-libs branch
run: |
if [ $OPENVAS_REF = "master" ]; \
then GVM_LIBS_REF="master"; \
else GVM_LIBS_REF=$(echo "$OPENVAS_REF" \
| sed 's/refs\/.*\///g' \
| sed 's/openvas-/gvm-libs-/g' -); \
fi; \
echo "GVM_LIBS_REF=$GVM_LIBS_REF" >> $GITHUB_ENV
- name: Check out gvm-libs
uses: actions/checkout@v2
with:
repository: greenbone/gvm-libs
ref: ${{ env.GVM_LIBS_REF }}
path: gvm-libs
- name: Configure and compile gvm-libs (Debug)
working-directory: gvm-libs
run: |
mkdir build && cd build/ && \
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && \
make install
- name: Configure and Scan Build
run: |
mkdir build && cd build/ && \
scan-build cmake -DCMAKE_BUILD_TYPE=Debug .. && \
scan-build -o ~/scan-build-report make
- name: Upload scan-build report
if: failure()
uses: actions/upload-artifact@v2
with:
name: scan-build-report
path: ~/scan-build-report/
test-units:
name: Build and run unit tests
runs-on: ubuntu-latest
container: greenbone/openvas-scanner-21.04-gcc-testing
steps:
- name: Check out openvas-scanner
uses: actions/checkout@v2
- name: Find openvas-scanner reference branch
run: |
if [ -n "$GITHUB_BASE_REF" ]; \
then echo "OPENVAS_REF=$GITHUB_BASE_REF" >> $GITHUB_ENV; \
else echo "OPENVAS_REF=$GITHUB_REF" >> $GITHUB_ENV; \
fi
- name: Select gvm-libs branch
run: |
if [ $OPENVAS_REF = "master" ]; \
then GVM_LIBS_REF="master"; \
else GVM_LIBS_REF=$(echo "$OPENVAS_REF" \
| sed 's/refs\/.*\///g' \
| sed 's/openvas-/gvm-libs-/g' -); \
fi; \
echo "GVM_LIBS_REF=$GVM_LIBS_REF" >> $GITHUB_ENV
- name: Check out gvm-libs
uses: actions/checkout@v2
with:
repository: greenbone/gvm-libs
ref: ${{ env.GVM_LIBS_REF }}
path: gvm-libs
- name: Configure and compile gvm-libs (Debug)
working-directory: gvm-libs
run: |
mkdir build && cd build/ && \
cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. && \
make install
- name: Configure and run unit tests
run: |
mkdir build && cd build/ && \
cmake -DCMAKE_BUILD_TYPE=Release .. && \
make tests && CTEST_OUTPUT_ON_FAILURE=1 make test
name: "CodeQL"
on:
push:
branches: [ master, openvas-20.08, openvas-21.04 ]
pull_request:
branches: [ master, openvas-20.08, openvas-21.04 ]
schedule:
- cron: '30 5 * * 0' # 5:30h on Sundays
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
container: greenbone/build-env-openvas-scanner-master-debian-buster-gcc-core
strategy:
fail-fast: false
matrix:
language: [ 'c' ]
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# build between init and analyze ...
- name: Find openvas-scanner reference branch
run: |
if [ -n "$GITHUB_BASE_REF" ]; \
then echo "OPENVAS_REF=$GITHUB_BASE_REF" >> $GITHUB_ENV; \
else echo "OPENVAS_REF=$GITHUB_REF" >> $GITHUB_ENV; \
fi
- name: Select gvm-libs branch
run: |
if [ $OPENVAS_REF = "master" ]; \
then GVM_LIBS_REF="master"; \
else GVM_LIBS_REF=$(echo "$OPENVAS_REF" \
| sed 's/refs\/.*\///g' \
| sed 's/openvas-/gvm-libs-/g' -); \
fi; \
echo "GVM_LIBS_REF=$GVM_LIBS_REF" >> $GITHUB_ENV
- name: Check out gvm-libs
uses: actions/checkout@v2
with:
repository: greenbone/gvm-libs
ref: ${{ env.GVM_LIBS_REF }}
path: gvm-libs
- name: Configure and compile gvm-libs (${{ env.BUILD_TYPE }})
working-directory: gvm-libs
run: |
mkdir build && cd build/ && \
cmake -DCMAKE_BUILD_TYPE=Debug .. && \
make install
- name: Configure and Compile openvas-scanner
run: |
mkdir build && cd build/ && cmake \
-DCMAKE_BUILD_TYPE=Release .. && make install
working-directory: ${{ github.WORKSPACE }}
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
name: Build and upload docker images
on:
push:
branches: [ master, openvas-21.04, openvas-20.08 ]
jobs:
upload-testing:
name: "Upload testing docker images"
runs-on: ubuntu-latest
strategy:
matrix:
compiler:
- gcc
- clang