Skip to content

Commit

Permalink
Merge branch 'release/3.1.8'
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Sep 21, 2023
2 parents ab42db5 + 0b49ab1 commit 79c2878
Show file tree
Hide file tree
Showing 16 changed files with 320 additions and 265 deletions.
182 changes: 0 additions & 182 deletions .drone.yml

This file was deleted.

115 changes: 115 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Build
on:
push:
tags: ["*"]

jobs:
build:
name: Build
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
timeout-minutes: 15
continue-on-error: true
with:
node-version: 18.16
- name: Install bower
run: npm install -g bower
- name: Import PGP Key
run: gpg --batch --import - <<< ${{ secrets.PGP_KEY }}
- name: Write version
id: version
run: |
V=$(sbt -no-colors --error "print version" | awk 'END{print $1}')
echo "version=$V"
echo "version=$V" >> $GITHUB_OUTPUT
- name: Build packages
run: sbt Docker/stage Debian/packageBin Rpm/packageBin Universal/packageBin cortexWithDeps/Docker/stage makeBom
- name: Move packages
run: |
mv target/rpm/RPMS/noarch/cortex*.rpm target/
mv target/universal/cortex*.zip target/
- name: Write docker tags from version
id: tags
run: |
V=${{ steps.version.outputs.version }}
if ( echo $V | grep -qi rc )
then
echo $( echo $V | sed -re 's/([0-9]+.[0-9]+.[0-9]+)-RC([0-9]+)-([0-9]+)/\1-RC\2,\1-RC\2-\3/' ) > target/tags
else
echo $( echo $V | sed -re 's/([0-9]+).([0-9]+).([0-9]+)-([0-9]+)/\1,\1.\2,\1.\2.\3,\1.\2.\3-\4,latest/' ) > target/tags
fi
echo "tags=$(cat target/tags)" >> $GITHUB_OUTPUT
- name: Build list of additional tags
id: additional-tags
uses: actions/github-script@v6
with:
script: |
core.setOutput('tags', `${{ steps.tags.outputs.tags }}`.split(",").join("\n"))
- name: Generate full docker tags
id: meta
uses: docker/metadata-action@v4
with:
images: |
name=${{ secrets.HARBOR_REGISTRY }}/thehiveproject/cortex
name=thehiveproject/cortex
tags: |
${{ steps.additional-tags.outputs.tags }}
- name: Login to Harbor
uses: docker/login-action@v2
with:
registry: ${{ secrets.HARBOR_REGISTRY }}
username: ${{ secrets.HARBOR_USERNAME }}
password: ${{ secrets.HARBOR_PASSWORD }}

- name: Login to Dockerhub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push docker
uses: docker/build-push-action@v3
with:
context: target/docker/stage
push: true
tags: ${{ steps.meta.outputs.tags }}

- name: Build and push fat docker
uses: docker/build-push-action@v3
with:
context: target/docker-withdeps/target/docker/stage
push: true
tags: ${{ steps.meta.outputs.tags }}

- name: Make github release
uses: "softprops/action-gh-release@v1"
id: make-release
with:
generate_release_notes: true
files: |
target/cortex*.deb
target/cortex*.rpm
target/cortex*.zip
target/cortex*.bom.xml
notify:
needs: [ build ]
runs-on: [ ubuntu-latest ]
if: always()
steps:
- name: Slack notification
uses: Gamesight/slack-workflow-status@master
with:
repo_token: ${{secrets.GITHUB_TOKEN}}
slack_webhook_url: ${{secrets.SLACK_WEBHOOK_URL}}
channel: "#ci-cortex"
name: Cortex build
include_commit_message: true
include_jobs: true
22 changes: 22 additions & 0 deletions .github/workflows/check_code.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Check Code
on:
workflow_dispatch:
workflow_call:
push:
branches: [master, develop]
jobs:
check:
name: Check
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- name: Setup node
uses: actions/setup-node@v3
timeout-minutes: 15
continue-on-error: true
with:
node-version: 18.16
- name: Install bower
run: npm install -g bower
- name: Run tests
run: sbt test Universal/packageBin
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## [3.1.8](https://github.com/TheHive-Project/Cortex/milestone/35) (2023-09-21)

**Pull requests:**

- Fixed user parameter name in application config sample [\#315](https://github.com/TheHive-Project/Cortex/pull/315)
- Update cortex.service [\#361](https://github.com/TheHive-Project/Cortex/pull/361)
- GroupUserMapper.scala: Backport fix from TheHive for group mapper functionality [\#438](https://github.com/TheHive-Project/Cortex/pull/438)
- [CTX-16] fix: don't use Elasticsearch scroll to find user by its API key [\#447](https://github.com/TheHive-Project/Cortex/pull/447)
- [CTX-17] fix: Update version of JFFI [\#448](https://github.com/TheHive-Project/Cortex/pull/448)
- Update deps [\#449](https://github.com/TheHive-Project/Cortex/pull/449)

## [3.1.7](https://github.com/TheHive-Project/Cortex/milestone/34) (2022-10-07)

**Implemented enhancements:**
Expand Down
3 changes: 1 addition & 2 deletions app/org/thp/cortex/services/KeyAuthSrv.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ class KeyAuthSrv @Inject() (userSrv: UserSrv, implicit val ec: ExecutionContext,
import org.elastic4play.services.QueryDSL._
// key attribute is sensitive so it is not possible to search on that field
userSrv
.find("status" ~= "Ok", Some("all"), Nil)
.find(and("status" ~= "Ok", "key" ~= key), Some("0-1"), Nil)
._1
.filter(_.key().contains(key))
.runWith(Sink.headOption)
.flatMap {
case Some(user) => userSrv.getFromUser(request, user, name)
Expand Down
Loading

0 comments on commit 79c2878

Please sign in to comment.