You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user/best-practices-security.md
+18-20Lines changed: 18 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,26 +46,7 @@ Preventing commands from displaying any output is one way to avoid accidentally
46
46
git push url-with-secret >/dev/null 2>&1
47
47
```
48
48
49
-
## If you think that you might have exposed secure information
50
-
51
-
As an initial step, it’s possible to delete logs containing any secure information by clicking the *Remove log* button on the build log page of Travis CI.
If you discover a leak in one of your build logs it’s essential that you revoke the leaked token or environment variable, and update any build scripts or commands that caused the leak.
56
-
57
-
### Alternative methods of deleting logs
58
-
59
-
Instead of deleting build logs manually, you can do so using the [Travis CI CLI](https://github.com/travis-ci/travis.rb#logs) or the [API](https://developer.travis-ci.com/resource/log#delete).
60
-
61
-
> Note that if you're still using [travis-ci.org](http://www.travis-ci.org) you need to use the [open source API](https://developer.travis-ci.org/resource/log#delete) instead.
62
-
63
-
## Rotate tokens and secrets periodically
64
-
Rotate your tokens and secrets regularly. GitHub OAuth tokens can be found in your [Developer Settings](https://github.com/settings/developers) on the GitHub site. Please regularly rotate credentials for other third-party services as well.
65
-
66
-
## How to prevent secrets from being exposed in the build job logs
67
-
68
-
While using Travis CI, you may want to consider the following means to decrease the risk of exposing secrets in the build job logs:
49
+
While using Travis CI, you may want to consider the additional means to decrease the risk of exposing secrets in the build job logs:
69
50
70
51
### Always use encrypted secrets
71
52
Travis CI offers the ability to either [encrypt your secret](/user/encryption-keys/) with the Travis-CLI (command line interface tool) or define the secret in the [Travis CI Repository Settings](/user/environment-variables/#defining-variables-in-repository-settings).
@@ -89,6 +70,23 @@ Review the [Travis CI Repository Settings](/user/pull-requests#pull-requests-and
89
70
If this is a viable option, consider running builds requiring the usage of secrets as a CI/CD for private repositories with a carefully reviewed collaborator list. Combined with the above options, it should decrease the risk of secret exposition in the build job log.
90
71
91
72
73
+
## If you think that you might have exposed secure information
74
+
75
+
As an initial step, it’s possible to delete logs containing any secure information by clicking the *Remove log* button on the build log page of Travis CI.
If you discover a leak in one of your build logs it’s essential that you revoke the leaked token or environment variable, and update any build scripts or commands that caused the leak.
80
+
81
+
### Alternative methods of deleting logs
82
+
83
+
Instead of deleting build logs manually, you can do so using the [Travis CI CLI](https://github.com/travis-ci/travis.rb#logs) or the [API](https://developer.travis-ci.com/resource/log#delete).
84
+
85
+
> Note that if you're still using [travis-ci.org](http://www.travis-ci.org) you need to use the [open source API](https://developer.travis-ci.org/resource/log#delete) instead.
86
+
87
+
## Rotate tokens and secrets periodically
88
+
Rotate your tokens and secrets regularly. GitHub OAuth tokens can be found in your [Developer Settings](https://github.com/settings/developers) on the GitHub site. Please regularly rotate credentials for other third-party services as well.
89
+
92
90
## More information
93
91
The suggestions in this document reflect general recommendations that the Travis CI team and community encourage everyone to follow. However, suggestions here are not exhaustive, and you should use your best judgement to determine security processes for your project. If you have any questions about security at Travis CI or suspect you may have found a vulnerability, please contact us at <[email protected]>.
0 commit comments