|
| 1 | +# tough-cookie |
| 2 | + |
| 3 | +Endless Lifecycle Support (ELS) for tough-cookie from TuxCare provides security fixes for tough-cookie versions that have reached their end of life. This allows you to continue running tough-cookie applications without vulnerability concerns, even after official support has ended. |
| 4 | + |
| 5 | +## Supported tough-cookie Versions |
| 6 | + |
| 7 | +* tough-cookie 2.4.3, 2.5.0 |
| 8 | + |
| 9 | +## Connection to ELS for tough-cookie Repository |
| 10 | + |
| 11 | +This guide outlines the steps needed to integrate the TuxCare ELS for tough-cookie repository. |
| 12 | + |
| 13 | +## Step 1: Get Token |
| 14 | + |
| 15 | +You need a token in order to use TuxCare ELS tough-cookie repository. Anonymous access is disabled. To receive the token, please contact [[email protected]](mailto:[email protected]). |
| 16 | + |
| 17 | +## Step 2: Set Up ELS for tough-cookie |
| 18 | + |
| 19 | +TuxCare provides ELS for tough-cookie as an NPM package, hosted on a secure internal registry. Follow the steps below to add it to your project and get started. |
| 20 | + |
| 21 | +1. Navigate to the root directory of your tough-cookie project. |
| 22 | +2. Create a `.npmrc` file or update it if it already exists. |
| 23 | + |
| 24 | + **Example:** |
| 25 | + |
| 26 | + ```text |
| 27 | + my-tough-cookie-project/ |
| 28 | + ├── node_modules/ |
| 29 | + ├── package.json |
| 30 | + ├── .npmrc ⚠️ ← Create it here |
| 31 | + └── package-lock.json |
| 32 | + ``` |
| 33 | + |
| 34 | +3. Use an editor of your choice (e.g., VS Code) to add the following registry address line: |
| 35 | + |
| 36 | + <CodeWithCopy> |
| 37 | + |
| 38 | + ```text |
| 39 | + registry=https://registry.npmjs.org/ |
| 40 | + @els-js:registry=https://nexus.repo.tuxcare.com/repository/els_js/ |
| 41 | + //nexus.repo.tuxcare.com/repository/els_js/:_auth=${TOKEN} |
| 42 | + ``` |
| 43 | + |
| 44 | + </CodeWithCopy> |
| 45 | + |
| 46 | + :::warning |
| 47 | + Replace ${TOKEN} with the token you received from [[email protected]](mailto:[email protected]). |
| 48 | + ::: |
| 49 | + |
| 50 | +4. Update your `package.json` file to replace your tough-cookie dependencies with the TuxCare packages: |
| 51 | + |
| 52 | + <TableTabs label="Choose tough-cookie version: " > |
| 53 | + |
| 54 | + <template #tough-cookie_2.4.3> |
| 55 | + |
| 56 | + <CodeWithCopy> |
| 57 | + |
| 58 | + ```text |
| 59 | + "dependencies": { |
| 60 | + "tough-cookie": "npm:@els-js/[email protected]" |
| 61 | + }, |
| 62 | + "overrides": { |
| 63 | + "tough-cookie": "npm:@els-js/[email protected]" |
| 64 | + } |
| 65 | + ``` |
| 66 | +
|
| 67 | + </CodeWithCopy> |
| 68 | +
|
| 69 | + </template> |
| 70 | +
|
| 71 | + <template #tough-cookie_2.5.0> |
| 72 | +
|
| 73 | + <CodeWithCopy> |
| 74 | +
|
| 75 | + ```text |
| 76 | + "dependencies": { |
| 77 | + "tough-cookie": "npm:@els-js/[email protected]" |
| 78 | + }, |
| 79 | + "overrides": { |
| 80 | + "tough-cookie": "npm:@els-js/[email protected]" |
| 81 | + } |
| 82 | + ``` |
| 83 | +
|
| 84 | + </CodeWithCopy> |
| 85 | +
|
| 86 | + </template> |
| 87 | +
|
| 88 | + </TableTabs> |
| 89 | +
|
| 90 | +5. You need to remove the `node_modules` directory and the `package-lock.json` file, and also clear the `npm cache` before installing the patched packages. Use the following commands: |
| 91 | + |
| 92 | + <CodeWithCopy> |
| 93 | +
|
| 94 | + ```text |
| 95 | + rm -rf node_modules package-lock.json && npm cache clean --force |
| 96 | + ``` |
| 97 | + |
| 98 | + </CodeWithCopy> |
| 99 | + |
| 100 | +6. Run the following command to install ELS for tough-cookie dependencies (token for the TuxCare repository will be automatically picked up from your `.npmrc` file): |
| 101 | + |
| 102 | + <CodeWithCopy> |
| 103 | + |
| 104 | + ```text |
| 105 | + npm install |
| 106 | + ``` |
| 107 | + |
| 108 | + </CodeWithCopy> |
| 109 | + |
| 110 | + Example output: |
| 111 | + |
| 112 | + ```text |
| 113 | + added 4 packages, and audited 5 packages in 1s |
| 114 | +
|
| 115 | + 1 package is looking for funding |
| 116 | + run `npm fund` for details |
| 117 | +
|
| 118 | + found 0 vulnerabilities |
| 119 | + ``` |
| 120 | + |
| 121 | +7. You've successfully integrated the TuxCare ELS for tough-cookie repository into your project. |
| 122 | + |
| 123 | +## Vulnerability Exploitability eXchange (VEX) |
| 124 | + |
| 125 | +VEX is a machine-readable format that tells you if a known vulnerability and is actually exploitable in your product. It reduces false positives, helps prioritize real risks. |
| 126 | + |
| 127 | +TuxCare provides VEX for tough-cookie ELS versions: [security.tuxcare.com/vex/cyclonedx/els_lang_javascript/tough/](https://security.tuxcare.com/vex/cyclonedx/els_lang_javascript/tough/). |
| 128 | + |
| 129 | +## How to Upgrade to a Newer Version of TuxCare Packages |
| 130 | + |
| 131 | +If you have already installed a package with a `tuxcare.1` suffix and want to upgrade to a newer release (for example, `tuxcare.3`), update the version strings in your `package.json`, remove installed files and clear npm cache to avoid conflicts: |
| 132 | + |
| 133 | + <CodeWithCopy> |
| 134 | + |
| 135 | + ```text |
| 136 | + rm -rf node_modules package-lock.json && npm cache clean --force |
| 137 | + npm install |
| 138 | + ``` |
| 139 | + |
| 140 | + </CodeWithCopy> |
0 commit comments