Skip to content
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

V0.0.2 #10

Merged
merged 11 commits into from
Nov 21, 2023
81 changes: 81 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Upload new release
on:
release:
types: [published]

jobs:
build_function:
name: Build function
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- run: git fetch --force --tags
- uses: actions/setup-go@v4
with:
go-version: '1.19'
- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v5
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest
args: release --clean
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
upload_to_buckets:
name: Upload to S3 buckets
runs-on: ubuntu-latest
needs: build_function
strategy:
matrix:
aws_region:
- 'us-east-1'
- 'us-east-2'
- 'us-west-1'
- 'us-west-2'
- 'eu-central-1'
- 'eu-north-1'
- 'eu-west-1'
- 'eu-west-2'
- 'eu-west-3'
- 'sa-east-1'
- 'ap-northeast-1'
- 'ap-northeast-2'
- 'ap-northeast-3'
- 'ap-south-1'
- 'ap-southeast-1'
- 'ap-southeast-2'
- 'ca-central-1'
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Download release for security hub collector
run: wget -c https://github.com/logzio/aws-security-hub/releases/download/${{ github.event.release.tag_name }}/aws-security-hub_${{ github.event.release.tag_name }}_linux_amd64.zip -O function.zip
- name: create new version
run: |
cp ./collector/sam/template.yaml ./template-${{ matrix.aws_region }}.yaml
sed -i "s/<<VERSION>>/${{ github.event.release.tag_name }}/" "./template-${{ matrix.aws_region }}.yaml"
sed -i "s/<<REGION>>/${{ matrix.aws_region }}/" "./template-${{ matrix.aws_region }}.yaml"
shell: bash
- name: Upload to aws
run: |

sudo apt-get update
sudo apt-get install awscli
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_KEY }}
aws configure set region ${{ matrix.aws_region }}
aws s3 cp ./template-${{ matrix.aws_region }}.yaml s3://logzio-aws-integrations-${{ matrix.aws_region }}/aws-security-hub-collector/${{ github.event.release.tag_name }}/template.yaml --acl public-read
aws s3 cp ./function.zip s3://logzio-aws-integrations-${{ matrix.aws_region }}/aws-security-hub-collector/${{ github.event.release.tag_name }}/function.zip --acl public-read

shell: bash
- name: Clean
run: |
rm ./template-${{ matrix.aws_region }}.yaml
rm ./function.zip
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.15
go-version: 1.19
- name: Before install
run: |
go get golang.org/x/tools/cmd/cover
Expand Down
26 changes: 26 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
before:
hooks:
builds:
- id: awsSecurityHub
env:
- CGO_ENABLED=0
mod_timestamp: '{{ .CommitTimestamp }}'
flags:
- -trimpath
ldflags:
- '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}'
goos:
- linux
goarch:
- amd64
binary: 'bootstrap'
dir: collector
archives:
- id: awsSecurityHubArchive
builds: [awsSecurityHub]
format: zip
name_template: >-
aws-security-hub_{{ index (split .Version "-") 0 }}_{{ .Os }}_{{ .Arch }}
release:
changelog:
skip: true
34 changes: 17 additions & 17 deletions collector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,23 @@ Select the button below to create a new stack dedicated to sending events from A

| AWS Region | Launch a stack |
| --- | --- |
| `us-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-east-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `us-east-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-east-2.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `us-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-west-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `us-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-west-2.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `eu-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-central-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `eu-north-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-north-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `eu-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-west-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `eu-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-west-2.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `eu-west-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-west-3.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `sa-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-sa-east-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ca-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ca-central-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ap-northeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-northeast-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ap-northeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-northeast-2.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ap-northeast-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-3#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-northeast-3.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ap-south-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-south-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ap-southeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-southeast-1.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `ap-southeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-southeast-2.s3.amazonaws.com/aws-security-hub-collector/0.0.1/template.yaml) |
| `us-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-east-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `us-east-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-east-2.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `us-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-west-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `us-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-us-west-2.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `eu-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-central-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `eu-north-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-north-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `eu-west-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-west-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `eu-west-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-west-2.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `eu-west-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-eu-west-3.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `sa-east-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-sa-east-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ca-central-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ca-central-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ap-northeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-northeast-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ap-northeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-northeast-2.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ap-northeast-3` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-3#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-northeast-3.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ap-south-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-south-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ap-southeast-1` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-southeast-1.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |
| `ap-southeast-2` | [![Deploy to AWS](https://dytvr9ot2sszz.cloudfront.net/logz-docs/lights/LightS-button.png)](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/new?stackName=logzio-security-hub-collector&templateURL=https://logzio-aws-integrations-ap-southeast-2.s3.amazonaws.com/aws-security-hub-collector/0.0.2/template.yaml) |

### Step 1 - Specify template

Expand Down
16 changes: 15 additions & 1 deletion collector/go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
module aws-security-hub/collector

go 1.15
go 1.19

require (
github.com/aws/aws-lambda-go v1.26.0
github.com/logzio/logzio-go v1.0.2
github.com/sirupsen/logrus v1.8.1
github.com/stretchr/testify v1.6.1
)

require (
github.com/StackExchange/wmi v1.2.0 // indirect
github.com/beeker1121/goque v2.1.0+incompatible // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-ole/go-ole v1.2.5 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/shirou/gopsutil/v3 v3.21.6 // indirect
github.com/syndtr/goleveldb v1.0.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
golang.org/x/sys v0.1.0 // indirect; indirect, relates to: https://github.com/sirupsen/logrus/pull/1402
gopkg.in/yaml.v3 v3.0.0-20200615113413-eeeca48fe776 // indirect
)
Loading
Loading