Skip to content

Commit

Permalink
Added dehashed
Browse files Browse the repository at this point in the history
  • Loading branch information
myOmikron committed Aug 25, 2023
1 parent 863f9b5 commit 71828dd
Show file tree
Hide file tree
Showing 14 changed files with 610 additions and 60 deletions.
19 changes: 18 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions kraken/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,15 @@ tonic = { version = "~0.9", features = ["transport", "tls"] }
prost = { version = "~0.11" }
prost-types = { version = "~0.11" }

# error management
thiserror = { version = "~1" }

# ORM
rorm = { version = "~0.5", features = ["tokio-rustls", "cli", "uuid"] }

# API for dehashed
dehashed-rs = { version = "0.3", features = ["tokio", "utoipa"] }

[build-dependencies]
tonic-build = { version = "~0.9" }

Expand Down
217 changes: 193 additions & 24 deletions kraken/migrations/0001_initial.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
[Migration]
Hash = "17971917235879015907"
Hash = "12278384933680793871"
Initial = true
Replaces = []

[[Migration.Operations]]
Type = "CreateModel"
Name = "settings"

[[Migration.Operations.Fields]]
Name = "uuid"
Type = "varbinary"

[[Migration.Operations.Fields.Annotations]]
Type = "primary_key"

[[Migration.Operations.Fields]]
Name = "dehashed_email"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 1024

[[Migration.Operations.Fields]]
Name = "dehashed_api_key"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 1024

[[Migration.Operations.Fields]]
Name = "created_at"
Type = "datetime"

[[Migration.Operations.Fields.Annotations]]
Type = "auto_create_time"

[[Migration.Operations.Fields.Annotations]]
Type = "not_null"

[[Migration.Operations]]
Type = "CreateModel"
Name = "attack"
Expand All @@ -25,6 +62,7 @@ Value = [
"BruteforceSubdomains",
"TcpPortScan",
"QueryCertificateTransparency",
"QueryUnhashed",
]

[[Migration.Operations.Fields.Annotations]]
Expand Down Expand Up @@ -80,6 +118,117 @@ Type = "int32"
[[Migration.Operations.Fields.Annotations]]
Type = "not_null"

[[Migration.Operations]]
Type = "CreateModel"
Name = "dehashedqueryresult"

[[Migration.Operations.Fields]]
Name = "uuid"
Type = "varbinary"

[[Migration.Operations.Fields.Annotations]]
Type = "primary_key"

[[Migration.Operations.Fields]]
Name = "created_at"
Type = "datetime"

[[Migration.Operations.Fields.Annotations]]
Type = "auto_create_time"

[[Migration.Operations.Fields.Annotations]]
Type = "not_null"

[[Migration.Operations.Fields]]
Name = "dehashed_id"
Type = "int64"

[[Migration.Operations.Fields.Annotations]]
Type = "not_null"

[[Migration.Operations.Fields]]
Name = "email"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "username"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "password"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "hashed_password"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 8192

[[Migration.Operations.Fields]]
Name = "ip_address"
Type = "varbinary"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields.Annotations]]
Type = "not_null"

[[Migration.Operations.Fields]]
Name = "name"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "vin"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "address"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "phone"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations.Fields]]
Name = "database_name"
Type = "varchar"

[[Migration.Operations.Fields.Annotations]]
Type = "max_length"
Value = 255

[[Migration.Operations]]
Type = "CreateModel"
Name = "user"
Expand Down Expand Up @@ -335,34 +484,51 @@ Type = "not_null"

[[Migration.Operations]]
Type = "CreateField"
Model = "tcpportscanresult"
Model = "attack"

[Migration.Operations.Field]
Name = "attack"
Name = "started_by"
Type = "varbinary"

[[Migration.Operations.Field.Annotations]]
Type = "foreign_key"

[Migration.Operations.Field.Annotations.Value]
TableName = "attack"
TableName = "user"
ColumnName = "uuid"
OnDelete = "Cascade"
OnUpdate = "Cascade"
OnDelete = "Restrict"
OnUpdate = "Restrict"

[[Migration.Operations.Field.Annotations]]
Type = "not_null"

[[Migration.Operations]]
Type = "CreateField"
Model = "workspace"
Model = "attack"

[Migration.Operations.Field]
Name = "owner"
Name = "workspace"
Type = "varbinary"

[[Migration.Operations.Field.Annotations]]
Type = "index"
Type = "foreign_key"

[Migration.Operations.Field.Annotations.Value]
TableName = "workspace"
ColumnName = "uuid"
OnDelete = "Cascade"
OnUpdate = "Cascade"

[[Migration.Operations.Field.Annotations]]
Type = "not_null"

[[Migration.Operations]]
Type = "CreateField"
Model = "userkey"

[Migration.Operations.Field]
Name = "user"
Type = "varbinary"

[[Migration.Operations.Field.Annotations]]
Type = "foreign_key"
Expand Down Expand Up @@ -418,60 +584,63 @@ Type = "not_null"

[[Migration.Operations]]
Type = "CreateField"
Model = "userkey"
Model = "tcpportscanresult"

[Migration.Operations.Field]
Name = "user"
Name = "attack"
Type = "varbinary"

[[Migration.Operations.Field.Annotations]]
Type = "foreign_key"

[Migration.Operations.Field.Annotations.Value]
TableName = "user"
TableName = "attack"
ColumnName = "uuid"
OnDelete = "Restrict"
OnUpdate = "Restrict"
OnDelete = "Cascade"
OnUpdate = "Cascade"

[[Migration.Operations.Field.Annotations]]
Type = "not_null"

[[Migration.Operations]]
Type = "CreateField"
Model = "attack"
Model = "dehashedqueryresult"

[Migration.Operations.Field]
Name = "started_by"
Name = "attack"
Type = "varbinary"

[[Migration.Operations.Field.Annotations]]
Type = "foreign_key"

[Migration.Operations.Field.Annotations.Value]
TableName = "user"
TableName = "attack"
ColumnName = "uuid"
OnDelete = "Restrict"
OnUpdate = "Restrict"
OnDelete = "Cascade"
OnUpdate = "Cascade"

[[Migration.Operations.Field.Annotations]]
Type = "not_null"

[[Migration.Operations]]
Type = "CreateField"
Model = "attack"
Model = "workspace"

[Migration.Operations.Field]
Name = "workspace"
Name = "owner"
Type = "varbinary"

[[Migration.Operations.Field.Annotations]]
Type = "index"

[[Migration.Operations.Field.Annotations]]
Type = "foreign_key"

[Migration.Operations.Field.Annotations.Value]
TableName = "workspace"
TableName = "user"
ColumnName = "uuid"
OnDelete = "Cascade"
OnUpdate = "Cascade"
OnDelete = "Restrict"
OnUpdate = "Restrict"

[[Migration.Operations.Field.Annotations]]
Type = "not_null"
Loading

0 comments on commit 71828dd

Please sign in to comment.