-
Notifications
You must be signed in to change notification settings - Fork 270
Feature/kafka mode threat guardrails #3768
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
base: master
Are you sure you want to change the base?
Changes from all commits
dab60bc
68aa0ac
739acb2
86b99a6
07d6a06
e7c3034
0d3ba02
e1a4752
fc92ca5
1eaef3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,6 +47,10 @@ on: | |||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||
| description: Agent Traffic Analyzer | ||||||||||||||||||||||||||
| guardrails_service: | ||||||||||||||||||||||||||
| type: boolean | ||||||||||||||||||||||||||
| default: false | ||||||||||||||||||||||||||
| description: Guardrails Service | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||
|
|
@@ -275,6 +279,71 @@ jobs: | |||||||||||||||||||||||||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||||||||||||||||||||||||||
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| build-guardrails-service: | ||||||||||||||||||||||||||
| runs-on: ubuntu-22.04 | ||||||||||||||||||||||||||
| if: ${{ github.event.inputs.guardrails_service == 'true' }} | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||
| - uses: actions/checkout@v2 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: DockerHub login | ||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||
| DOCKER_USERNAME: ${{secrets.DOCKER_USERNAME}} | ||||||||||||||||||||||||||
| DOCKER_PASSWORD: ${{secrets.DOCKER_PASSWORD}} | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Build, tag, and push the image to DockerHub | ||||||||||||||||||||||||||
| id: build-image-dockerhub | ||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||
| ECR_REGISTRY: aktosecurity | ||||||||||||||||||||||||||
| IMAGE_VERSION: ${{ github.event.inputs.release_version }} | ||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||
| docker buildx create --use | ||||||||||||||||||||||||||
| cd apps/guardrails-service/container | ||||||||||||||||||||||||||
| docker buildx build --platform linux/arm64/v8,linux/amd64 -t $ECR_REGISTRY/guardrails-service:local -t $ECR_REGISTRY/guardrails-service:$IMAGE_VERSION . --push | ||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🟢 LOW: Deprecated ::set-output workflow command |
||||||||||||||||||||||||||
| echo "::set-output name=image::$ECR_REGISTRY/guardrails-service:$IMAGE_VERSION" | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Configure AWS Credentials for ECR | ||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🟠 HIGH: Hard-coded AWS secret access key
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
🟠 HIGH: Hard-coded AWS secret access key |
||||||||||||||||||||||||||
| uses: aws-actions/configure-aws-credentials@v1 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| aws-access-key-id: ${{secrets.AWS_ACCESS_KEY_ID}} | ||||||||||||||||||||||||||
| aws-secret-access-key: ${{secrets.AWS_SECRET_ACCESS_KEY}} | ||||||||||||||||||||||||||
| aws-region: us-east-1 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Login to Amazon ECR | ||||||||||||||||||||||||||
| id: login-ecr | ||||||||||||||||||||||||||
| uses: aws-actions/amazon-ecr-login@v1 | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| mask-password: "true" | ||||||||||||||||||||||||||
| registry-type: public | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Push git tag | ||||||||||||||||||||||||||
| id: tag_version | ||||||||||||||||||||||||||
| uses: mathieudutour/[email protected] | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||
| custom_tag: guardrails-service-${{ github.event.inputs.release_version }} | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Create a GitHub release | ||||||||||||||||||||||||||
| uses: ncipollo/[email protected] | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| tag: ${{ steps.tag_version.outputs.new_tag }} | ||||||||||||||||||||||||||
| name: Release ${{ steps.tag_version.outputs.new_tag }} | ||||||||||||||||||||||||||
| omitBody: true | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| - name: Send Github release notification to Slack | ||||||||||||||||||||||||||
| id: slack | ||||||||||||||||||||||||||
| uses: slackapi/[email protected] | ||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||
| payload: | | ||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||
| "text": "Guardrails Service v${{ github.event.inputs.release_version }} released!" | ||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||
| SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | ||||||||||||||||||||||||||
| SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| build-threat: | ||||||||||||||||||||||||||
| # The type of runner that the job will run on | ||||||||||||||||||||||||||
| runs-on: ubuntu-22.04 | ||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ | |
| **/yarn-error.log | ||
| **/yarn.lock | ||
| **/.vscode/ | ||
| **/.cursor/ | ||
| **/.project | ||
| **/.classpath | ||
| **/.settings | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. gitignore .cursor files
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding rules for everyone.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| alwaysApply: true | ||
| --- | ||
| - Do not repeat code. | ||
| - Do not add libraries which are not being used. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟢 LOW: Deprecated ::set-output workflow command
The ::set-output command is deprecated. Write the output to the GITHUB_OUTPUT file to set the step output (preserves the same step id output 'image').