Skip to content

Commit

Permalink
Merge branch 'main' into improve-scap-update
Browse files Browse the repository at this point in the history
  • Loading branch information
timopollmeier authored Mar 6, 2024
2 parents 165ad22 + 74d3808 commit 4b8a9e2
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 18 deletions.
3 changes: 2 additions & 1 deletion .docker/prod.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
ARG VERSION=edge
ARG GVM_LIBS_VERSION=oldstable
ARG DEBIAN_FRONTEND=noninteractive
ARG IMAGE_REGISTRY=ghcr.io

FROM greenbone/gvmd-build:${VERSION} as builder
FROM ${IMAGE_REGISTRY}/greenbone/gvmd-build:${VERSION} as builder

COPY . /source
WORKDIR /source
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
scan-build:
name: scan-build (clang static analyzer)
runs-on: ubuntu-latest
container: greenbone/gvmd-build:stable
container: ${{ vars.IMAGE_REGISTRY }}/greenbone/gvmd-build:stable
steps:
- name: Check out gvmd
uses: actions/checkout@v4
Expand All @@ -46,7 +46,7 @@ jobs:
test-units:
name: Unit Tests
runs-on: ubuntu-latest
container: greenbone/gvmd-build:stable
container: ${{ vars.IMAGE_REGISTRY }}/greenbone/gvmd-build:stable
steps:
- name: Check out gvmd
uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository }}-build
images: ${{ vars.IMAGE_REGISTRY }}/${{ github.repository }}-build
labels: |
org.opencontainers.image.vendor=Greenbone
org.opencontainers.image.base.name=greenbone/gvm-libs
Expand All @@ -40,11 +40,12 @@ jobs:
else
echo "gvm-libs-version=oldstable-edge" >> $GITHUB_OUTPUT
fi
- name: Login to DockerHub
- name: Login to GitHub Docker registry
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
registry: ghcr.io
username: ${{ secrets.GREENBONE_BOT }}
password: ${{ secrets.GREENBONE_BOT_PACKAGES_WRITE_TOKEN }}
- run: echo "Build and push ${{ steps.meta.outputs.tags }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
Expand All @@ -54,6 +55,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
GVM_LIBS_VERSION=${{ steps.container-opts.outputs.gvm-libs-version }}
file: .docker/build.Dockerfile
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
build-gmp-doc:
name: Build GMP documentation
runs-on: ubuntu-latest
container: greenbone/gvmd-build:stable
container: ${{ vars.IMAGE_REGISTRY }}/greenbone/gvmd-build:stable
steps:
- name: Check out gvmd
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis-c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
actions: read
contents: read
security-events: write
container: greenbone/gvmd-build:stable
container: ${{ vars.IMAGE_REGISTRY }}/greenbone/gvmd-build:stable

strategy:
fail-fast: false
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
build-args: |
VERSION=${{ steps.container-opts.outputs.version }}
GVM_LIBS_VERSION=${{ steps.container-opts.outputs.gvm-libs-version }}
IMAGE_REGISTRY=${{ vars.IMAGE_REGISTRY }}
file: .docker/prod.Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
Expand Down
12 changes: 3 additions & 9 deletions src/alert_methods/TippingPoint/alert
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ CONVERT_SCRIPT=$4
AUTH_PATH=$5
REPORT_PATH=$6

# Function to encode for URL
urlencode () {
RET=$(python -c "import urllib, sys; print urllib.quote(sys.argv[1])" "$1")
echo "$RET"
}

# Create temp file for converted report
REPORT_DATE=$(xmlstarlet sel -t -v "report/timestamp" < $REPORT_PATH)
EXIT_CODE=$?
Expand Down Expand Up @@ -76,9 +70,9 @@ END_TIME=$(TZ=UTC date -d "$END_TIME" +%Y-%m-%dT%H:%M:%S.000Z)
RUNTIME="$START_TIME/$END_TIME"

# Upload the report
VENDOR=$(urlencode "Greenbone")
PRODUCT=$(urlencode "Greenbone Vulnerability Manager")
FORMAT_VERSION=$(urlencode "1.0.0")
VENDOR="Greenbone"
PRODUCT="Greenbone%20Vulnerability%20Manager"
FORMAT_VERSION="1.0.0"
CN_REPLACEMENT="Tippingpoint"

if [ "1" = $CERT_WORKAROUND ]
Expand Down
4 changes: 4 additions & 0 deletions src/alert_methods/TippingPoint/report-convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,10 @@ def convert (xml_tree, out_file):
nvt_cve = '';
nvt_elem = result_elem.find ('nvt')
nvt_refs = nvt_elem.find ('refs');

if (nvt_refs is None):
continue

for ref in nvt_refs.findall('ref'):
if (ref.attrib['type'] == 'cve'):
if (nvt_cve == ''):
Expand Down

0 comments on commit 4b8a9e2

Please sign in to comment.