-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from logmanager-oss/feature/initial-implementation
initial implementation
- Loading branch information
Showing
29 changed files
with
5,512 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
run: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
check-latest: true | ||
|
||
- name: Lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: latest | ||
args: --timeout 5m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- "*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: stable | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v6 | ||
with: | ||
distribution: goreleaser | ||
version: "~> v1" | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
run: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 1.22.5 | ||
check-latest: true | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Run tests | ||
run: go test -v -race ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: vuln | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
schedule: | ||
- cron: '0 10 * * 1' # run "At 10:00 on Monday" | ||
|
||
jobs: | ||
run: | ||
name: Vuln | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
|
||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: 'stable' | ||
check-latest: true | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install govulncheck | ||
run: go install golang.org/x/vuln/cmd/govulncheck@latest | ||
|
||
- name: Run govulncheck | ||
run: govulncheck -test ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,63 @@ | ||
# logveil | ||
# logveil | ||
|
||
## Description | ||
|
||
Logveil is a simple CLI tool for log anonymizaiton. If you ever had a need to create a sample log data but were afraid to leak sensitive info this tool will help you make your logs anonymous. | ||
|
||
## Usage | ||
|
||
There are two components needed to make this work: | ||
|
||
1. Your input log data in CSV format. | ||
2. Anonymization data - which is data that will be used to replace original log data. | ||
|
||
``` | ||
Usage of ./logveil: | ||
-d value | ||
Path to directory with anonymizing data | ||
-i value | ||
Path to input file containing logs to be anonymized | ||
-o value | ||
Path to output file containing anonymized logs | ||
-v | ||
Enable verbose logging | ||
-h | ||
Help for logveil | ||
``` | ||
|
||
**Example:** | ||
|
||
`./logveil -d example_anon_data/ -i test_log.csv -o output.txt` | ||
|
||
### Input log data | ||
|
||
Obviously first you need to provide log data to be anonymized. It needs to be in a CSV format. The columns in you CSV file will mark which values you want to anonymize. | ||
|
||
As an example consider below log line. It is formatted in a standard `key:value` format. Key names mark the values. | ||
|
||
``` | ||
{"@timestamp": "2024-06-05T14:59:27.000+00:00", "msg.src_ip":"89.239.31.49", "username":"[email protected]", "organization":"TESTuser.test.com"} | ||
``` | ||
|
||
As such we can easily parse it into CSV file: | ||
|
||
``` | ||
@timestamp,msg.src_ip,msg.username,msg.organization,raw | ||
2024-06-05T14:59:27.000+00:00,89.239.31.49,[email protected],TESTuser.test.com,"{""@timestamp"": ""2024-06-05T14:59:27.000+00:00"", ""msg.src_ip"":""89.239.31.49"", ""username"":""[email protected]"", ""organization"":""TESTuser.test.com""}" | ||
``` | ||
|
||
Now key names are simply column names in CSV file. `raw` contains original log line. When you run Logveil, column names will be matched against your anonymization data. | ||
|
||
You can easily extract log data in such format from your Logmanager. Refer to Logmanager documentation for more info on how to Export data. | ||
|
||
### Anonymization data | ||
|
||
Each column for which you want to anonymize data must have its equivalent in anonymization data folder. | ||
|
||
For example, if you want to anonymize values in `msg.src_ip` and `msg.username` columns, you need to have two files of the same name in anonymization folder. | ||
|
||
### Output | ||
|
||
Anonymized data will be outputted to provided file path in txt format (unparsed). | ||
|
||
Alternatively, if you don't provide file path, output will be written to the console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package main | ||
|
||
import "github.com/logmanager-oss/logveil/internal/anonymizer" | ||
|
||
func main() { | ||
anonymizer.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
wan1 | ||
lan1 | ||
lan2 | ||
dmz | ||
if-servers | ||
if-users | ||
if-iot | ||
External | ||
Internal |
Oops, something went wrong.