cycode 0.2.0__tar.gz → 0.2.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. {cycode-0.2.0 → cycode-0.2.1}/PKG-INFO +64 -1
  2. {cycode-0.2.0 → cycode-0.2.1}/README.md +64 -1
  3. cycode-0.2.1/cli/__init__.py +1 -0
  4. {cycode-0.2.0 → cycode-0.2.1}/cyclient/__init__.py +1 -1
  5. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/PKG-INFO +64 -1
  6. cycode-0.2.0/cli/__init__.py +0 -1
  7. {cycode-0.2.0 → cycode-0.2.1}/LICENCE +0 -0
  8. {cycode-0.2.0 → cycode-0.2.1}/VERSION.txt +0 -0
  9. {cycode-0.2.0 → cycode-0.2.1}/cli/auth/__init__.py +0 -0
  10. {cycode-0.2.0 → cycode-0.2.1}/cli/auth/auth_command.py +0 -0
  11. {cycode-0.2.0 → cycode-0.2.1}/cli/auth/auth_manager.py +0 -0
  12. {cycode-0.2.0 → cycode-0.2.1}/cli/ci_integrations.py +0 -0
  13. {cycode-0.2.0 → cycode-0.2.1}/cli/code_scanner.py +0 -0
  14. {cycode-0.2.0 → cycode-0.2.1}/cli/config.py +0 -0
  15. {cycode-0.2.0 → cycode-0.2.1}/cli/config.yaml +0 -0
  16. {cycode-0.2.0 → cycode-0.2.1}/cli/consts.py +0 -0
  17. {cycode-0.2.0 → cycode-0.2.1}/cli/cycode.py +0 -0
  18. {cycode-0.2.0 → cycode-0.2.1}/cli/exceptions/__init__.py +0 -0
  19. {cycode-0.2.0 → cycode-0.2.1}/cli/exceptions/custom_exceptions.py +0 -0
  20. {cycode-0.2.0 → cycode-0.2.1}/cli/helpers/__init__.py +0 -0
  21. {cycode-0.2.0 → cycode-0.2.1}/cli/helpers/sca_code_scanner.py +0 -0
  22. {cycode-0.2.0 → cycode-0.2.1}/cli/models.py +0 -0
  23. {cycode-0.2.0 → cycode-0.2.1}/cli/printers/__init__.py +0 -0
  24. {cycode-0.2.0 → cycode-0.2.1}/cli/printers/base_printer.py +0 -0
  25. {cycode-0.2.0 → cycode-0.2.1}/cli/printers/json_printer.py +0 -0
  26. {cycode-0.2.0 → cycode-0.2.1}/cli/printers/results_printer.py +0 -0
  27. {cycode-0.2.0 → cycode-0.2.1}/cli/printers/text_printer.py +0 -0
  28. {cycode-0.2.0 → cycode-0.2.1}/cli/user_settings/__init__.py +0 -0
  29. {cycode-0.2.0 → cycode-0.2.1}/cli/user_settings/base_file_manager.py +0 -0
  30. {cycode-0.2.0 → cycode-0.2.1}/cli/user_settings/config_file_manager.py +0 -0
  31. {cycode-0.2.0 → cycode-0.2.1}/cli/user_settings/configuration_manager.py +0 -0
  32. {cycode-0.2.0 → cycode-0.2.1}/cli/user_settings/credentials_manager.py +0 -0
  33. {cycode-0.2.0 → cycode-0.2.1}/cli/user_settings/user_settings_commands.py +0 -0
  34. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/__init__.py +0 -0
  35. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/path_utils.py +0 -0
  36. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/scan_utils.py +0 -0
  37. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/shell_executor.py +0 -0
  38. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/string_utils.py +0 -0
  39. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/task_timer.py +0 -0
  40. {cycode-0.2.0 → cycode-0.2.1}/cli/utils/yaml_utils.py +0 -0
  41. {cycode-0.2.0 → cycode-0.2.1}/cli/zip_file.py +0 -0
  42. {cycode-0.2.0 → cycode-0.2.1}/cyclient/auth_client.py +0 -0
  43. {cycode-0.2.0 → cycode-0.2.1}/cyclient/config.py +0 -0
  44. {cycode-0.2.0 → cycode-0.2.1}/cyclient/config.yaml +0 -0
  45. {cycode-0.2.0 → cycode-0.2.1}/cyclient/cycode_client.py +0 -0
  46. {cycode-0.2.0 → cycode-0.2.1}/cyclient/cycode_token_based_client.py +0 -0
  47. {cycode-0.2.0 → cycode-0.2.1}/cyclient/models.py +0 -0
  48. {cycode-0.2.0 → cycode-0.2.1}/cyclient/scan_client.py +0 -0
  49. {cycode-0.2.0 → cycode-0.2.1}/cyclient/utils.py +0 -0
  50. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/SOURCES.txt +0 -0
  51. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/dependency_links.txt +0 -0
  52. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/entry_points.txt +0 -0
  53. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/requires.txt +0 -0
  54. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/top_level.txt +0 -0
  55. {cycode-0.2.0 → cycode-0.2.1}/cycode.egg-info/zip-safe +0 -0
  56. {cycode-0.2.0 → cycode-0.2.1}/setup.cfg +0 -0
  57. {cycode-0.2.0 → cycode-0.2.1}/setup.py +0 -0
  58. {cycode-0.2.0 → cycode-0.2.1}/tests/__init__.py +0 -0
  59. {cycode-0.2.0 → cycode-0.2.1}/tests/cyclient/__init__.py +0 -0
  60. {cycode-0.2.0 → cycode-0.2.1}/tests/cyclient/test_scan_client.py +0 -0
  61. {cycode-0.2.0 → cycode-0.2.1}/tests/test_code_scanner.py +0 -0
  62. {cycode-0.2.0 → cycode-0.2.1}/tests/test_models.py +0 -0
  63. {cycode-0.2.0 → cycode-0.2.1}/tests/test_zip_file.py +0 -0
  64. {cycode-0.2.0 → cycode-0.2.1}/tests/user_settings/__init__.py +0 -0
  65. {cycode-0.2.0 → cycode-0.2.1}/tests/user_settings/test_configuration_manager.py +0 -0
  66. {cycode-0.2.0 → cycode-0.2.1}/tests/user_settings/test_user_settings_commands.py +0 -0
  67. {cycode-0.2.0 → cycode-0.2.1}/tests/utils/__init__.py +0 -0
  68. {cycode-0.2.0 → cycode-0.2.1}/tests/utils/test_path_utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cycode
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Perform secrets/iac scans for your sources using Cycode's engine
5
5
  Home-page: https://github.com/cycodehq-public/cycode-cli
