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

Add document for GraphQL API dnsRawEvents #984

Merged
merged 1 commit into from
Feb 21, 2025
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
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ file is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and
this project adheres to [Semantic
Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed

- Documentation of the following GraphQL APIs is updated:
- `dnsRawEvents`

## [0.24.0] - 2025-02-19

### Added
Expand Down Expand Up @@ -707,6 +714,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).

- Initial release.

[Unreleased]: https://github.com/aicers/giganto/compare/0.24.0...main
[0.24.0]: https://github.com/aicers/giganto/compare/0.23.0...0.24.0
[0.23.0]: https://github.com/aicers/giganto/compare/0.22.1...0.23.0
[0.22.1]: https://github.com/aicers/giganto/compare/0.22.0...0.22.1
Expand Down
42 changes: 42 additions & 0 deletions src/graphql/client/schema/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -389,25 +389,67 @@ type DnsEventEventEdge {
cursor: String!
}

# Represents an event extracted from the DNS protocol.
type DnsRawEvent {
# Start Time
time: DateTime!

# Source IP address
origAddr: String!

# Source Port Number
origPort: Int!

# Destination IP Address
respAddr: String!

# Destination Port Number
respPort: Int!

# Protocol Number
#
# TCP is 6, and UDP is 17.
proto: Int!

# End Time
#
# It is measured in nanoseconds.
lastTime: StringNumberI64!

# Query
query: String!

# Answer
answer: [String!]!

# Transaction ID
transId: Int!

# Round-Trip Time
rtt: StringNumberI64!

# Query Class
qclass: Int!

# Query Type
qtype: Int!

# Response Code
rcode: Int!

# Authoritative Answer Flag
aaFlag: Boolean!

# Truncated Flag
tcFlag: Boolean!

# Recursion Desired Flag
rdFlag: Boolean!

# Recursion Available Flag
raFlag: Boolean!

# Time to Live
ttl: [Int!]!
}

Expand Down
24 changes: 24 additions & 0 deletions src/graphql/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,28 +186,52 @@ struct ConnRawEvent {
resp_l2_bytes: StringNumberU64,
}

/// Represents an event extracted from the DNS protocol.
#[allow(clippy::struct_excessive_bools)]
#[derive(SimpleObject, Debug, ConvertGraphQLEdgesNode)]
#[graphql_client_type(names = [dns_raw_events::DnsRawEventsDnsRawEventsEdgesNode, network_raw_events::NetworkRawEventsNetworkRawEventsEdgesNodeOnDnsRawEvent])]
struct DnsRawEvent {
/// Start Time
time: DateTime<Utc>,
/// Source IP address
orig_addr: String,
/// Source Port Number
orig_port: u16,
/// Destination IP Address
resp_addr: String,
/// Destination Port Number
resp_port: u16,
/// Protocol Number
///
/// TCP is 6, and UDP is 17.
proto: u8,
/// End Time
///
/// It is measured in nanoseconds.
last_time: StringNumberI64,
/// Query
query: String,
/// Answer
answer: Vec<String>,
/// Transaction ID
trans_id: u16,
/// Round-Trip Time
rtt: StringNumberI64,
/// Query Class
qclass: u16,
/// Query Type
qtype: u16,
/// Response Code
rcode: u16,
/// Authoritative Answer Flag
aa_flag: bool,
/// Truncated Flag
tc_flag: bool,
/// Recursion Desired Flag
rd_flag: bool,
/// Recursion Available Flag
ra_flag: bool,
/// Time to Live
ttl: Vec<i32>,
}

Expand Down