/
constants.go
90 lines (55 loc) 路 2.91 KB
/
constants.go
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
// Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements;
// and to You under the Apache License, Version 2.0. See LICENSE in project root for full license + copyright.
package keynuker_go_common
import "time"
// Note: this package should not have any dependencies to any other keynuker-go sub-packages,
// since they will probably create circular dependencies
const (
DefaultKeyNukerOrg = "default"
DocIdPrefixGithubUsers = "github_users"
DocIdPrefixAwsKeys = "aws_keys"
DocIdPrefixGithubEventCheckpoints = "github_event_checkpoints"
)
// Environment Variable Names
const (
EnvVarKeyNukerTestGithubAccessToken = "KEYNUKER_INTEGRATION_TEST_GITHUB_ACCESS_TOKEN"
EnvVarKeyNukerTestDbHost = "KEYNUKER_DB_HOST"
EnvVarKeyNukerTestDbName = "KEYNUKER_DB_NAME"
EnvVarKeyNukerTestDbUsername = "KEYNUKER_DB_KEY"
EnvVarKeyNukerTestDbPassword = "KEYNUKER_DB_SECRET_KEY"
EnvVarKeyNukerTestTargetAwsAccounts = "KEYNUKER_TARGET_AWS_ACCOUNTS"
EnvVarKeyNukerTestIntegrationTestsEnabled = "KEYNUKER_INTEGRATION_TESTS_ENABLED"
EnvVarKeyNukerTestIntegrationAccessKey = "KEYNUKER_INTEGRATION_TEST_ACCESS_KEY"
EnvVarKeyNukerTestIntegrationSecretAccessKey = "KEYNUKER_INTEGRATION_TEST_SECRET_ACCESS_KEY"
EnvVarKeyNukerInitiatingAwsAccountCreds = "KEYNUKER_INITIATING_AWS_ACCOUNT"
EnvVarKeyNukerTestIntegrationGithubApiBaseUrl = "KEYNUKER_INTEGRATION_TEST_GITHUB_BASE_API_URL"
EnvVarKeyNukerTestGithubOrgs = "KEYNUKER_INTEGRATION_TEST_GITHUB_ORGS"
EnvVarKeyNukerTestGithubLeakTargetRepo = "KEYNUKER_GITHUB_LEAK_TARGET_REPO"
EnvVarKeyNukerEmailFromAddress = "KEYNUKER_EMAIL_FROM_ADDRESS"
EnvVarKeyNukerAdminEmailCCAddress = "KEYNUKER_ADMIN_EMAIL_CC_ADDRESS"
EnvVarKeyNukerMailerDomain = "KEYNUKER_MAILER_DOMAIN"
EnvVarKeyNukerMailerApiKey = "KEYNUKER_MAILER_API_KEY"
EnvVarKeyNukerMailerPublicApiKey = "KEYNUKER_MAILER_PUBLIC_API_KEY"
)
// Misc
const (
// The integration test creates branches on the github repo.
// Add improbable string at end to make it as unlikely as possible to collide with a real branch name
KeyNukerIntegrationTestBranch = "KeyNukerIntegrationTestBranch-5a2f42dd3058f53ac9c5f22153257db7b594c663"
GithubRefsHeadsPrefix = "refs/heads"
GithubMasterBranch = "master"
// The max size in bytes of blob content that will be scanned.
// This should be raised to 100 MB once the stream based scanning is implemented.
MaxSizeBytesBlobContent = 10000000 // 10 MB
// The max execution time for an action in seconds
MaxActionExecutionSeconds = time.Second * 300
// The high watermark at which point an action should be aborted since approaching max
HighWatermarkExecutionSeconds = MaxActionExecutionSeconds - (time.Second * 60)
)
var (
// If there is no recorded checkpoint for a user, how far back should the scanning go in the github user event history?
DefaultCheckpointEventTimeWindow time.Duration
)
func init() {
DefaultCheckpointEventTimeWindow = time.Hour * -12
}