|
| 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 | + ``` |
| 63 | +
|
| 64 | + </CodeWithCopy> |
| 65 | +
|
| 66 | + </template> |
| 67 | +
|
| 68 | + <template #tough-cookie_2.5.0> |
| 69 | +
|
| 70 | + <CodeWithCopy> |
| 71 | +
|
| 72 | + ```text |
| 73 | + "dependencies": { |
| 74 | + "tough-cookie": "npm:@els-js/[email protected]" |
| 75 | + } |
| 76 | + ``` |
| 77 | +
|
| 78 | + </CodeWithCopy> |
| 79 | +
|
| 80 | + </template> |
| 81 | +
|
| 82 | + </TableTabs> |
| 83 | +
|
| 84 | +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: |
| 85 | + |
| 86 | + <CodeWithCopy> |
| 87 | +
|
| 88 | + ```text |
| 89 | + rm -rf node_modules package-lock.json && npm cache clean --force |
| 90 | + ``` |
| 91 | + |
| 92 | + </CodeWithCopy> |
| 93 | + |
| 94 | +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): |
| 95 | + |
| 96 | + <CodeWithCopy> |
| 97 | + |
| 98 | + ```text |
| 99 | + npm install |
| 100 | + ``` |
| 101 | + |
| 102 | + </CodeWithCopy> |
| 103 | + |
| 104 | + Example output: |
| 105 | + |
| 106 | + ```text |
| 107 | + added 4 packages, and audited 5 packages in 1s |
| 108 | +
|
| 109 | + 1 package is looking for funding |
| 110 | + run `npm fund` for details |
| 111 | +
|
| 112 | + found 0 vulnerabilities |
| 113 | + ``` |
| 114 | + |
| 115 | +7. You've successfully integrated the TuxCare ELS for tough-cookie repository into your project. |
| 116 | + |
| 117 | +## Vulnerability Exploitability eXchange (VEX) |
| 118 | + |
| 119 | +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. |
| 120 | + |
| 121 | +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/). |
| 122 | + |
| 123 | +## How to Upgrade to a Newer Version of TuxCare Packages |
| 124 | + |
| 125 | +If you have already installed a package with a `tuxcare.1` suffix and want to upgrade to a newer release (for example, `tuxcare.3`), there are two options: |
| 126 | + |
| 127 | +* **Option 1**. Run the `npm install` command with the specific version. This will automatically update both `package.json` and `package-lock.json`. For example: |
| 128 | + |
| 129 | + <CodeWithCopy> |
| 130 | + |
| 131 | + ```text |
| 132 | + npm install tough-cookienpm:@els-js/[email protected] |
| 133 | + ``` |
| 134 | + |
| 135 | + </CodeWithCopy> |
| 136 | + |
| 137 | +* **Option 2**. Update the version string in your `package.json`, remove installed files and clear npm cache to avoid conflicts: |
| 138 | + |
| 139 | + <CodeWithCopy> |
| 140 | + |
| 141 | + ```text |
| 142 | + rm -rf node_modules package-lock.json && npm cache clean --force |
| 143 | + npm install |
| 144 | + ``` |
| 145 | + |
| 146 | + </CodeWithCopy> |
0 commit comments