6
6
  Author: Cycode
@@ -183,6 +183,69 @@ repos:
183
183
  > Successful hook installation will result in the message:<br/>
184
184
  `Pre-commit installed at .git/hooks/pre-commit`
185
185
 
186
+ ## Pre-receive Hook
187
+
188
+ ### Prerequisites
189
+
190
+ 1. Install Cycode CLI on your Git server - Install the Cycode CLI by running `pip3 install cycode --user`. Check that the CLI installed successfully by running `cycode`. If you get `cycode: command not found`, you need to add the installation path to the `PATH` environment variable.
191
+ 3. Cycode service account
192
+
193
+ ### Instructions
194
+
195
+ #### Install for a specific repository
196
+
197
+ 1. Find the repository location in the Git server instance.
198
+ - For GitLab Enterprise: [Git server hooks | GitLab](https://docs.gitlab.com/ee/administration/server_hooks.html)
199
+
200
+ 2. Create the pre-receive hook.
201
+ - Create a new file in the repository's Git hook location under the repository location you found in step 1, and name it `pre-receive`.
202
+ - Copy the following script to the `pre-recive` file:
203
+
204
+ ```sh
205
+ #!/bin/sh
206
+
207
+ # optional
208
+ # Update the server URL only if you have Cycode self managed
209
+ # export CYCODE_API_URL = "<cycode server url>"
210
+ export CYCODE_CLIENT_ID="<client_id>"
211
+ export CYCODE_CLIENT_SECRET="<client_secret>"
212
+
213
+ set -e
214
+ cycode scan pre_receive
215
+ ```
216
+
217
+ - Make the file executable by running `chmod +x pre-receive`.
218
+ - Change the file owner and owner group to `git` user:
219
+ - `chown git pre-receive` (change file owner).
220
+ - `chgrp git pre-receive` (change file group owner).
221
+ - Verify it by running `ls -l`. The output should be `-rwxr-xr-x 1 git git 662 Mar 2 09:15 pre-receive` (first `git` is the file's owner, second `git` is the file's group owner).
222
+
223
+ 3. Configure the Cycode token.
224
+ - There are two methods to set it:
225
+ - In the script above, fill in the client ID and secret.
226
+ - Set environment variables on the instance.
227
+
228
+ 4. [Optional] Update Cycode API url (relevant only for on-prem customers) - Update `CYCODE_API_URL` in the pre-receive file.
229
+
230
+ #### Install pre-recive hook globaly (For all the repositories)
231
+
232
+ 1. Set the global hooks directory in the Git server instance.
233
+ - For GitLab Enterprise (https://docs.gitlab.com/ee/administration/server_hooks.html#create-global-server-hooks-for-all-repositories) :
234
+ - Set in `/etc/gitlab/gitlab.rb` the `gitaly['custom_hooks_dir']` value or just use the default location by uncommenting it.
235
+ - Run `gitlab-ctl reconfigure`.
236
+ - Follow the steps [here](#install-for-a-specific-repository)
237
+
238
+ 2. Add the pre-receive hook according to the Git server requirements.
239
+ - For GitLab Enterprise:
240
+ - Go to the directory and create a directory named `pre-receive.d`.
241
+ - Inside the directory, follow the steps of "Install for a specific repository" above.
242
+
243
+ #### Skipping the pre-receive hook
244
+
245
+ Cycode's pre-receive hook can be skipped easily by adding `-o skip-cycode-scan` to the `git push` command.
246
+
247
+ > **Notice:** Verify that the option `receive.advertisePushOptions` is enabled in the instance Git configuration. For enabling it, run `git config receive.advertisePushOptions true`. It seems that in GitLab, it's enabled by default.
248
+
186
249
  # Cycode Command
187
250
 
188
251
  The following are the options and commands available with the Cycode CLI application:
@@ -166,6 +166,69 @@ repos:
166
166
  > Successful hook installation will result in the message:<br/>
167
167
  `Pre-commit installed at .git/hooks/pre-commit`
168
168
 
169
+ ## Pre-receive Hook
170
+
171
+ ### Prerequisites
172
+
173
+ 1. Install Cycode CLI on your Git server - Install the Cycode CLI by running `pip3 install cycode --user`. Check that the CLI installed successfully by running `cycode`. If you get `cycode: command not found`, you need to add the installation path to the `PATH` environment variable.
174
+ 3. Cycode service account
175
+
176
+ ### Instructions
177
+
178
+ #### Install for a specific repository
179
+
180
+ 1. Find the repository location in the Git server instance.
181
+ - For GitLab Enterprise: [Git server hooks | GitLab](https://docs.gitlab.com/ee/administration/server_hooks.html)
182
+
183
+ 2. Create the pre-receive hook.
184
+ - Create a new file in the repository's Git hook location under the repository location you found in step 1, and name it `pre-receive`.
185
+ - Copy the following script to the `pre-recive` file:
186
+
187
+ ```sh
188
+ #!/bin/sh
189
+
190
+ # optional
191
+ # Update the server URL only if you have Cycode self managed
192
+ # export CYCODE_API_URL = "<cycode server url>"
193
+ export CYCODE_CLIENT_ID="<client_id>"
194
+ export CYCODE_CLIENT_SECRET="<client_secret>"
195
+
196
+ set -e
197
+ cycode scan pre_receive
198
+ ```
199
+
200
+ - Make the file executable by running `chmod +x pre-receive`.
201
+ - Change the file owner and owner group to `git` user:
202
+ - `chown git pre-receive` (change file owner).
203
+ - `chgrp git pre-receive` (change file group owner).
204
+ - Verify it by running `ls -l`. The output should be `-rwxr-xr-x 1 git git 662 Mar 2 09:15 pre-receive` (first `git` is the file's owner, second `git` is the file's group owner).
205
+
206
+ 3. Configure the Cycode token.
207
+ - There are two methods to set it:
208
+ - In the script above, fill in the client ID and secret.
209
+ - Set environment variables on the instance.
210
+
211
+ 4. [Optional] Update Cycode API url (relevant only for on-prem customers) - Update `CYCODE_API_URL` in the pre-receive file.
212
+
213
+ #### Install pre-recive hook globaly (For all the repositories)
214
+
215
+ 1. Set the global hooks directory in the Git server instance.
216
+ - For GitLab Enterprise (https://docs.gitlab.com/ee/administration/server_hooks.html#create-global-server-hooks-for-all-repositories) :
217
+ - Set in `/etc/gitlab/gitlab.rb` the `gitaly['custom_hooks_dir']` value or just use the default location by uncommenting it.
218
+ - Run `gitlab-ctl reconfigure`.
219
+ - Follow the steps [here](#install-for-a-specific-repository)
220
+
221
+ 2. Add the pre-receive hook according to the Git server requirements.
222
+ - For GitLab Enterprise:
223
+ - Go to the directory and create a directory named `pre-receive.d`.
224
+ - Inside the directory, follow the steps of "Install for a specific repository" above.
225
+
226
+ #### Skipping the pre-receive hook
227
+
228
+ Cycode's pre-receive hook can be skipped easily by adding `-o skip-cycode-scan` to the `git push` command.
229
+
230
+ > **Notice:** Verify that the option `receive.advertisePushOptions` is enabled in the instance Git configuration. For enabling it, run `git config receive.advertisePushOptions true`. It seems that in GitLab, it's enabled by default.
231
+
169
232
  # Cycode Command
170
233
 
171
234
  The following are the options and commands available with the Cycode CLI application:
@@ -450,4 +513,4 @@ For example, to see options available for a Path Scan, you would simply enter:
450
513
 
451
514
  To see the options available for the ignore scan function, use this command:
452
515
 
453
- `cycode ignore --help`
516
+ `cycode ignore --help`
@@ -0,0 +1 @@
1
+ __version__ = "0.2.1"
@@ -1,6 +1,6 @@
1
1
  from .config import logger
2
2
 
3
- __version__ = "0.2.0"
3
+ __version__ = "0.2.1"
4
4
 
5
5
 
6
6
  __all__ = [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cycode
3
- Version: 0.2.0
3
+ Version: 0.2.1
4
4
  Summary: Perform secrets/iac scans for your sources using Cycode's engine
5
5
  Home-page: https://github.com/cycodehq-public/cycode-cli
6
6
  Author: Cycode
@@ -183,6 +183,69 @@ repos:
183
183
  > Successful hook installation will result in the message:<br/>
184
184
  `Pre-commit installed at .git/hooks/pre-commit`
185
185
 
186
+ ## Pre-receive Hook
187
+
188
+ ### Prerequisites
189
+
190
+ 1. Install Cycode CLI on your Git server - Install the Cycode CLI by running `pip3 install cycode --user`. Check that the CLI installed successfully by running `cycode`. If you get `cycode: command not found`, you need to add the installation path to the `PATH` environment variable.
191
+ 3. Cycode service account
192
+
193
+ ### Instructions
194
+
195
+ #### Install for a specific repository
196
+
197
+ 1. Find the repository location in the Git server instance.
198
+ - For GitLab Enterprise: [Git server hooks | GitLab](https://docs.gitlab.com/ee/administration/server_hooks.html)
199
+
200
+ 2. Create the pre-receive hook.
201
+ - Create a new file in the repository's Git hook location under the repository location you found in step 1, and name it `pre-receive`.
202
+ - Copy the following script to the `pre-recive` file:
203
+
204
+ ```sh
205
+ #!/bin/sh
206
+
207
+ # optional
208
+ # Update the server URL only if you have Cycode self managed
209
+ # export CYCODE_API_URL = "<cycode server url>"
210
+ export CYCODE_CLIENT_ID="<client_id>"
211
+ export CYCODE_CLIENT_SECRET="<client_secret>"
212
+
213
+ set -e
214
+ cycode scan pre_receive
215
+ ```
216
+
217
+ - Make the file executable by running `chmod +x pre-receive`.
218
+ - Change the file owner and owner group to `git` user:
219
+ - `chown git pre-receive` (change file owner).
220
+ - `chgrp git pre-receive` (change file group owner).
221
+ - Verify it by running `ls -l`. The output should be `-rwxr-xr-x 1 git git 662 Mar 2 09:15 pre-receive` (first `git` is the file's owner, second `git` is the file's group owner).
222
+
223
+ 3. Configure the Cycode token.
224
+ - There are two methods to set it:
225
+ - In the script above, fill in the client ID and secret.
226
+ - Set environment variables on the instance.
227
+
228
+ 4. [Optional] Update Cycode API url (relevant only for on-prem customers) - Update `CYCODE_API_URL` in the pre-receive file.
229
+
230
+ #### Install pre-recive hook globaly (For all the repositories)
231
+
232
+ 1. Set the global hooks directory in the Git server instance.
233
+ - For GitLab Enterprise (https://docs.gitlab.com/ee/administration/server_hooks.html#create-global-server-hooks-for-all-repositories) :
234
+ - Set in `/etc/gitlab/gitlab.rb` the `gitaly['custom_hooks_dir']` value or just use the default location by uncommenting it.
235
+ - Run `gitlab-ctl reconfigure`.
236
+ - Follow the steps [here](#install-for-a-specific-repository)
237
+
238
+ 2. Add the pre-receive hook according to the Git server requirements.
239
+ - For GitLab Enterprise:
240
+ - Go to the directory and create a directory named `pre-receive.d`.
241
+ - Inside the directory, follow the steps of "Install for a specific repository" above.
242
+
243
+ #### Skipping the pre-receive hook
244
+
245
+ Cycode's pre-receive hook can be skipped easily by adding `-o skip-cycode-scan` to the `git push` command.
246
+
247
+ > **Notice:** Verify that the option `receive.advertisePushOptions` is enabled in the instance Git configuration. For enabling it, run `git config receive.advertisePushOptions true`. It seems that in GitLab, it's enabled by default.
248
+
186
249
  # Cycode Command
187
250
 
188
251
  The following are the options and commands available with the Cycode CLI application:
@@ -1 +0,0 @@
1
- __version__ = "0.2.0"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes