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

Adding OCSF Finding Info missing types #488

Merged
merged 6 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ deploy/smithy/chart/charts
.idea/
components/consumers/pdf/report.html
new-components/targets/git-clone/pkg/git/testdata/gitea
**/.DS_STORE
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ lint-proto: build-buf-container
generate-proto: build-buf-container
@echo "Generating Proto files"
$(MAKE) run-buf ARGS="generate"
rm -rf sdk/gen
@mkdir -p sdk/gen/com
@mv com sdk/gen

dep-update-proto: build-buf-container
@echo "Updating buf.lock deps"
Expand Down
7 changes: 0 additions & 7 deletions buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,3 @@ plugins:
- local: protoc-gen-go
out: .
opt: paths=source_relative
inputs:
- proto_file: api/proto/v1/issue.proto
- proto_file: api/proto/v1/engine.proto
- git_repo: https://github.com/ocsf/examples
branch: main
ref: ba2a49f2bb1faf0c75ece9b6a9c5cd608eafbc67
subdir: encodings/protobuf/proto
21 changes: 11 additions & 10 deletions buf.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
---
version: v2
lint:
use:
- STANDARD
- COMMENTS
- UNARY_RPC
- PACKAGE_NO_IMPORT_CYCLE
except:
# we use Please to run protoc where we only need the last part of the
# package name to match the directory name.
- PACKAGE_DIRECTORY_MATCH
modules:
- path: proto
name: smithy-security/smithy/ocsf_ext
lint:
use:
- STANDARD
- COMMENTS
- UNARY_RPC
- PACKAGE_NO_IMPORT_CYCLE
except:
- PACKAGE_DIRECTORY_MATCH
48 changes: 48 additions & 0 deletions proto/ocsf_ext/finding_info/v1/finding_info.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
syntax = "proto3";

package smithy.security.smithy.ocsf_ext.finding_info.v1;

option go_package = "github.com/smithy-security/smithy/ocsf_ext/finding_info/v1";

// DataSource is used to define Data Sources described on https://schema.ocsf.io/1.3.0/objects/finding_info.
message DataSource {
// TargetType specifies the target type.
enum TargetType {
TARGET_TYPE_UNSPECIFIED = 0;
TARGET_TYPE_REPOSITORY = 1;
}

// URISchema specifies the URI schema.
// For example:
// - purl: pkg:npm/%40angular/[email protected]" -> "pkg"
// - file: file://main.go -> "file"
enum URISchema {
URI_SCHEMA_UNSPECIFIED = 0;
URI_SCHEMA_FILE = 1;
URI_SCHEMA_PURL = 2;
}

// URI specifies uri content.
message URI {
andream16 marked this conversation as resolved.
Show resolved Hide resolved
URISchema uri_schema = 1;
string path = 2;
}

// FileFindingLocationData specifies data associated with the physical location of a finding in a file.
message FileFindingLocationData {
uint32 start_line = 3;
uint32 end_line = 4;
uint32 start_column = 5;
uint32 end_column = 6;
}

// PurlFindingLocationData specifies data associated with the logical location of a finding in a purl.
message PurlFindingLocationData {}

TargetType target_type = 1;
URI uri = 2;
oneof location_data {
andream16 marked this conversation as resolved.
Show resolved Hide resolved
FileFindingLocationData file_finding_location_data = 3;
PurlFindingLocationData purl_finding_location_data = 4;
}
}
Loading