forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.faker.graphql
More file actions
executable file
·2524 lines (2200 loc) · 47.9 KB
/
schema.faker.graphql
File metadata and controls
executable file
·2524 lines (2200 loc) · 47.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
"""
A field whose value is an upper case letter or an under score that has a
length between 1 and 50
"""
scalar Acronym @examples(values: ["GC", "ABC", "ASDF", "NSTIR", "BC"])
"""
DMARC operates by checking that the domain in the message's From: field
(also called "5322.From") is "aligned" with other authenticated domain
names. If either SPF or DKIM alignment checks pass, then the DMARC alignment
test passes.
"""
type Alignment {
"""
Is SPF aligned
"""
spf: Boolean
"""
Is DKIM aligned
"""
dkim: Boolean
"""
Is DMARC aligned
"""
dmarc: Boolean
}
"""
This mutation allows users to give their credentials and retrieve a token
that gives them access to restricted content.
"""
type Authenticate {
"""
User info who just signed in, and their JWT
"""
authResult: AuthResult
}
"""
Object containing input fields for Authenticate Mutation
"""
input AuthenticateInput {
"""
User email that they signed up with.
"""
userName: EmailAddress!
"""
Users password
"""
password: String!
}
"""
A type used to return information when users sign up or authenticate
"""
type AuthResult {
"""
JWT used for accessing, controlled content.
"""
authToken: String
"""
User that has just been created or signed in
"""
user: User
}
"""
This object contains the list of different categories for pre-computed
summary data with the computed total for how many domains in total are
being compared.
"""
type CategorizedSummary {
"""
List of SummaryCategory objects with data for different computed categories.
"""
categories: [SummaryCategory] @listLength(min: 2, max: 3)
"""
Total domains that were checked under this summary.
"""
total: Int @examples(values: [86954, 57896, 54386, 93456, 23452])
}
"""
This object displays the total amount of messages that fit into each category
"""
type CategoryTotals {
"""
Amount of messages that passed all checks
"""
fullPass: Int
"""
Amount of messages that passed some checks
"""
partialPass: Int
"""
Amount of messages that passed SPF and failed DKIM
"""
passSpfOnly: Int
"""
Amount of messages that pass DKIM and failed SPF
"""
passDkimOnly: Int
"""
Amount of messages that failed all checks
"""
fail: Int
"""
The sum of all different categories.
"""
total: Int
}
"""
This class handles the inner nested dict given by key: 'content'.
"""
type Content {
body: String
fromEmail: String
subject: String
}
"""
Mutation used to create a new domain for an organization
"""
type CreateDomain {
status: Boolean
}
"""
Input object used to define the argument fields for the createDomain
mutation
"""
input CreateDomainInput {
"""
Organizations slug that you would like to connect this domain to.
"""
orgSlug: Slug!
"""
URL that you would like to be added to database.
"""
url: URL!
"""
DKIM selector strings corresponding to this domain
"""
selectors: Selectors
}
"""
Mutation allows the creation of an organization inside the database.
"""
type CreateOrganization {
status: Boolean
}
"""
Input object type containing all the fields for the create organization
mutation
"""
input CreateOrganizationInput {
"""
Acronym of organization.
"""
acronym: Acronym!
"""
Full name of organization.
"""
name: String!
"""
The zone which the organization belongs to.
"""
zone: String!
"""
The sector which the organization belongs to.
"""
sector: String!
"""
The province in which the organization is located in.
"""
province: String!
"""
The city in which the organization is located in.
"""
city: String!
}
"""
The `Date` scalar type represents a Date
value as specified by
[iso8601](https://en.wikipedia.org/wiki/ISO_8601).
"""
scalar Date
"""
The `DateTime` scalar type represents a DateTime
value as specified by
[iso8601](https://en.wikipedia.org/wiki/ISO_8601).
"""
scalar DateTime
"""
Object that contains the details for each category
"""
type DetailTables {
"""
List of top senders that have full pass
"""
fullPass: [TableStructure] @listLength(min: 20, max: 30)
"""
List of top senders that have an spf failure
"""
spfFailure: [TableStructure] @listLength(min: 20, max: 30)
"""
List of top senders that have spf misaligned
"""
spfMisaligned: [TableStructure] @listLength(min: 20, max: 30)
"""
List of top senders that have an dkim failure
"""
dkimFailure: [TableStructure] @listLength(min: 20, max: 30)
"""
List of top senders that have dkim misaligned
"""
dkimMisaligned: [TableStructure] @listLength(min: 20, max: 30)
"""
List of top senders that have an dmarc failure
"""
dmarcFailure: [TableStructure] @listLength(min: 20, max: 30)
}
"""
DomainKeys Identified Mail (DKIM) permits a person, role, or
organization that owns the signing domain to claim some
responsibility for a message by associating the domain with the
message. This can be an author's organization, an operational relay,
or one of their agents.
"""
type DKIM {
"""
ID of the object
"""
id: ID
"""
The domain the scan was run on
"""
domain: URL @fake(type: domainName)
"""
Time when scan was initiated
"""
timestamp: DateTime @fake(type: pastDate)
"""
Various dkim selectors used on this domain.
"""
selectors: [DkimSelectors]
}
"""
This object contains the scan result data for each individual selector that
has been scanned.
"""
type DkimSelectors {
"""
Selector domain that has been scanned.
"""
selector: String
@examples(values: ["selector1._domainkey", "selector2._domainkey"])
"""
DKIM record retrieved during the scan of the given domain
"""
record: String
@examples(
values: [
"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC3rvAQg9bl72tae1RFu4zdx1ZE4E8VUbQfxDcm;"
]
)
"""
Length of DKIM public key
"""
keyLength: String @examples(values: ["sub1024", "1024", "2048", "2048plus"])
"""
Key tags found during scan
"""
dkimGuidanceTags: [String]
@listLength(min: 0, max: 4)
@examples(
values: [
"dkim1"
"dkim2"
"dkim3"
"dkim4"
"dkim5"
"dkim6"
"dkim7"
"dkim8"
"dkim9"
"dkim10"
"dkim11"
"dkim12"
"dkim13"
]
)
}
"""
Domain-based Message Authentication, Reporting, and Conformance
(DMARC) is a scalable mechanism by which a mail-originating
organization can express domain-level policies and preferences for
message validation, disposition, and reporting, that a mail-receiving
organization can use to improve mail handling.
"""
type DMARC {
"""
ID of the object
"""
id: ID
"""
The domain the scan was run on
"""
domain: URL @fake(type: domainName)
"""
Time when scan was initiated
"""
timestamp: DateTime @fake(type: pastDate)
"""
DMARC Phase found when running scan
"""
dmarcPhase: Int
"""
DMARC record retrieved during the scan of the given domain
"""
record: String
@examples(
values: [
"v=DMARC1; p=none; pct=100; rua=mailto:dmarc@cyber.gc.ca; ruf=mailto:dmarc@cyber.gc.ca; fo=1"
"v=DMARC1; p=none; sp=none; rua=mailto:dmarc@cyber.gc.ca"
]
)
"""
The requested policy you wish mailbox providers to apply when your email fails DMARC authentication and alignment checks.
"""
pPolicy: String @examples(values: ["none", "missing", "quarantine", "reject"])
"""
This tag is used to indicate a requested policy for all subdomains where mail
is failing the DMARC authentication and alignment checks.
"""
spPolicy: String
@examples(values: ["none", "missing", "quarantine", "reject"])
"""
The percentage of messages to which the DMARC policy is to be applied.
"""
pct: Int @examples(values: [0, 20, 60, 70, 90, 100])
"""
Key tags found during DMARC Scan
"""
dmarcGuidanceTags: [String]
@listLength(min: 0, max: 4)
@examples(
values: [
"dmarc1"
"dmarc2"
"dmarc3"
"dmarc4"
"dmarc5"
"dmarc6"
"dmarc7"
"dmarc8"
"dmarc9"
"dmarc10"
"dmarc11"
"dmarc12"
"dmarc13"
"dmarc14"
"dmarc15"
"dmarc16"
"dmarc17"
"dmarc18"
"dmarc19"
"dmarc20"
"dmarc21"
"dmarc22"
]
)
}
"""
GraphQL object for returning data for dmarc report tables
"""
type DmarcReportDetailTables {
"""
The month in which the data is relevant to.
"""
month: PeriodEnums
"""
The year in which the relevant to.
"""
year: Year
"""
The details used in creating tables for the dmarc report page
"""
detailTables: DetailTables
}
"""
A query object used to grab the data to create dmarc report doughnuts
"""
type DmarcReportSummary {
"""
Which month is the data based on.
"""
month: PeriodEnums
"""
Which year the data is from.
"""
year: Year
"""
Category totals for building dmarc report page doughnuts.
"""
categoryTotals: CategoryTotals
}
"""
This object is used to define the various arguments used in the dmarc report
summary query
"""
input DmarcReportSummaryInput {
"""
The slugified version of the domain you wish to retrieve data for.
"""
domainSlug: Slug!
"""
The period in which the returned data is relevant to.
"""
period: PeriodEnums!
"""
The year in which the returned data is relevant to.
"""
year: Year!
}
"""
A query object used to grab the data to create dmarc report bar graph
"""
type DmarcReportSummaryList {
"""
The month that the data is related to.
"""
month: PeriodEnums
"""
The year that the data is related to.
"""
year: Year @examples(values: [2019, 2020])
"""
Category totals for building dmarc report page bar graph.
"""
categoryTotals: CategoryTotals
}
"""
This object is used to define the various arguments used in the dmarc report
summary list query
"""
input DmarcReportSummaryListInput {
"""
The slugified version of the domain you wish to retrieve data for.
"""
domainSlug: Slug!
}
"""
A query object used to grab the data to create dmarc by domain table
"""
type DmarcReportSummaryTable {
"""
The month that the data is related to.
"""
month: PeriodEnums
"""
The year that the data is related to.
"""
year: Year! @examples(values: [2019, 2020])
domains: [DmarcReportSummaryTableObject] @listLength(min: 10, max: 20)
}
type DmarcReportSummaryTableObject {
"""
Domain name of data
"""
domain: URL
@examples(
values: [
"javascript:alert('XSS')"
"javascript:eval('aler'+(!![]+[])[+[]])('xss')"
"rcmp-grc.gc.ca"
"tbs-sct.gc.ca"
"canada.ca"
"cra-arc.gc.ca"
"pm.gc.ca"
"cse-cst.gc.ca"
"forces.gc.ca"
"jAva	script:alert('XSS')"
"cra.arc.gc.ca"
"cra-arc.gc.ca"
"cse-cst.gc.ca"
"cyber.gc.ca"
"dfait-maeci.gc.ca"
"dfo-mpo.gc.ca"
"ec.gc.ca"
"forces.gc.ca"
"gccollab.ca"
"gccollaboration.ca"
"goc-gdc.ca"
"hc-sc.gc.ca"
]
)
"""
Total number of messages recieved for domain
"""
totalMessages: Int
@fake(type: number, options: { minNumber: 100, maxNumber: 10000 })
"""
Percentage of messages that passed both DKIM and SPF
"""
fullPassPercentage: Int
@fake(type: number, options: { minNumber: 0, maxNumber: 100 })
"""
Percentage of messages that passed SPF but failed DKIM
"""
passSpfOnlyPercentage: Int
@fake(type: number, options: { minNumber: 0, maxNumber: 100 })
"""
Percentage of messages that passed DKIM but failed SPF
"""
passDkimOnlyPercentage: Int
@fake(type: number, options: { minNumber: 0, maxNumber: 100 })
"""
Percentage of messages that failed both DKIM and SPF
"""
failPercentage: Int
@fake(type: number, options: { minNumber: 0, maxNumber: 100 })
}
type Domain implements Node {
organization: Organizations
"""
The ID of the object.
"""
id: ID!
"""
The domain the scan was run on
"""
url: URL
@examples(
values: [
"javascript:alert('XSS')"
"javascript:eval('aler'+(!![]+[])[+[]])('xss')"
"rcmp-grc.gc.ca"
"tbs-sct.gc.ca"
"canada.ca"
"cra-arc.gc.ca"
"pm.gc.ca"
"cse-cst.gc.ca"
"forces.gc.ca"
"jAva	script:alert('XSS')"
"cra.arc.gc.ca"
"cra-arc.gc.ca"
"cse-cst.gc.ca"
"cyber.gc.ca"
"dfait-maeci.gc.ca"
"dfo-mpo.gc.ca"
"ec.gc.ca"
"forces.gc.ca"
"gccollab.ca"
"gccollaboration.ca"
"goc-gdc.ca"
"hc-sc.gc.ca"
]
)
"""
Slug of the url
"""
slug: Slug
"""
The last time that a scan was ran on this domain
"""
lastRan: DateTime @fake(type: recentDate)
"""
DKIM, DMARC, and SPF scan results
"""
email(
before: String
after: String
first: Int
last: Int
): MailScanConnection
"""
HTTPS, and SSL scan results
"""
web(before: String, after: String, first: Int, last: Int): WebScanConnection
}
type DomainConnection {
"""
Pagination data for this connection.
"""
pageInfo: PageInfo!
"""
Contains the nodes in this connection.
"""
edges: [DomainEdge]! @listLength(min: 3, max: 5)
}
"""
A Relay edge containing a `Domain` and its cursor.
"""
type DomainEdge {
"""
The item at the end of the edge
"""
node: Domain
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
A field whose value conforms to the standard internet email address format as specified in RFC822:
https://www.w3.org/Protocols/rfc822/.
"""
scalar EmailAddress
"""
Results of DKIM, DMARC, and SPF scans, on domains
"""
type MailScan implements Node {
"""
The domain the scan was run on
"""
domain: URL @fake(type: domainName)
"""
The ID of the object.
"""
id: ID!
"""
The time the scan was initiated
"""
timestamp: DateTime @fake(type: pastDate)
"""
Domain-based Message Authentication, Reporting, and Conformance (DMARC)
"""
dmarc: DMARC
"""
Sender Policy Framework (SPF) for Authorizing Use of Domains in Email
"""
spf: SPF
"""
DomainKeys Identified Mail (DKIM) Signatures
"""
dkim: DKIM
}
type MailScanConnection {
"""
Pagination data for this connection.
"""
pageInfo: PageInfo!
"""
Contains the nodes in this connection.
"""
edges: [MailScanEdge]!
}
"""
A Relay edge containing a `MailScan` and its cursor.
"""
type MailScanEdge {
"""
The item at the end of the edge
"""
node: MailScan
"""
A cursor for use in pagination
"""
cursor: String!
}
"""
Mutation that allows the user to verify their account through a token
sent in an email
"""
type EmailVerifyAccount {
"""
Informs user if account was successfully verified.
"""
status: Boolean
}
"""
Input object with the various fields required for the EmailVerifyAccount
mutation
"""
input EmailVerifyAccountInput {
"""
Token in sent via email, and located in url
"""
tokenString: String!
}
"""
Http Scan Object
"""
type HTTPS {
"""
The ID of the object
"""
id: ID
"""
The domain the scan was run on
"""
domain: URL
"""
The time the scan was initiated
"""
timestamp: DateTime
"""
State of the HTTPS implementation on the server and any issues therein
"""
implementation: String
"""
Degree to which HTTPS is enforced on the server based on behaviour
"""
enforced: String
"""
Presence and completeness of HSTS implementation
"""
hsts: String
"""
Denotes how long the domain should only be accessed using HTTPS
"""
hstsAge: String
"""
Denotes whether the domain has been submitted and included within HSTS preload list
"""
preloaded: String
httpsGuidanceTags: [String]
@listLength(min: 0, max: 4)
@examples(
values: [
"https1"
"https2"
"https3"
"https4"
"https5"
"https6"
"https7"
"https8"
"https9"
"https10"
"https11"
"https12"
"https13"
"https14"
]
)
}
"""
Identifiers identify a domain name to be authenticated
"""
type Identifiers {
"""
the domain DMARC uses to check alignment with SPF/DKIM
"""
headerFrom: String @examples(values: ["example.com"])
"""
SPF domain used to check alignment
"""
envelopeFrom: String @examples(values: ["example.com"])
"""
"Envelope Recipient" in the email header
"""
envelopeTo: String @examples(values: ["fastmail.fm"])
}
enum LanguageEnums {
"""
Used for defining if English is the preferred language
"""
ENGLISH
"""
Used for defining if French is the preferred language
"""
FRENCH
}
"""
This mutation allows admins and higher to invite users to any of their
organizations, if the invited user does not have an account, they will be
able to sign-up and be assigned to that organization in one mutation.
"""
type InviteUserToOrg {
"""
Status of inviting user to organization.
"""
status: String
}
"""
An input object containing all input fields for the InviteUserToOrg mutation
"""
input InviteUserToOrgInput {
"""
User's email that you would like to invite to your org.
"""
userName: EmailAddress!
"""
The role which you would like this user to have.
"""
requestedRole: RoleEnums!
"""
The organization you wish to invite the user to.
"""
orgSlug: Slug!
"""
Select the language you would like the email to be sent in.
"""
preferredLanguage: LanguageEnums!
}
"""
The central gathering point for all of the GraphQL mutations.
"""
type Mutation {
authenticateTwoFactor(
otpCode: String!
userName: EmailAddress!
): ValidateTwoFactor
"""
Updates the users permission to an organization.
"""
updateUserRole(
"""
UpdateUserRoleInput object containing all the input fields for this mutation.
"""
input: UpdateUserRoleInput!
): UpdateUserRole
"""
Allows the creation of an organization inside the database.
"""
createOrganization(
"""
Input object containing all the fields required for the createOrganization mutation
"""
input: CreateOrganizationInput!
): CreateOrganization
"""
Allows modification of an organization inside the database.
"""
updateOrganization(
"""
UpdateOrganizationInput object containing all arguement fields.
"""
input: UpdateOrganizationInput!
): UpdateOrganization
"""
Allows the removal of an organization inside the database.
"""
removeOrganization(
"""
Input fields required for the removeOrganization mutation.
"""
input: RemoveOrganizationInput!
): RemoveOrganization
"""
Allows the creation of domains for a given organization
"""
createDomain(
"""
Input object containing all arguement fields.
"""
input: CreateDomainInput!
): CreateDomain
"""
Allows the modification of domains.
"""
updateDomain(
"""
updateDomain input object containing all arguement fields.
"""
input: UpdateDomainInput!
): UpdateDomain
"""
Allows the removal of a given domain
"""
removeDomain(
"""
Input object containing all required fields for mutation to run.
"""
input: RemoveDomainInputObject!
): RemoveDomain
"""
This mutation is used to send a domain to the scanners to be scanned
"""
requestScan(
"""
Input object with fields used for requesting mutation
"""
input: RequestScanInput!
): RequestScan
"""
Allows users to give their credentials and be authenticated
"""
authenticate(
"""
AuthenticateInput object containing input fields
"""
input: AuthenticateInput!
): Authenticate
"""
Allows users to sign up to our service.
"""
signUp(
"""
Input object containing all fields for signUp mutation.
"""
input: SignUpInput!
): SignUp