@auth0/auth0-checkmate 1.4.0 → 1.5.1

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.
@@ -0,0 +1,89 @@
1
+ # Contributor Covenant 3.0 Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We pledge to make our community welcoming, safe, and equitable for all.
6
+
7
+ We are committed to fostering an environment that respects and promotes the dignity, rights, and contributions of all individuals, regardless of characteristics including race, ethnicity, caste, color, age, physical characteristics, neurodiversity, disability, sex or gender, gender identity or expression, sexual orientation, language, philosophy or religion, national or social origin, socio-economic position, level of education, or other status. The same privileges of participation are extended to everyone who participates in good faith and in accordance with this Covenant.
8
+
9
+
10
+ ## Encouraged Behaviors
11
+
12
+ While acknowledging differences in social norms, we all strive to meet our community's expectations for positive behavior. We also understand that our words and actions may be interpreted differently than we intend based on culture, background, or native language.
13
+
14
+ With these considerations in mind, we agree to behave mindfully toward each other and act in ways that center our shared values, including:
15
+
16
+ 1. Respecting the **purpose of our community**, our activities, and our ways of gathering.
17
+ 2. Engaging **kindly and honestly** with others.
18
+ 3. Respecting **different viewpoints** and experiences.
19
+ 4. **Taking responsibility** for our actions and contributions.
20
+ 5. Gracefully giving and accepting **constructive feedback**.
21
+ 6. Committing to **repairing harm** when it occurs.
22
+ 7. Behaving in other ways that promote and sustain the **well-being of our community**.
23
+
24
+
25
+ ## Restricted Behaviors
26
+
27
+ We agree to restrict the following behaviors in our community. Instances, threats, and promotion of these behaviors are violations of this Code of Conduct.
28
+
29
+ 1. **Harassment.** Violating explicitly expressed boundaries or engaging in unnecessary personal attention after any clear request to stop.
30
+ 2. **Character attacks.** Making insulting, demeaning, or pejorative comments directed at a community member or group of people.
31
+ 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or behavior on the basis of immutable identities or traits.
32
+ 4. **Sexualization.** Behaving in a way that would generally be considered inappropriately intimate in the context or purpose of the community.
33
+ 5. **Violating confidentiality**. Sharing or acting on someone's personal or private information without their permission.
34
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other harm toward any person or group.
35
+ 7. Behaving in other ways that **threaten the well-being** of our community.
36
+
37
+ ### Other Restrictions
38
+
39
+ 1. **Misleading identity.** Impersonating someone else for any reason, or pretending to be someone else to evade enforcement actions.
40
+ 2. **Failing to credit sources.** Not properly crediting the sources of content you contribute.
41
+ 3. **Promotional materials**. Sharing marketing or other commercial content in a way that is outside the norms of the community.
42
+ 4. **Irresponsible communication.** Failing to responsibly present content which includes, links or describes any other restricted behaviors.
43
+
44
+
45
+ ## Reporting an Issue
46
+
47
+ Tensions can occur between community members even when they are trying their best to collaborate. Not every conflict represents a code of conduct violation, and this Code of Conduct reinforces encouraged behaviors and norms that can help avoid conflicts and minimize harm.
48
+
49
+ When an incident does occur, it is important to report it promptly. To report a possible violation, please email auth0-checkmate@okta.com.
50
+
51
+ Community Moderators take reports of violations seriously and will make every effort to respond in a timely manner. They will investigate all reports of code of conduct violations, reviewing messages, logs, and recordings, or interviewing witnesses and other participants. Community Moderators will keep investigation and enforcement actions as transparent as possible while prioritizing safety and confidentiality. In order to honor these values, enforcement actions are carried out in private with the involved parties, but communicating to the whole community may be part of a mutually agreed upon resolution.
52
+
53
+
54
+ ## Addressing and Repairing Harm
55
+
56
+ If an investigation by the Community Moderators finds that this Code of Conduct has been violated, the following enforcement ladder may be used to determine how best to repair harm, based on the incident's impact on the individuals involved and the community as a whole. Depending on the severity of a violation, lower rungs on the ladder may be skipped.
57
+
58
+ 1) Warning
59
+ 1) Event: A violation involving a single incident or series of incidents.
60
+ 2) Consequence: A private, written warning from the Community Moderators.
61
+ 3) Repair: Examples of repair include a private written apology, acknowledgement of responsibility, and seeking clarification on expectations.
62
+ 2) Temporarily Limited Activities
63
+ 1) Event: A repeated incidence of a violation that previously resulted in a warning, or the first incidence of a more serious violation.
64
+ 2) Consequence: A private, written warning with a time-limited cooldown period designed to underscore the seriousness of the situation and give the community members involved time to process the incident. The cooldown period may be limited to particular communication channels or interactions with particular community members.
65
+ 3) Repair: Examples of repair may include making an apology, using the cooldown period to reflect on actions and impact, and being thoughtful about re-entering community spaces after the period is over.
66
+ 3) Temporary Suspension
67
+ 1) Event: A pattern of repeated violation which the Community Moderators have tried to address with warnings, or a single serious violation.
68
+ 2) Consequence: A private written warning with conditions for return from suspension. In general, temporary suspensions give the person being suspended time to reflect upon their behavior and possible corrective actions.
69
+ 3) Repair: Examples of repair include respecting the spirit of the suspension, meeting the specified conditions for return, and being thoughtful about how to reintegrate with the community when the suspension is lifted.
70
+ 4) Permanent Ban
71
+ 1) Event: A pattern of repeated code of conduct violations that other steps on the ladder have failed to resolve, or a violation so serious that the Community Moderators determine there is no way to keep the community safe with this person as a member.
72
+ 2) Consequence: Access to all community spaces, tools, and communication channels is removed. In general, permanent bans should be rarely used, should have strong reasoning behind them, and should only be resorted to if working through other remedies has failed to change the behavior.
73
+ 3) Repair: There is no possible repair in cases of this severity.
74
+
75
+ This enforcement ladder is intended as a guideline. It does not limit the ability of Community Managers to use their discretion and judgment, in keeping with the best interests of our community.
76
+
77
+
78
+ ## Scope
79
+
80
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public or other spaces. Examples of representing our community include using an official email address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
81
+
82
+
83
+ ## Attribution
84
+
85
+ This Code of Conduct is adapted from the Contributor Covenant, version 3.0, permanently available at [https://www.contributor-covenant.org/version/3/0/](https://www.contributor-covenant.org/version/3/0/).
86
+
87
+ Contributor Covenant is stewarded by the Organization for Ethical Source and licensed under CC BY-SA 4.0. To view a copy of this license, visit [https://creativecommons.org/licenses/by-sa/4.0/](https://creativecommons.org/licenses/by-sa/4.0/)
88
+
89
+ For answers to common questions about Contributor Covenant, see the FAQ at [https://www.contributor-covenant.org/faq](https://www.contributor-covenant.org/faq). Translations are provided at [https://www.contributor-covenant.org/translations](https://www.contributor-covenant.org/translations). Additional enforcement and community guideline resources can be found at [https://www.contributor-covenant.org/resources](https://www.contributor-covenant.org/resources). The enforcement ladder was inspired by the work of [Mozilla’s code of conduct team](https://github.com/mozilla/inclusion).
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # Auth0 Checkmate
1
+ # CheckMate for Auth0
2
2
 
3
- **Auth0 Checkmate** is a command-line utility that performs configuration checks on your Auth0 tenant. It helps ensure your tenant is securely and correctly configured by validating key settings and generating a detailed report.
3
+ **CheckMate for Auth0** is a command-line utility that performs configuration checks on your Auth0 tenant. It helps ensure your tenant is securely and correctly configured by validating key settings and generating a detailed report.
4
4
 
5
5
  ---
6
6
 
@@ -16,13 +16,13 @@
16
16
 
17
17
  This tool makes use of the **Auth0 Management API**, which **consumes your tenant’s [rate limits](https://auth0.com/docs/troubleshoot/customer-support/operational-policies/rate-limit-policy/rate-limit-configurations)**. Use it thoughtfully to avoid throttling.
18
18
 
19
- Checkmate for Auth0 is designed to provide visibility into its behavior through your Auth0 tenant's [log events](https://auth0.com/docs/deploy-monitor/logs). Tracking its use is important for monitoring and debugging purposes. You can track its use in several ways, including:
19
+ CheckMate for Auth0 is designed to provide visibility into its behavior through your Auth0 tenant's [log events](https://auth0.com/docs/deploy-monitor/logs). Tracking its use is important for monitoring and debugging purposes. You can track its use in several ways, including:
20
20
 
21
- - The `User-Agent` string in the HTTP request header, which will have a value in the form of `${packageName}/${packageVersion}` (e.g. `auth0-checkmate/1.2.14`). Keep in mind that if the `User-Agent` string is modified on the client side, then Checkmate for Auth0 usage cannot be tracked this way.
22
- - The `client_name` and `scopes` assigned to Checkmate when configuring initial access
21
+ - The `User-Agent` string in the HTTP request header, which will have a value in the form of `${packageName}/${packageVersion}` (e.g. `@auth0/auth0-checkmate/1.4.0`). Keep in mind that if the `User-Agent` string is modified on the client side, then CheckMate for Auth0 usage cannot be tracked this way.
22
+ - The `client_name` and `scopes` assigned to CheckMate when configuring initial access
23
23
  - `seccft` events (Successful exchange of Access Token for a Client Credentials Grant) in Auth0 logs
24
24
 
25
- As an example, Checkmate activity might result in a log entry like the one shown below. Each field in the log entry provides valuable information for troubleshooting or auditing, such as the `client_name` identifying the application, the `scope` showing granted permissions, and the `user_agent` indicating the tool version used.
25
+ As an example, CheckMate activity might result in a log entry like the one shown below. Each field in the log entry provides valuable information for troubleshooting or auditing, such as the `client_name` identifying the application, the `scope` showing granted permissions, and the `user_agent` indicating the tool version used.
26
26
 
27
27
  ```json
28
28
  {
@@ -66,10 +66,10 @@ As an example, Checkmate activity might result in a log entry like the one shown
66
66
 
67
67
  ### Option 1 – Global Installation
68
68
 
69
- Install Auth0 Checkmate globally to use it as a standalone CLI tool:
69
+ Install CheckMate for Auth0 globally to use it as a standalone CLI tool:
70
70
 
71
71
  ```bash
72
- npm install -g https://github.com/auth0/auth0-checkmate
72
+ npm install -g @auth0/auth0-checkmate
73
73
  ```
74
74
 
75
75
  Then run it with:
@@ -112,7 +112,7 @@ Follow the interactive prompts to get started.
112
112
 
113
113
  ## 🔐 Auth0 Setup Instructions
114
114
 
115
- To use Auth0 Checkmate, you need a **dedicated Auth0 Application** to authorize calls to the Management API.
115
+ To use CheckMate for Auth0, you need a **dedicated Auth0 Application** to authorize calls to the Management API.
116
116
 
117
117
  ### Create a Machine-to-Machine Application
118
118
 
@@ -122,7 +122,7 @@ To use Auth0 Checkmate, you need a **dedicated Auth0 Application** to authorize
122
122
  2. Click **“Create Application”**
123
123
 
124
124
  3. In the setup form:
125
- - **Name:** `Auth0 Checkmate` (or similar)
125
+ - **Name:** `Auth0 CheckMate` (or similar)
126
126
  - **Application Type:** `Machine to Machine Applications`
127
127
  - Click **“Create”**
128
128
 
@@ -163,4 +163,4 @@ To use Auth0 Checkmate, you need a **dedicated Auth0 Application** to authorize
163
163
 
164
164
  ## ✅ You're All Set
165
165
 
166
- With your Auth0 application configured and the CLI installed, you’re ready to run **Auth0 Checkmate** and ensure your tenant setup is secure and complete.
166
+ With your Auth0 application configured and the CLI installed, you’re ready to run **CheckMate for Auth0** and ensure your tenant setup is secure and complete.
@@ -1,9 +1,9 @@
1
- Checkmate for Auth0 Third Party Licenses and Notices
1
+ CheckMate for Auth0 Third Party Licenses and Notices
2
2
 
3
- This document contains third party open source licenses and notices for the Checkmate for Auth0 product. Certain licenses and notices may appear in other parts of the
3
+ This document contains third party open source licenses and notices for the CheckMate for Auth0 product. Certain licenses and notices may appear in other parts of the
4
4
  product in accordance with the applicable license requirements.
5
5
 
6
- The Checkmate for Auth0 product that this document references does not necessarily use all the
6
+ The CheckMate for Auth0 product that this document references does not necessarily use all the
7
7
  open source software packages referred to below and may also only use portions
8
8
  of a given package.
9
9
 
@@ -124,26 +124,11 @@ License: MIT
124
124
  Copyright (c) 2011-2022 OpenJS Foundation and contributors, https://openjsf.org
125
125
  Repository: https://github.com/mochajs/mocha
126
126
 
127
- nock (14.0.1)
128
- License: MIT
129
- Copyright (c) 2011-2019 Pedro Teixeira and other contributors
130
- Repository: https://github.com/nock/nock
131
-
132
127
  nyc (17.1.0)
133
128
  License: ISC
134
129
  Copyright (c) 2015, Contributors
135
130
  Repository: https://github.com/istanbuljs/nyc
136
131
 
137
- proxyquire (2.1.3)
138
- License: MIT
139
- Copyright 2013 Thorsten Lorenz
140
- Repository: https://github.com/thlorenz/proxyquire
141
-
142
- sinon (19.0.2)
143
- License: BSD-3-Clause
144
- Copyright (c) 2010-2020, Christian Johansen
145
- Repository: https://github.com/sinonjs/sinon
146
-
147
132
  -------------------------------------------------------------------------------
148
133
  License Texts
149
134
  -------------------------------------------------------------------------------
@@ -71,19 +71,22 @@ const acorn = require("acorn");
71
71
  const walk = require("estree-walker").walk;
72
72
 
73
73
  function detectHardcodedValues(code, scriptName) {
74
- let processedCode = code.replace(/(?!\w+#)\b#(\w+)/g, "_$1");
74
+
75
+ const hardcodedValues = [];
76
+
77
+ let processedCode = String(code || '').replace(/(?!\w+#)\b#(\w+)/g, "_$1");
78
+
75
79
  const ast = acorn.parse(processedCode, {
76
80
  ecmaVersion: "latest",
77
81
  locations: true,
78
82
  });
79
83
 
80
- const hardcodedValues = [];
81
-
82
84
  // Walk through the AST
83
85
  walk(ast, {
84
86
  enter(node) {
85
87
  // Check for variable assignments with hardcoded literals
86
88
  if (node.type === "VariableDeclaration") {
89
+
87
90
  node.declarations.forEach((declaration) => {
88
91
  if (
89
92
  declaration.init &&
@@ -91,14 +94,17 @@ function detectHardcodedValues(code, scriptName) {
91
94
  typeof declaration.init.value === "string"
92
95
  ) {
93
96
  // Add the variable name and the type of the hardcoded literal
97
+ const value = declaration.init.value;
98
+
94
99
  hardcodedValues.push({
95
100
  scriptName: scriptName,
96
101
  variableName: declaration.id.name,
97
102
  field: "hard_coded_value_detected",
98
103
  status: CONSTANTS.FAIL,
99
104
  type: typeof declaration.init.value,
100
- line: declaration.loc.start.line,
101
- column: declaration.loc.start.column,
105
+ line: declaration.loc?.start?.line || 'N/A',
106
+ column: declaration.loc?.start?.column || 'N/A',
107
+ value: value,
102
108
  });
103
109
  }
104
110
  });
@@ -135,15 +141,23 @@ function checkActionsHardCodedValues(options) {
135
141
  if (_.isEmpty(actionsList)) {
136
142
  return callback(reports);
137
143
  }
138
- actionsList.forEach((action) => {
144
+ for (const action of actionsList) {
139
145
  var actionName = action.name.concat(
140
146
  ` (${action.supported_triggers[0].id})`,
141
147
  );
142
- var report = detectHardcodedValues(action.code, actionName);
143
- if (report.length > 0) {
144
- reports.push({ name: actionName, report: report });
148
+ try {
149
+ var report = detectHardcodedValues(action.code, actionName);
150
+ if (report.length > 0) {
151
+ reports.push({ name: actionName, report: report });
152
+ }
153
+ } catch (e) {
154
+ if (e instanceof SyntaxError) {
155
+ console.error(`[CHECK ERROR] Skipping malformed Actions: ${actionName}`);
156
+ continue; // Skip to the next action in the loop
157
+ }
158
+ throw e;
145
159
  }
146
- });
160
+ }
147
161
  return callback(reports);
148
162
  });
149
163
  }
package/bin/index.js CHANGED
@@ -12,8 +12,6 @@ const puppeteer = require("puppeteer");
12
12
  const { getToday, getFormattedDateTime } = require("../analyzer/tools/utils");
13
13
  const Handlebars = require("handlebars");
14
14
  const i18n = require("i18n");
15
- const os = require("os");
16
- const userHomeDir = os.homedir();
17
15
  const Table = require("cli-table3");
18
16
  const {
19
17
  getAccessToken,
@@ -63,10 +61,6 @@ const templateData = fs.readFileSync(
63
61
  path.join(__dirname, "../views/pdf_cli_report.handlebars"),
64
62
  "utf8",
65
63
  );
66
- const imagePath = path.join(__dirname, '../images/auth0.png');
67
- const imageBuffer = fs.readFileSync(imagePath);
68
- const base64Image = imageBuffer.toString('base64');
69
- const imageSrc = `data:image/png;base64,${base64Image}`;
70
64
 
71
65
  /**
72
66
  *
@@ -193,7 +187,6 @@ async function generatePdf(filePath, data) {
193
187
  const htmlContent = template({
194
188
  locale: data.locale,
195
189
  data,
196
- logoBase64: imageSrc,
197
190
  preamble: data.report.preamble,
198
191
  });
199
192
  const page = await browser.newPage();
@@ -363,7 +356,7 @@ async function main() {
363
356
  name: "filePath",
364
357
  message:
365
358
  "Enter the full path where you want to save the file (e.g., /path/to/file.pdf):",
366
- default: userHomeDir,
359
+ default: "./reports",
367
360
  validate: (input) => {
368
361
  if (input.trim() === "") {
369
362
  return "Please enter a valid file path.";
@@ -378,7 +371,7 @@ async function main() {
378
371
  auth0ClientId: answers.auth0ClientId || null,
379
372
  auth0ClientSecret: answers.auth0ClientSecret || null,
380
373
  auth0MgmtToken: answers.auth0MgmtToken || null,
381
- filePath: path.join(userHomeDir, answers.filePath),
374
+ filePath: path.isAbsolute(answers.filePath) ? answers.filePath : path.resolve(answers.filePath),
382
375
  selectedValidators: selectedValidators ? selectedValidators.split(',') : []
383
376
  };
384
377
 
package/locales/en.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "heading": "Summary of findings"
33
33
  }
34
34
  },
35
- "report_title": "Checkmate for Auth0 Configuration Report",
35
+ "report_title": "CheckMate for Auth0 Configuration Report",
36
36
  "list_of_validators": [
37
37
  {
38
38
  "title": "Custom Domains",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@auth0/auth0-checkmate",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
4
4
  "description": "A command line tool for checking configuration of your Auth0 tenant",
5
5
  "main": "analyzer/report.js",
6
6
  "scripts": {
@@ -17,21 +17,21 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "acorn": "^8.14.0",
20
- "axios": "^1.12.0",
20
+ "axios": "^1.12.2",
21
21
  "chalk": "^4.1.2",
22
22
  "cli-table3": "^0.6.5",
23
23
  "estree-walker": "^2.0.2",
24
- "figlet": "^1.8.0",
24
+ "figlet": "^1.9.2",
25
25
  "glob": "^11.0.1",
26
26
  "handlebars": "^4.7.8",
27
- "i18n": "^0.15.1",
28
- "inquirer": "^12.3.3",
27
+ "i18n": "^0.15.2",
28
+ "inquirer": "^12.9.6",
29
29
  "jsonwebtoken": "^9.0.2",
30
30
  "lodash": "^4.17.21",
31
31
  "moment": "^2.30.1",
32
- "puppeteer": "^24.10.0",
32
+ "puppeteer": "^24.23.0",
33
33
  "semver": "^7.7.1",
34
- "winston": "^3.17.0"
34
+ "winston": "^3.18.3"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@eslint/js": "^9.23.0",
@@ -40,10 +40,7 @@
40
40
  "eslint-plugin-mocha": "^10.5.0",
41
41
  "globals": "^16.0.0",
42
42
  "mocha": "^11.1.0",
43
- "nock": "^14.0.1",
44
- "nyc": "^17.1.0",
45
- "proxyquire": "^2.1.3",
46
- "sinon": "^19.0.2"
43
+ "nyc": "^17.1.0"
47
44
  },
48
45
  "publishConfig": {
49
46
  "access": "public"
@@ -2,7 +2,7 @@
2
2
 
3
3
  <head>
4
4
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
5
- <title>Checkmate for Auth0 Configuration Report</title>
5
+ <title>CheckMate for Auth0 Configuration Report</title>
6
6
  <link
7
7
  href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css"
8
8
  rel="stylesheet"
@@ -254,7 +254,6 @@
254
254
  <div
255
255
  style="width: 100%; height: 50vh; display: flex; flex-direction: column; justify-content: center; align-items: center;"
256
256
  >
257
- <img src="{{logoBase64}}" alt="Auth0" width="250" height="98""/>
258
257
  <h1
259
258
  style="font-size: 36px; margin-bottom: 20px;"
260
259
  >{{data.report.report_title}}</h1>
package/images/auth0.png DELETED
Binary file
package/images/okta.png DELETED
Binary file