Squashed 'api/' changes from 08b8eb8..fe0a378
fe0a378 Add buf linting anf fix linter issues 27cd7f5 Format protobuf code 24ae082 Rename gRPC PCAP entities e30a129 Complete CLI integration d01a9de Initial draft of PCAP capturing 4504b96 Fix wrong import path in proto 80fa8f4 Merge commit '9a3c410ee8dfe2a380dc1ab36a5778e2c0f7049b' as 'api'795f9c0
Move existing protos to external repo1618dc3
Move docs to deploy staged70ba74
Introduce Lifecycle for every endpoint and manage listeners in the renamed Orchestratordd4b191
Merge branch '10-handler-event-stream' into 'master'2d97bea
Refactor gRPC sink85b0123
Update container config55dfcfa
Ship default CA with container buildc97207e
Update builtin CA2c02b0c
Add basic metric sinkcc72595
Subscribe sinks with a context to automatically remove them when context is canceled6d2737b
Move HTTPS handling to http_mock handler63a6516
Added audit stream to HTTP proxy03f3ae4
Enable gRPC reflection to support gRPCurl and gRPCuiaf0a7a2
Capture source and destination addresses as byte arrays66f2aab
Add commands to list sinks and to read a protocol file to JSONa76d1d1
Cleanup in server app0138b57
Merged CLI and server app init37c87ad
Apply comments38293bb
Remove caching for nowaf5c55d
Cache .task/ directory to lazy run tasks across stages41aa132
Cache .task/ directory to lazy run tasks across stages2f0f3ed
Moved code of commands to their main packageaf31b11
Audit API prototypedc4a9b1
Moved endpoint handlers in treebb9f45c
Move sinks to extra package6c448fd
Add DNS details0468c93
Integrate into handlers63607df
Implement log and writer sinks Add reader1e8139e
Add first draft of event streameaddf26
Add test and coverage reports81c4be6
Replace CI job token with API tokenfa5c649
Merge branch '15-generate-ca-command-has-wrong-validity' into 'master'9041da7
Resolve "generate-ca command has wrong validity"e9f79cd
Merge branch '7-add-advanced-matching-options' into 'master'49e58ac
Add advanced matching options to HTTP handler57a7e10
Add Prometheus metrics (#10)460940e
Fixed TLS issue with mismatching certificates9a50ce5
Complete health API191d352
fix container build and add missing demo CA files6899c6c
Removed generated mocks108444e
Add health API and basic CLI support2ff0e7c
Fix container build38f8ff3
Apply commented improvementsdef844c
Cleanupd89ab3a
Split to server and CLI binaries13a3829
Add output format options for upcoming CLI client1ef1f59
Add gRPC API implementation6184164
Add gRPC spec3466037
Remove plugin commands feature91f0cf6
Improve config and startup handling1775d3d
Add GoReport badge480388c
Update README666b137
Add some status badges127d40e
Merge pull request #3 from baez90/feature/add-http_proxya67b8ed
Improve TLS connection tracking to avoid memory or connection leaks7c2a41a
Move TLS/cert handling to main app43d3c62
Move mocks to internal package9236a38
Moved endpoint handling to new modulef4ca8e9
Add some tests to ensure proper configuration parsing671958e
Complete first naive HTTP proxy implementation63a446d
Prepare systemd deploymentca1ac7d
Move plugins to top level directory in repositoryac62eab
Initial commit http_proxy9123d01
Fix module problems and update release v0.0.1ac067cd
Fix plugin modules and test make target8134110
Move plugins to sub-modulesd8b7cfa
Merge pull request #4 from baez90/add-licensecd79537
Create LICENSEca76e18
Merge pull request #1 from baez90/add-github-ci6051ea1
Add goreleaserd7f7427
Add Go GitHub actions config2475f88
Add Makefile and reference to docsc3e362c
Add some basic docs63ba6da
Add basic DNS and DNS-over-TLS implementation0ed9070
Allow plugins to be resided in subdirectories02d8b44
Introduce lifetime parameters to generate-ca cmda720b0e
Initial working version6012f10
Initial commit git-subtree-dir: api git-subtree-split: fe0a378cdc00040176eb05fcaaa12a175bd50f30
This commit is contained in:
parent
9a3c410ee8
commit
231f06b9a1
14 changed files with 300 additions and 218 deletions
|
@ -4,7 +4,8 @@ root = true
|
||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
|
indent_size = 2
|
||||||
|
indent_style = space
|
||||||
|
|
||||||
[*.proto]
|
[*.proto]
|
||||||
indent_style = space
|
indent_size = 2
|
||||||
indent_size = 4
|
|
||||||
|
|
12
.gitlab-ci.yml
Normal file
12
.gitlab-ci.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
image:
|
||||||
|
name: docker.io/bufbuild/buf:latest
|
||||||
|
entrypoint: [""]
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- test
|
||||||
|
|
||||||
|
lint:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- buf ls-files
|
||||||
|
- buf lint
|
20
buf.yaml
Normal file
20
buf.yaml
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Below is not the lint and breaking configuration we recommend!
|
||||||
|
# This just just what googleapis passes.
|
||||||
|
# For lint, we recommend having the single value "DEFAULT" in "use"
|
||||||
|
# with no values in "except".
|
||||||
|
# For breaking, we recommend having the single value "FILE" in use.
|
||||||
|
# See https://docs.buf.build/lint-usage
|
||||||
|
# See https://docs.buf.build/breaking-usage
|
||||||
|
version: v1beta1
|
||||||
|
build:
|
||||||
|
roots:
|
||||||
|
- proto
|
||||||
|
lint:
|
||||||
|
use:
|
||||||
|
- DEFAULT
|
||||||
|
except:
|
||||||
|
- PACKAGE_DIRECTORY_MATCH
|
||||||
|
allow_comment_ignores: true
|
||||||
|
breaking:
|
||||||
|
use:
|
||||||
|
- FILE
|
|
@ -1,43 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "gitlab.com/inetmock/inetmock/pkg/audit/details";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option java_package = "com.github.baez90.inetmock.audit.details";
|
|
||||||
option java_outer_classname = "HandlerEventProto";
|
|
||||||
option csharp_namespace = "INetMock.Client.Audit.Details";
|
|
||||||
|
|
||||||
package inetmock.audit.details;
|
|
||||||
|
|
||||||
enum DNSOpCode {
|
|
||||||
Query = 0;
|
|
||||||
Status = 2;
|
|
||||||
Notify = 4;
|
|
||||||
Update = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum ResourceRecordType {
|
|
||||||
UnknownRR = 0;
|
|
||||||
A = 1;
|
|
||||||
NS = 2;
|
|
||||||
CNAME = 5;
|
|
||||||
SOA = 6;
|
|
||||||
PTR = 12;
|
|
||||||
HINFO = 13;
|
|
||||||
MINFO = 14;
|
|
||||||
MX = 15;
|
|
||||||
TXT = 16;
|
|
||||||
RP = 17;
|
|
||||||
AAAA = 28;
|
|
||||||
SRV = 33;
|
|
||||||
NAPTR = 35;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DNSQuestionEntity {
|
|
||||||
ResourceRecordType type = 1;
|
|
||||||
string name = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message DNSDetailsEntity {
|
|
||||||
DNSOpCode opcode = 1;
|
|
||||||
repeated DNSQuestionEntity questions = 2;
|
|
||||||
}
|
|
|
@ -1,33 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "gitlab.com/inetmock/inetmock/pkg/audit/details";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option java_package = "com.github.baez90.inetmock.audit.details";
|
|
||||||
option java_outer_classname = "HandlerEventProto";
|
|
||||||
option csharp_namespace = "INetMock.Client.Audit.Details";
|
|
||||||
|
|
||||||
package inetmock.audit.details;
|
|
||||||
|
|
||||||
enum HTTPMethod {
|
|
||||||
GET = 0;
|
|
||||||
HEAD = 1;
|
|
||||||
POST = 2;
|
|
||||||
PUT = 3;
|
|
||||||
DELETE = 4;
|
|
||||||
CONNECT = 5;
|
|
||||||
OPTIONS = 6;
|
|
||||||
TRACE = 7;
|
|
||||||
PATCH = 8;
|
|
||||||
}
|
|
||||||
|
|
||||||
message HTTPHeaderValue {
|
|
||||||
repeated string values = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message HTTPDetailsEntity {
|
|
||||||
HTTPMethod method = 1;
|
|
||||||
string host = 2;
|
|
||||||
string uri = 3;
|
|
||||||
string proto = 4;
|
|
||||||
map<string, HTTPHeaderValue> headers = 5;
|
|
||||||
}
|
|
|
@ -1,52 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "gitlab.com/inetmock/inetmock/pkg/audit";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option java_package = "com.github.baez90.inetmock.audit";
|
|
||||||
option java_outer_classname = "HandlerEventProto";
|
|
||||||
option csharp_namespace = "INetMock.Client.Audit";
|
|
||||||
|
|
||||||
package inetmock.audit;
|
|
||||||
|
|
||||||
import "google/protobuf/any.proto";
|
|
||||||
import "google/protobuf/timestamp.proto";
|
|
||||||
|
|
||||||
enum TransportProtocol {
|
|
||||||
UNKNOWN_TRANSPORT = 0;
|
|
||||||
TCP = 1;
|
|
||||||
UDP = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum AppProtocol {
|
|
||||||
UNKNOWN_APPLICATION = 0;
|
|
||||||
DNS = 1;
|
|
||||||
HTTP = 2;
|
|
||||||
HTTP_PROXY = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum TLSVersion {
|
|
||||||
SSLv30 = 0;
|
|
||||||
TLS10 = 1;
|
|
||||||
TLS11 = 2;
|
|
||||||
TLS12 = 3;
|
|
||||||
TLS13 = 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
message TLSDetailsEntity {
|
|
||||||
TLSVersion version = 1;
|
|
||||||
string cipherSuite = 2;
|
|
||||||
string serverName = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message EventEntity {
|
|
||||||
int64 id = 1;
|
|
||||||
google.protobuf.Timestamp timestamp = 2;
|
|
||||||
TransportProtocol transport = 3;
|
|
||||||
AppProtocol application = 4;
|
|
||||||
bytes sourceIP = 5;
|
|
||||||
bytes destinationIP = 6;
|
|
||||||
uint32 sourcePort = 7;
|
|
||||||
uint32 destinationPort = 8;
|
|
||||||
TLSDetailsEntity tls = 9;
|
|
||||||
google.protobuf.Any protocolDetails = 10;
|
|
||||||
}
|
|
44
proto/audit/v1/dns_details.proto
Normal file
44
proto/audit/v1/dns_details.proto
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package inetmock.audit.v1;
|
||||||
|
|
||||||
|
option csharp_namespace = "INetMock.Client.Audit";
|
||||||
|
option go_package = "gitlab.com/inetmock/inetmock/pkg/audit";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_outer_classname = "HandlerEventProto";
|
||||||
|
option java_package = "com.github.baez90.inetmock.audit";
|
||||||
|
|
||||||
|
enum DNSOpCode {
|
||||||
|
//buf:lint:ignore ENUM_ZERO_VALUE_SUFFIX
|
||||||
|
DNS_OP_CODE_QUERY = 0;
|
||||||
|
DNS_OP_CODE_STATUS = 2;
|
||||||
|
DNS_OP_CODE_NOTIFY = 4;
|
||||||
|
DNS_OP_CODE_UPDATE = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum ResourceRecordType {
|
||||||
|
RESOURCE_RECORD_TYPE_UNSPECIFIED = 0;
|
||||||
|
RESOURCE_RECORD_TYPE_A = 1;
|
||||||
|
RESOURCE_RECORD_TYPE_NS = 2;
|
||||||
|
RESOURCE_RECORD_TYPE_CNAME = 5;
|
||||||
|
RESOURCE_RECORD_TYPE_SOA = 6;
|
||||||
|
RESOURCE_RECORD_TYPE_PTR = 12;
|
||||||
|
RESOURCE_RECORD_TYPE_HINFO = 13;
|
||||||
|
RESOURCE_RECORD_TYPE_MINFO = 14;
|
||||||
|
RESOURCE_RECORD_TYPE_MX = 15;
|
||||||
|
RESOURCE_RECORD_TYPE_TXT = 16;
|
||||||
|
RESOURCE_RECORD_TYPE_RP = 17;
|
||||||
|
RESOURCE_RECORD_TYPE_AAAA = 28;
|
||||||
|
RESOURCE_RECORD_TYPE_SRV = 33;
|
||||||
|
RESOURCE_RECORD_TYPE_NAPTR = 35;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DNSQuestionEntity {
|
||||||
|
ResourceRecordType type = 1;
|
||||||
|
string name = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DNSDetailsEntity {
|
||||||
|
DNSOpCode opcode = 1;
|
||||||
|
repeated DNSQuestionEntity questions = 2;
|
||||||
|
}
|
52
proto/audit/v1/event_entity.proto
Normal file
52
proto/audit/v1/event_entity.proto
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package inetmock.audit.v1;
|
||||||
|
|
||||||
|
option csharp_namespace = "INetMock.Client.Audit";
|
||||||
|
option go_package = "gitlab.com/inetmock/inetmock/pkg/audit";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_outer_classname = "HandlerEventProto";
|
||||||
|
option java_package = "com.github.baez90.inetmock.audit";
|
||||||
|
|
||||||
|
import "google/protobuf/any.proto";
|
||||||
|
import "google/protobuf/timestamp.proto";
|
||||||
|
|
||||||
|
enum TransportProtocol {
|
||||||
|
TRANSPORT_PROTOCOL_UNSPECIFIED = 0;
|
||||||
|
TRANSPORT_PROTOCOL_TCP = 1;
|
||||||
|
TRANSPORT_PROTOCOL_UDP = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum AppProtocol {
|
||||||
|
APP_PROTOCOL_UNSPECIFIED = 0;
|
||||||
|
APP_PROTOCOL_DNS = 1;
|
||||||
|
APP_PROTOCOL_HTTP = 2;
|
||||||
|
APP_PROTOCOL_HTTP_PROXY = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum TLSVersion {
|
||||||
|
TLS_VERSION_UNSPECIFIED = 0;
|
||||||
|
TLS_VERSION_TLS10 = 1;
|
||||||
|
TLS_VERSION_TLS11 = 2;
|
||||||
|
TLS_VERSION_TLS12 = 3;
|
||||||
|
TLS_VERSION_TLS13 = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message TLSDetailsEntity {
|
||||||
|
TLSVersion version = 1;
|
||||||
|
string cipher_suite = 2;
|
||||||
|
string server_name = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message EventEntity {
|
||||||
|
int64 id = 1;
|
||||||
|
google.protobuf.Timestamp timestamp = 2;
|
||||||
|
TransportProtocol transport = 3;
|
||||||
|
AppProtocol application = 4;
|
||||||
|
bytes source_ip = 5;
|
||||||
|
bytes destination_ip = 6;
|
||||||
|
uint32 source_port = 7;
|
||||||
|
uint32 destination_port = 8;
|
||||||
|
TLSDetailsEntity tls = 9;
|
||||||
|
google.protobuf.Any protocol_details = 10;
|
||||||
|
}
|
34
proto/audit/v1/http_details.proto
Normal file
34
proto/audit/v1/http_details.proto
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package inetmock.audit.v1;
|
||||||
|
|
||||||
|
option csharp_namespace = "INetMock.Client.Audit";
|
||||||
|
option go_package = "gitlab.com/inetmock/inetmock/pkg/audit";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_outer_classname = "HandlerEventProto";
|
||||||
|
option java_package = "com.github.baez90.inetmock.audit";
|
||||||
|
|
||||||
|
enum HTTPMethod {
|
||||||
|
HTTP_METHOD_UNSPECIFIED = 0;
|
||||||
|
HTTP_METHOD_GET = 1;
|
||||||
|
HTTP_METHOD_HEAD = 2;
|
||||||
|
HTTP_METHOD_POST = 3;
|
||||||
|
HTTP_METHOD_PUT = 4;
|
||||||
|
HTTP_METHOD_DELETE = 5;
|
||||||
|
HTTP_METHOD_CONNECT = 6;
|
||||||
|
HTTP_METHOD_OPTIONS = 7;
|
||||||
|
HTTP_METHOD_TRACE = 8;
|
||||||
|
HTTP_METHOD_PATCH = 9;
|
||||||
|
}
|
||||||
|
|
||||||
|
message HTTPHeaderValue {
|
||||||
|
repeated string values = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message HTTPDetailsEntity {
|
||||||
|
HTTPMethod method = 1;
|
||||||
|
string host = 2;
|
||||||
|
string uri = 3;
|
||||||
|
string proto = 4;
|
||||||
|
map<string, HTTPHeaderValue> headers = 5;
|
||||||
|
}
|
|
@ -1,53 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option java_package = "com.github.baez90.inetmock.rpc";
|
|
||||||
option java_outer_classname = "AuditProto";
|
|
||||||
option csharp_namespace = "INetMock.Client.Rpc";
|
|
||||||
|
|
||||||
import 'proto/audit/event_entity.proto';
|
|
||||||
|
|
||||||
package inetmock.rpc;
|
|
||||||
|
|
||||||
enum FileOpenMode {
|
|
||||||
TRUNCATE = 0;
|
|
||||||
APPEND = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message WatchEventsRequest {
|
|
||||||
string watcherName = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RegisterFileSinkRequest {
|
|
||||||
string targetPath = 1;
|
|
||||||
FileOpenMode openMode = 2;
|
|
||||||
uint32 permissions = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RegisterFileSinkResponse {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message RemoveFileSinkRequest {
|
|
||||||
string targetPath = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message RemoveFileSinkResponse {
|
|
||||||
bool SinkGotRemoved = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ListSinksRequest {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
message ListSinksResponse {
|
|
||||||
repeated string sinks = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
service Audit {
|
|
||||||
rpc WatchEvents (WatchEventsRequest) returns (stream inetmock.audit.EventEntity);
|
|
||||||
rpc RegisterFileSink (RegisterFileSinkRequest) returns (RegisterFileSinkResponse);
|
|
||||||
rpc RemoveFileSink (RemoveFileSinkRequest) returns (RemoveFileSinkResponse);
|
|
||||||
rpc ListSinks(ListSinksRequest) returns (ListSinksResponse);
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
syntax = "proto3";
|
|
||||||
|
|
||||||
option go_package = "gitlab.com/inetmock/inetmock/internal/rpc";
|
|
||||||
option java_multiple_files = true;
|
|
||||||
option java_package = "com.github.baez90.inetmock.rpc";
|
|
||||||
option java_outer_classname = "HealthProto";
|
|
||||||
option csharp_namespace = "INetMock.Client.Rpc";
|
|
||||||
|
|
||||||
package inetmock.rpc;
|
|
||||||
|
|
||||||
service Health {
|
|
||||||
rpc GetHealth (HealthRequest) returns (HealthResponse) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
enum HealthState {
|
|
||||||
HEALTHY = 0;
|
|
||||||
INITIALIZING = 1;
|
|
||||||
UNHEALTHY = 2;
|
|
||||||
UNKNOWN = 3;
|
|
||||||
}
|
|
||||||
|
|
||||||
message HealthRequest {
|
|
||||||
repeated string components = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
message ComponentHealth {
|
|
||||||
HealthState State = 1;
|
|
||||||
string message = 2;
|
|
||||||
}
|
|
||||||
|
|
||||||
message HealthResponse {
|
|
||||||
HealthState overallHealthState = 1;
|
|
||||||
map<string, ComponentHealth> componentsHealth = 2;
|
|
||||||
}
|
|
48
proto/rpc/v1/audit.proto
Normal file
48
proto/rpc/v1/audit.proto
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package inetmock.rpc.v1;
|
||||||
|
|
||||||
|
option csharp_namespace = "INetMock.Client.Rpc";
|
||||||
|
option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_outer_classname = "AuditProto";
|
||||||
|
option java_package = "com.github.baez90.inetmock.rpc";
|
||||||
|
|
||||||
|
import "audit/v1/event_entity.proto";
|
||||||
|
|
||||||
|
message WatchEventsRequest {
|
||||||
|
string watcher_name = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message WatchEventsResponse {
|
||||||
|
inetmock.audit.v1.EventEntity entity = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterFileSinkRequest {
|
||||||
|
string target_path = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RegisterFileSinkResponse {
|
||||||
|
string resolved_path = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RemoveFileSinkRequest {
|
||||||
|
string target_path = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message RemoveFileSinkResponse {
|
||||||
|
bool sink_got_removed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListSinksRequest {}
|
||||||
|
|
||||||
|
message ListSinksResponse {
|
||||||
|
repeated string sinks = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
service AuditService {
|
||||||
|
rpc WatchEvents(WatchEventsRequest) returns (stream WatchEventsResponse);
|
||||||
|
rpc RegisterFileSink(RegisterFileSinkRequest) returns (RegisterFileSinkResponse);
|
||||||
|
rpc RemoveFileSink(RemoveFileSinkRequest) returns (RemoveFileSinkResponse);
|
||||||
|
rpc ListSinks(ListSinksRequest) returns (ListSinksResponse);
|
||||||
|
}
|
34
proto/rpc/v1/health.proto
Normal file
34
proto/rpc/v1/health.proto
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package inetmock.rpc.v1;
|
||||||
|
|
||||||
|
option csharp_namespace = "INetMock.Client.Rpc";
|
||||||
|
option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_outer_classname = "HealthProto";
|
||||||
|
option java_package = "com.github.baez90.inetmock.rpc";
|
||||||
|
|
||||||
|
enum HealthState {
|
||||||
|
HEALTH_STATE_UNSPECIFIED = 0;
|
||||||
|
HEALTH_STATE_INITIALIZING = 1;
|
||||||
|
HEALTH_STATE_UNHEALTHY = 2;
|
||||||
|
HEALTH_STATE_HEALTHY = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetHealthRequest {
|
||||||
|
repeated string components = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ComponentHealth {
|
||||||
|
HealthState state = 1;
|
||||||
|
string message = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetHealthResponse {
|
||||||
|
HealthState overall_health_state = 1;
|
||||||
|
map<string, ComponentHealth> components_health = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
service HealthService {
|
||||||
|
rpc GetHealth(GetHealthRequest) returns (GetHealthResponse);
|
||||||
|
}
|
53
proto/rpc/v1/pcap.proto
Normal file
53
proto/rpc/v1/pcap.proto
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package inetmock.rpc.v1;
|
||||||
|
|
||||||
|
option csharp_namespace = "INetMock.Client.Rpc";
|
||||||
|
option go_package = "gitlab.com/inetmock/inetmock/pkg/rpc";
|
||||||
|
option java_multiple_files = true;
|
||||||
|
option java_outer_classname = "AuditProto";
|
||||||
|
option java_package = "com.github.baez90.inetmock.rpc";
|
||||||
|
|
||||||
|
import "google/protobuf/duration.proto";
|
||||||
|
|
||||||
|
message ListAvailableDevicesRequest {}
|
||||||
|
|
||||||
|
message ListAvailableDevicesResponse {
|
||||||
|
message PCAPDevice {
|
||||||
|
string name = 1;
|
||||||
|
repeated bytes addresses = 2;
|
||||||
|
}
|
||||||
|
repeated PCAPDevice available_devices = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ListActiveRecordingsRequest {}
|
||||||
|
|
||||||
|
message ListActiveRecordingsResponse {
|
||||||
|
repeated string subscriptions = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StartPCAPFileRecordingRequest {
|
||||||
|
string device = 1;
|
||||||
|
string target_path = 2;
|
||||||
|
bool promiscuous = 3;
|
||||||
|
google.protobuf.Duration read_timeout = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StartPCAPFileRecordingResponse {
|
||||||
|
string resolved_path = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StopPCAPFileRecordRequest {
|
||||||
|
string consumer_key = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message StopPCAPFileRecordResponse {
|
||||||
|
bool removed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
service PCAPService {
|
||||||
|
rpc ListAvailableDevices(ListAvailableDevicesRequest) returns (ListAvailableDevicesResponse);
|
||||||
|
rpc ListActiveRecordings(ListActiveRecordingsRequest) returns (ListActiveRecordingsResponse);
|
||||||
|
rpc StartPCAPFileRecording(StartPCAPFileRecordingRequest) returns (StartPCAPFileRecordingResponse);
|
||||||
|
rpc StopPCAPFileRecord(StopPCAPFileRecordRequest) returns (StopPCAPFileRecordResponse);
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue