From d6ba5520b9bc2ca5f5b9e318f4198f84f0a8bae9 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Thu, 8 Jun 2023 09:04:39 -0600 Subject: [PATCH 1/6] nessus_ci_config --- .github/dependabot.yml | 11 +++++++++++ .github/workflows/lint.yml | 11 +++++++++++ .github/workflows/test.yml | 24 ++++++++++++++++++++++++ .mergify.yml | 15 +++++++++++++++ Dockerfile | 1 + Makefile | 1 + 6 files changed, 63 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/test.yml create mode 100644 .mergify.yml create mode 100644 Dockerfile create mode 100644 Makefile diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8e4681c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + # Maintain dependencies for dockerfiles + - package-ecosystem: docker + directory: / + schedule: + interval: weekly diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..287bcf4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,11 @@ +name: Run lint and static analyis checks +on: + pull_request: + +concurrency: + group: lint-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + lint: + uses: plus3it/actions-workflows/.github/workflows/lint.yml@b1b7bdb32125ccb05afa36909954a75b9f2ab431 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..708d46b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +name: Run salt tests +on: + pull_request: + +concurrency: + group: test-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + test: + uses: plus3it/actions-workflows/.github/workflows/test-salt-linux.yml@b1b7bdb32125ccb05afa36909954a75b9f2ab431 + strategy: + matrix: + os_version: + - 7 + - 8 + salt_state: + - nessus-agent + salt_pillar_root: + - ./tests/pillar/test-nessus-agent + with: + salt-os-version: ${{ matrix.os_version }} + salt-state: ${{ matrix.salt_state }} + salt-pillar-root: ${{ matrix.salt_pillar_root }} diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 0000000..0c77e19 --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,15 @@ +pull_request_rules: + - name: approve dependabot pull requests + conditions: + - author=dependabot[bot] + actions: + review: + type: APPROVE + + - name: merge dependabot pull requests + conditions: + - author=dependabot[bot] + - "#approved-reviews-by>=1" + actions: + merge: + method: merge diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..abbcc61 --- /dev/null +++ b/Dockerfile @@ -0,0 +1 @@ +FROM plus3it/tardigrade-ci:0.24.6 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..634033f --- /dev/null +++ b/Makefile @@ -0,0 +1 @@ +include $(shell test -f .tardigrade-ci || curl -sSL -o .tardigrade-ci "https://raw.githubusercontent.com/plus3it/tardigrade-ci/master/bootstrap/Makefile.bootstrap"; echo .tardigrade-ci) From da528658dcb87d8556fecb56e7bb8d53e344dc99 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Thu, 8 Jun 2023 09:10:04 -0600 Subject: [PATCH 2/6] remove travis config --- .travis.yml | 68 ----------------------------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8f74abc..0000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -language: python - -env: - global: - - LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so - - SEGFAULT_SIGNALS=all - - SALT_PILLARROOT=$TRAVIS_BUILD_DIR/tests/pillar/test-nessus-agent - - SALT_REPO_URL=https://repo.saltproject.io/py3/redhat/7/x86_64/3003.repo - matrix: - - OS_VERSION=7 SALT_STATE=nessus-agent - -services: - - docker - -before_install: - - sudo apt-get update - - echo 'DOCKER_OPTS="-H tcp://127.0.0.1:2375 -H unix:///var/run/docker.sock -s devicemapper"' | - sudo tee /etc/default/docker > /dev/null - - sudo service docker restart - - sleep 5 - - sudo docker build -t local/centos:${OS_VERSION} tests/docker/centos${OS_VERSION} - -install: - - sudo docker run --detach --privileged - --volume="${TRAVIS_BUILD_DIR}":"${TRAVIS_BUILD_DIR}":ro - --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro - --name centos-${OS_VERSION} local/centos:${OS_VERSION} init - - sudo docker exec centos-${OS_VERSION} touch /etc/fstab - - sudo docker exec centos-${OS_VERSION} curl -sSL -o /etc/yum.repos.d/salt.repo ${SALT_REPO_URL} - - sudo docker exec centos-${OS_VERSION} yum -y install - $(<${TRAVIS_BUILD_DIR}/tests/requirements.txt) - $(<${TRAVIS_BUILD_DIR}/tests/requirements-el${OS_VERSION}.txt) - - sudo docker exec centos-${OS_VERSION} salt-call --versions-report - - sudo docker exec centos-${OS_VERSION} salt-call --local - --retcode-passthrough - --file-root=$TRAVIS_BUILD_DIR - --pillar-root=$SALT_PILLARROOT - saltutil.sync_all - # create the path the salt.file.find looks for - - sudo docker exec centos-${OS_VERSION} mkdir -p /opt/nessus_agent/var/nessus/ - -script: - - sudo docker exec centos-${OS_VERSION} salt-call --local - --retcode-passthrough --log-file /var/log/salt/minion --log-file-level debug - --file-root=$TRAVIS_BUILD_DIR - --pillar-root=$SALT_PILLARROOT - state.show_sls - $SALT_STATE && - sudo docker exec centos-${OS_VERSION} salt-call --local - --retcode-passthrough --log-file /var/log/salt/minion --log-file-level debug - --file-root=$TRAVIS_BUILD_DIR - --pillar-root=$SALT_PILLARROOT - state.sls - $SALT_STATE - mock=True - -after_failure: - - sudo docker exec centos-${OS_VERSION} salt-call --local grains.items - - sudo docker exec centos-${OS_VERSION} sh -c set - - sudo docker exec centos-${OS_VERSION} cat /var/log/salt/minion - -after_script: - - sudo docker stop centos-${OS_VERSION} - -notifications: - email: - on_success: never - on_failure: always From 378c5e75849804498e48fb19806872ad829d8391 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 12 Jun 2023 07:45:34 -0600 Subject: [PATCH 3/6] update appveyor.yml --- appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index 4290700..7a275ec 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,5 @@ version: '{branch}-{build}' +image: Visual Studio 2019 build: off environment: global: @@ -11,6 +12,7 @@ environment: init: - ps: echo $env:PILLAR_HOME install: + - ps: '[Net.ServicePointManager]::SecurityProtocol = "Tls12, Tls13"' - ps: | $null = ` (new-object net.webclient).DownloadFile(${env:SALT_URL}, ` From d3fcd2a6a2fbe0233345db97ca90c25ccfea5096 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 12 Jun 2023 07:56:02 -0600 Subject: [PATCH 4/6] update appveyor config --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 7a275ec..b4f42fe 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -5,7 +5,7 @@ environment: global: SALT_FILEROOT: '%APPVEYOR_BUILD_FOLDER%' SALT_STATE: nessus-agent - SALT_URL: 'https://repo.saltproject.io/windows/Salt-Minion-3003-Py3-AMD64-Setup.exe' + SALT_URL: https://repo.saltproject.io/windows/Salt-Minion-3004.2-1-Py3-AMD64-Setup.exe matrix: - SALT_PILLARROOT: '%APPVEYOR_BUILD_FOLDER%\tests\pillar\test-windows-main' From 0e1c650684419c4e05d0f3ba85908fb5c4ea4621 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Mon, 12 Jun 2023 08:04:04 -0600 Subject: [PATCH 5/6] appveyor fix --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index b4f42fe..3776b35 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,7 +20,7 @@ install: - ps: | $null = ` Start-Process -FilePath "${env:temp}\salt-minion.exe" ` - -ArgumentList "/S" -NoNewWindow -PassThru -Wait + -ArgumentList @("/S", "/install-dir=c:\salt") -NoNewWindow -PassThru -Wait - ps: C:\salt\salt-call.bat --versions-report test_script: From 81361a2913380cbc8f1657383d692b6f81c16549 Mon Sep 17 00:00:00 2001 From: dalerichardson Date: Thu, 15 Jun 2023 08:35:36 -0600 Subject: [PATCH 6/6] modified .editorconfig & .gitignore files --- .editorconfig | 36 ++++++++++++++++++++++++++++++++++++ .gitignore | 4 ++++ 2 files changed, 40 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..2e514aa --- /dev/null +++ b/.editorconfig @@ -0,0 +1,36 @@ +# see http://editorconfig.org +root = true + +[*] +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 +charset = utf-8 +tab_width = 4 + +[*.md] +trim_trailing_whitespace = false + +[*.py] +indent_size = 4 + +[go.mod] +indent_style = tab +indent_size = 1 + +[*.go] +indent_style = tab +indent_size = 1 + +[Makefile] +indent_style = tab +indent_size = 1 + +[Makefile.*] +indent_style = tab +indent_size = 1 + +[LICENSE] +indent_size = none diff --git a/.gitignore b/.gitignore index b190caa..0bd790b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,6 +14,10 @@ $RECYCLE.BIN/ *.msm *.msp +# tardigrade-ci +.tardigrade-ci +tardigrade-ci/ + # Windows shortcuts *.lnk