Skip to content

Commit

Permalink
Rename source to sensor
Browse files Browse the repository at this point in the history
  • Loading branch information
sophie-cluml committed Dec 12, 2024
1 parent 7804e76 commit 8ad56f1
Show file tree
Hide file tree
Showing 29 changed files with 111 additions and 107 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ Versioning](https://semver.org/spec/v2.0.0.html).
- Updated the encoding and decoding method for GraphQL cursors by removing
`graphql::encode_cursor` and `graphql::decode_cursor` methods and replacing
them with the encoding and decoding methods of `OpaqueCursor`.
- Replaced the term source with sensor, where it refers to a device or software
that captures or detects raw events. This update broadly affects GraphQL APIs
that previously used source field as a parameter, and GraphQL APIs that return
event, outlier, or triage related structs.

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ num-traits = "0.2"
reqwest = { version = "0.12", default-features = false, features = [
"rustls-tls-native-roots",
] }
review-database = { git = "https://github.com/petabi/review-database.git", tag = "0.32.0" }
review-database = { git = "https://github.com/petabi/review-database.git", rev = "a1905ce" }
roxy = { git = "https://github.com/aicers/roxy.git", tag = "0.3.0" }
rustls = { version = "0.23", default-features = false, features = [
"ring",
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# review-web

This project aims to provide an easy-to-use interface for the REview system,
allowing users to manage and analyze events from various sources. The web
allowing users to manage and analyze events from various sensors. The web
interface is built using modern web technologies, and it exposes a GraphQL API
for flexible data querying and manipulation.

Expand Down
16 changes: 8 additions & 8 deletions src/graphql/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1190,11 +1190,11 @@ mod tests {

use crate::graphql::TestSchema;

/// Creates an event message at `timestamp` with the given source and
/// Creates an event message at `timestamp` with the given sensor and
/// destination `IPv4` addresses.
fn event_message_at(timestamp: DateTime<Utc>, src: u32, dst: u32) -> EventMessage {
let fields = DnsEventFields {
source: "sensor1".to_string(),
sensor: "sensor1".to_string(),
session_end_time: timestamp,
src_addr: Ipv4Addr::from(src).into(),
src_port: 10000,
Expand Down Expand Up @@ -1367,7 +1367,7 @@ mod tests {
sensors: [0], \
}}, \
) {{ \
edges {{ node {{... on DnsCovertChannel {{ time, source }} }} }} \
edges {{ node {{... on DnsCovertChannel {{ time, sensor }} }} }} \
totalCount \
}} \
}}",
Expand All @@ -1376,7 +1376,7 @@ mod tests {
let res = schema.execute(&query).await;
assert_eq!(
res.data.to_string(),
r#"{eventList: {edges: [{node: {time: "2018-01-27T18:30:09.453829+00:00", source: "sensor1"}}], totalCount: 1}}"#
r#"{eventList: {edges: [{node: {time: "2018-01-27T18:30:09.453829+00:00", sensor: "sensor1"}}], totalCount: 1}}"#
);
}

Expand Down Expand Up @@ -1708,7 +1708,7 @@ mod tests {
.and_local_timezone(Utc)
.unwrap();
let fields = BlockListDhcpFields {
source: "sensor1".to_string(),
sensor: "sensor1".to_string(),
src_addr: Ipv4Addr::new(127, 0, 0, 1).into(),
src_port: 68,
dst_addr: Ipv4Addr::new(127, 0, 0, 2).into(),
Expand Down Expand Up @@ -1797,7 +1797,7 @@ mod tests {
.and_local_timezone(Utc)
.unwrap();
let fields = BlockListBootpFields {
source: "sensor1".to_string(),
sensor: "sensor1".to_string(),
src_addr: Ipv4Addr::new(127, 0, 0, 1).into(),
src_port: 68,
dst_addr: Ipv4Addr::new(127, 0, 0, 2).into(),
Expand Down Expand Up @@ -1879,7 +1879,7 @@ mod tests {
.and_local_timezone(Utc)
.unwrap();
let fields = DnsEventFields {
source: "sensor1".to_string(),
sensor: "sensor1".to_string(),
session_end_time: timestamp,
src_addr: Ipv4Addr::from(1).into(),
src_port: 10000,
Expand Down Expand Up @@ -1936,7 +1936,7 @@ mod tests {
.and_local_timezone(Utc)
.unwrap();
let fields = BlockListTlsFields {
source: "sensor1".to_string(),
sensor: "sensor1".to_string(),
src_addr: Ipv4Addr::from(1).into(),
src_port: 10000,
dst_addr: Ipv4Addr::from(2).into(),
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/bootp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListBootp {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/conn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,8 @@ impl BlockListConn {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/dcerpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListDceRpc {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/dhcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListDhcp {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
16 changes: 8 additions & 8 deletions src/graphql/event/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ impl DnsCovertChannel {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn session_end_time(&self) -> DateTime<Utc> {
Expand Down Expand Up @@ -163,8 +163,8 @@ impl LockyRansomware {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn session_end_time(&self) -> DateTime<Utc> {
Expand Down Expand Up @@ -309,8 +309,8 @@ impl CryptocurrencyMiningPool {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -451,8 +451,8 @@ impl BlockListDns {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
8 changes: 4 additions & 4 deletions src/graphql/event/ftp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ impl FtpPlainText {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -254,8 +254,8 @@ impl BlockListFtp {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
2 changes: 1 addition & 1 deletion src/graphql/event/group.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ mod tests {
/// destination `IPv4` addresses.
fn event_message_at(timestamp: DateTime<Utc>, src: u32, dst: u32) -> EventMessage {
let fields = DnsEventFields {
source: "sensor1".to_string(),
sensor: "sensor1".to_string(),
session_end_time: timestamp,
src_addr: Ipv4Addr::from(src).into(),
src_port: 10000,
Expand Down
24 changes: 12 additions & 12 deletions src/graphql/event/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ impl HttpThreat {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -238,8 +238,8 @@ impl RepeatedHttpSessions {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -328,8 +328,8 @@ impl TorConnection {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn session_end_time(&self) -> DateTime<Utc> {
Expand Down Expand Up @@ -514,8 +514,8 @@ impl DomainGenerationAlgorithm {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -700,8 +700,8 @@ impl NonBrowser {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -882,8 +882,8 @@ impl BlockListHttp {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/kerberos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListKerberos {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
8 changes: 4 additions & 4 deletions src/graphql/event/ldap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ impl LdapPlainText {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down Expand Up @@ -235,8 +235,8 @@ impl BlockListLdap {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ impl ExtraThreat {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn service(&self) -> &str {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/mqtt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListMqtt {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ impl NetworkThreat {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/nfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListNfs {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/ntlm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListNtlm {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/rdp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ impl BlockListRdp {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
4 changes: 2 additions & 2 deletions src/graphql/event/smb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ impl BlockListSmb {
self.inner.time
}

async fn source(&self) -> &str {
&self.inner.source
async fn sensor(&self) -> &str {
&self.inner.sensor
}

async fn src_addr(&self) -> String {
Expand Down
Loading

0 comments on commit 8ad56f1

Please sign in to comment.