@lateos/npm-scan 0.18.2 → 0.18.3

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 (89) hide show
  1. package/.dockerignore +20 -20
  2. package/.husky/pre-commit +1 -1
  3. package/CHANGELOG.md +233 -233
  4. package/LICENSING.md +19 -19
  5. package/README.de.md +708 -708
  6. package/README.fr.md +707 -707
  7. package/README.ja.md +704 -704
  8. package/README.md +826 -826
  9. package/README.zh.md +708 -708
  10. package/SECURITY.md +72 -72
  11. package/backend/cra.js +68 -68
  12. package/backend/db/schema.sql +32 -32
  13. package/backend/db.js +88 -88
  14. package/backend/detectors/atk-001-lifecycle.js +17 -17
  15. package/backend/detectors/atk-002-obfusc.js +261 -261
  16. package/backend/detectors/atk-003-creds.js +13 -13
  17. package/backend/detectors/atk-004-persist.js +13 -13
  18. package/backend/detectors/atk-005-exfil.js +13 -13
  19. package/backend/detectors/atk-006-depconf.js +14 -14
  20. package/backend/detectors/atk-007-typosquat.js +34 -34
  21. package/backend/detectors/atk-008-tarball-tamper.js +91 -91
  22. package/backend/detectors/atk-009-dormant-trigger.js +62 -62
  23. package/backend/detectors/atk-010-sandbox-evasion.js +50 -50
  24. package/backend/detectors/atk-011-transitive-prop.js +76 -76
  25. package/backend/detectors/cve-2026-48710-badhost/codePattern.js +99 -99
  26. package/backend/detectors/cve-2026-48710-badhost/findings.js +105 -105
  27. package/backend/detectors/cve-2026-48710-badhost/index.js +15 -15
  28. package/backend/detectors/cve-2026-48710-badhost/manifest.js +305 -305
  29. package/backend/detectors/cve-2026-48710-badhost/transitive.js +189 -189
  30. package/backend/detectors/hf-impersonation/index.js +396 -396
  31. package/backend/detectors/hf-impersonation/jaro-winkler.js +44 -44
  32. package/backend/detectors/hf-impersonation/known-orgs.js +5 -5
  33. package/backend/detectors/hf-impersonation/simhash.js +46 -46
  34. package/backend/detectors/index.js +81 -81
  35. package/backend/detectors/megalodon/d1-workflow-scan.js +147 -147
  36. package/backend/detectors/megalodon/d2-credential-harvest.js +61 -61
  37. package/backend/detectors/megalodon/d3-publish-velocity.js +67 -67
  38. package/backend/detectors/megalodon/d4-publisher-drift.js +124 -124
  39. package/backend/detectors/megalodon/d5-bot-commit-identity.js +3 -3
  40. package/backend/detectors/megalodon/d6-date-anachronism.js +3 -3
  41. package/backend/detectors/megalodon/index.js +80 -80
  42. package/backend/detectors/megalodon/types.js +9 -9
  43. package/backend/detectors/mini-shai-hulud/d1-burst-publish.js +42 -42
  44. package/backend/detectors/mini-shai-hulud/d2-sibling-compromise.js +116 -116
  45. package/backend/detectors/mini-shai-hulud/d3-slsa-mismatch.js +72 -72
  46. package/backend/detectors/mini-shai-hulud/d4-maintainer-anomaly.js +45 -45
  47. package/backend/detectors/mini-shai-hulud/d5-ioc-check.js +95 -95
  48. package/backend/detectors/mini-shai-hulud/d6-token-exfil.js +38 -38
  49. package/backend/detectors/mini-shai-hulud/index.js +118 -118
  50. package/backend/detectors/mini-shai-hulud/iocs.json +79 -79
  51. package/backend/fetch.js +175 -175
  52. package/backend/index.js +4 -4
  53. package/backend/license.js +89 -89
  54. package/backend/lockfile.js +379 -379
  55. package/backend/pdf.js +245 -245
  56. package/backend/policy.js +193 -193
  57. package/backend/report.js +254 -254
  58. package/backend/sbom.js +66 -66
  59. package/backend/siem/cef.js +32 -32
  60. package/backend/siem/ecs.js +40 -40
  61. package/backend/siem/index.js +18 -18
  62. package/backend/siem/qradar.js +56 -56
  63. package/backend/siem/sentinel.js +27 -27
  64. package/backend/vsix-scan/detectors/activation-event-risk.js +116 -116
  65. package/backend/vsix-scan/detectors/burst-publish.js +52 -52
  66. package/backend/vsix-scan/detectors/exfil-pattern.js +88 -88
  67. package/backend/vsix-scan/detectors/known-ioc.js +105 -105
  68. package/backend/vsix-scan/detectors/orphan-commit-fetch.js +69 -69
  69. package/backend/vsix-scan/detectors/publisher-anomaly.js +70 -70
  70. package/backend/vsix-scan/index.js +183 -183
  71. package/backend/vsix-scan/marketplace-client.js +145 -145
  72. package/backend/vsix-scan/vsix-iocs.json +31 -31
  73. package/cli/cli.js +458 -458
  74. package/deploy/helm/npm-scan/Chart.yaml +21 -21
  75. package/deploy/helm/npm-scan/templates/_helpers.tpl +8 -8
  76. package/deploy/helm/npm-scan/templates/api.yaml +93 -93
  77. package/deploy/helm/npm-scan/templates/ingress.yaml +27 -27
  78. package/deploy/helm/npm-scan/templates/postgresql.yaml +66 -66
  79. package/deploy/helm/npm-scan/templates/secrets.yaml +18 -18
  80. package/deploy/helm/npm-scan/templates/worker.yaml +31 -31
  81. package/deploy/helm/npm-scan/values.byoc.yaml +74 -74
  82. package/deploy/helm/npm-scan/values.yaml +102 -102
  83. package/package.json +57 -57
  84. package/scripts/download-corpus.js +30 -30
  85. package/scripts/gen-mal-corpus.js +34 -34
  86. package/test/fixtures/lockfiles/npm-lock.json +68 -68
  87. package/test/fixtures/lockfiles/pnpm-lock.yaml +117 -117
  88. package/test/fixtures/lockfiles/yarn.lock +103 -103
  89. package/test/fixtures/mock-data.js +69 -69
@@ -1,22 +1,22 @@
1
- apiVersion: v2
2
- name: npm-scan
3
- description: npm supply chain security scanner — BYOC Helm chart for enterprise/government deployments
4
- type: application
5
- version: 1.0.0
6
- appVersion: "1.0.0"
7
- keywords:
8
- - npm
9
- - security
10
- - supply-chain
11
- - scanner
12
- - byoc
13
- - stig
14
- - fips
15
- - soc2
16
- - fedramp
17
- sources:
18
- - https://github.com/lateos-ai/npm-scan
19
- maintainers:
20
- - name: Lateos
21
- email: hello@lateos.ai
1
+ apiVersion: v2
2
+ name: npm-scan
3
+ description: npm supply chain security scanner — BYOC Helm chart for enterprise/government deployments
4
+ type: application
5
+ version: 1.0.0
6
+ appVersion: "1.0.0"
7
+ keywords:
8
+ - npm
9
+ - security
10
+ - supply-chain
11
+ - scanner
12
+ - byoc
13
+ - stig
14
+ - fips
15
+ - soc2
16
+ - fedramp
17
+ sources:
18
+ - https://github.com/lateos-ai/npm-scan
19
+ maintainers:
20
+ - name: Lateos
21
+ email: hello@lateos.ai
22
22
  dependencies: []
@@ -1,9 +1,9 @@
1
- {{- define "npm-scan.name" -}}
2
- {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
3
- {{- end }}
4
-
5
- {{- define "npm-scan.labels" -}}
6
- helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
7
- app.kubernetes.io/instance: {{ .Release.Name }}
8
- app.kubernetes.io/managed-by: {{ .Release.Service }}
1
+ {{- define "npm-scan.name" -}}
2
+ {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
3
+ {{- end }}
4
+
5
+ {{- define "npm-scan.labels" -}}
6
+ helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version }}
7
+ app.kubernetes.io/instance: {{ .Release.Name }}
8
+ app.kubernetes.io/managed-by: {{ .Release.Service }}
9
9
  {{- end }}
@@ -1,94 +1,94 @@
1
- apiVersion: apps/v1
2
- kind: Deployment
3
- metadata:
4
- name: {{ include "npm-scan.name" . }}-api
5
- labels:
6
- app: {{ include "npm-scan.name" . }}-api
7
- {{- include "npm-scan.labels" . | nindent 4 }}
8
- annotations:
9
- stig: "SRG-APP-000141"
10
- spec:
11
- replicas: {{ .Values.api.replicas }}
12
- selector:
13
- matchLabels:
14
- app: {{ include "npm-scan.name" . }}-api
15
- template:
16
- metadata:
17
- labels:
18
- app: {{ include "npm-scan.name" . }}-api
19
- spec:
20
- containers:
21
- - name: api
22
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
23
- imagePullPolicy: {{ .Values.image.pullPolicy }}
24
- command: ["node", "cli/cli.js", "serve"]
25
- ports:
26
- - containerPort: {{ .Values.api.port }}
27
- env:
28
- - name: API_PORT
29
- value: "{{ .Values.api.port }}"
30
- - name: API_HOST
31
- value: "{{ .Values.api.host }}"
32
- - name: NPM_SCAN_LICENSE_KEY
33
- valueFrom:
34
- secretKeyRef:
35
- name: {{ include "npm-scan.name" . }}-license
36
- key: key
37
- optional: true
38
- - name: NPM_SCAN_PREMIUM
39
- value: "{{ .Values.premium.enabled }}"
40
- {{- if .Values.premium.byoc.enabled }}
41
- - name: NPM_SCAN_BYOC
42
- value: "true"
43
- - name: NPM_SCAN_CLOUD_PROVIDER
44
- value: "{{ .Values.premium.byoc.cloudProvider }}"
45
- {{- end }}
46
- {{- if .Values.siem.enabled }}
47
- - name: SIEM_ENABLED
48
- value: "true"
49
- - name: SIEM_TYPE
50
- value: "{{ .Values.siem.type }}"
51
- - name: SIEM_ENDPOINT
52
- value: "{{ .Values.siem.endpoint }}"
53
- - name: SIEM_PORT
54
- value: "{{ .Values.siem.port }}"
55
- {{- end }}
56
- {{- if .Values.sso.enabled }}
57
- - name: SSO_ENABLED
58
- value: "true"
59
- - name: SSO_PROVIDER
60
- value: "{{ .Values.sso.provider }}"
61
- - name: SSO_ISSUER_URL
62
- value: "{{ .Values.sso.issuerUrl }}"
63
- {{- end }}
64
- {{- if .Values.postgresql.enabled }}
65
- - name: PG_HOST
66
- value: "{{ .Values.postgresql.host }}"
67
- - name: PG_PORT
68
- value: "{{ .Values.postgresql.port }}"
69
- - name: PG_DATABASE
70
- value: "{{ .Values.postgresql.database }}"
71
- - name: PG_USERNAME
72
- value: "{{ .Values.postgresql.username }}"
73
- - name: PG_PASSWORD
74
- valueFrom:
75
- secretKeyRef:
76
- name: {{ .Values.postgresql.existingSecret | default (printf "%s-pg" (include "npm-scan.name" .)) }}
77
- key: password
78
- optional: true
79
- {{- end }}
80
- resources: {{- toYaml .Values.api.resources | nindent 12 }}
81
- ---
82
- apiVersion: v1
83
- kind: Service
84
- metadata:
85
- name: {{ include "npm-scan.name" . }}-api
86
- labels:
87
- app: {{ include "npm-scan.name" . }}-api
88
- spec:
89
- type: {{ .Values.service.type }}
90
- ports:
91
- - port: {{ .Values.service.port }}
92
- targetPort: {{ .Values.api.port }}
93
- selector:
1
+ apiVersion: apps/v1
2
+ kind: Deployment
3
+ metadata:
4
+ name: {{ include "npm-scan.name" . }}-api
5
+ labels:
6
+ app: {{ include "npm-scan.name" . }}-api
7
+ {{- include "npm-scan.labels" . | nindent 4 }}
8
+ annotations:
9
+ stig: "SRG-APP-000141"
10
+ spec:
11
+ replicas: {{ .Values.api.replicas }}
12
+ selector:
13
+ matchLabels:
14
+ app: {{ include "npm-scan.name" . }}-api
15
+ template:
16
+ metadata:
17
+ labels:
18
+ app: {{ include "npm-scan.name" . }}-api
19
+ spec:
20
+ containers:
21
+ - name: api
22
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
23
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
24
+ command: ["node", "cli/cli.js", "serve"]
25
+ ports:
26
+ - containerPort: {{ .Values.api.port }}
27
+ env:
28
+ - name: API_PORT
29
+ value: "{{ .Values.api.port }}"
30
+ - name: API_HOST
31
+ value: "{{ .Values.api.host }}"
32
+ - name: NPM_SCAN_LICENSE_KEY
33
+ valueFrom:
34
+ secretKeyRef:
35
+ name: {{ include "npm-scan.name" . }}-license
36
+ key: key
37
+ optional: true
38
+ - name: NPM_SCAN_PREMIUM
39
+ value: "{{ .Values.premium.enabled }}"
40
+ {{- if .Values.premium.byoc.enabled }}
41
+ - name: NPM_SCAN_BYOC
42
+ value: "true"
43
+ - name: NPM_SCAN_CLOUD_PROVIDER
44
+ value: "{{ .Values.premium.byoc.cloudProvider }}"
45
+ {{- end }}
46
+ {{- if .Values.siem.enabled }}
47
+ - name: SIEM_ENABLED
48
+ value: "true"
49
+ - name: SIEM_TYPE
50
+ value: "{{ .Values.siem.type }}"
51
+ - name: SIEM_ENDPOINT
52
+ value: "{{ .Values.siem.endpoint }}"
53
+ - name: SIEM_PORT
54
+ value: "{{ .Values.siem.port }}"
55
+ {{- end }}
56
+ {{- if .Values.sso.enabled }}
57
+ - name: SSO_ENABLED
58
+ value: "true"
59
+ - name: SSO_PROVIDER
60
+ value: "{{ .Values.sso.provider }}"
61
+ - name: SSO_ISSUER_URL
62
+ value: "{{ .Values.sso.issuerUrl }}"
63
+ {{- end }}
64
+ {{- if .Values.postgresql.enabled }}
65
+ - name: PG_HOST
66
+ value: "{{ .Values.postgresql.host }}"
67
+ - name: PG_PORT
68
+ value: "{{ .Values.postgresql.port }}"
69
+ - name: PG_DATABASE
70
+ value: "{{ .Values.postgresql.database }}"
71
+ - name: PG_USERNAME
72
+ value: "{{ .Values.postgresql.username }}"
73
+ - name: PG_PASSWORD
74
+ valueFrom:
75
+ secretKeyRef:
76
+ name: {{ .Values.postgresql.existingSecret | default (printf "%s-pg" (include "npm-scan.name" .)) }}
77
+ key: password
78
+ optional: true
79
+ {{- end }}
80
+ resources: {{- toYaml .Values.api.resources | nindent 12 }}
81
+ ---
82
+ apiVersion: v1
83
+ kind: Service
84
+ metadata:
85
+ name: {{ include "npm-scan.name" . }}-api
86
+ labels:
87
+ app: {{ include "npm-scan.name" . }}-api
88
+ spec:
89
+ type: {{ .Values.service.type }}
90
+ ports:
91
+ - port: {{ .Values.service.port }}
92
+ targetPort: {{ .Values.api.port }}
93
+ selector:
94
94
  app: {{ include "npm-scan.name" . }}-api
@@ -1,28 +1,28 @@
1
- {{- if .Values.ingress.enabled -}}
2
- apiVersion: networking.k8s.io/v1
3
- kind: Ingress
4
- metadata:
5
- name: {{ include "npm-scan.name" . }}
6
- labels: {{- include "npm-scan.labels" . | nindent 4 }}
7
- {{- with .Values.ingress.annotations }}
8
- annotations: {{- toYaml . | nindent 4 }}
9
- {{- end }}
10
- spec:
11
- {{- with .Values.ingress.className }}
12
- ingressClassName: {{ . }}
13
- {{- end }}
14
- rules:
15
- - host: {{ .Values.ingress.host | quote }}
16
- http:
17
- paths:
18
- - path: /
19
- pathType: Prefix
20
- backend:
21
- service:
22
- name: {{ include "npm-scan.name" . }}-api
23
- port:
24
- number: {{ .Values.service.port }}
25
- {{- with .Values.ingress.tls }}
26
- tls: {{- toYaml . | nindent 4 }}
27
- {{- end }}
1
+ {{- if .Values.ingress.enabled -}}
2
+ apiVersion: networking.k8s.io/v1
3
+ kind: Ingress
4
+ metadata:
5
+ name: {{ include "npm-scan.name" . }}
6
+ labels: {{- include "npm-scan.labels" . | nindent 4 }}
7
+ {{- with .Values.ingress.annotations }}
8
+ annotations: {{- toYaml . | nindent 4 }}
9
+ {{- end }}
10
+ spec:
11
+ {{- with .Values.ingress.className }}
12
+ ingressClassName: {{ . }}
13
+ {{- end }}
14
+ rules:
15
+ - host: {{ .Values.ingress.host | quote }}
16
+ http:
17
+ paths:
18
+ - path: /
19
+ pathType: Prefix
20
+ backend:
21
+ service:
22
+ name: {{ include "npm-scan.name" . }}-api
23
+ port:
24
+ number: {{ .Values.service.port }}
25
+ {{- with .Values.ingress.tls }}
26
+ tls: {{- toYaml . | nindent 4 }}
27
+ {{- end }}
28
28
  {{- end }}
@@ -1,67 +1,67 @@
1
- {{- if .Values.postgresql.enabled }}
2
- apiVersion: apps/v1
3
- kind: Deployment
4
- metadata:
5
- name: {{ include "npm-scan.name" . }}-postgresql
6
- labels:
7
- app: {{ include "npm-scan.name" . }}-postgresql
8
- spec:
9
- replicas: 1
10
- selector:
11
- matchLabels:
12
- app: {{ include "npm-scan.name" . }}-postgresql
13
- template:
14
- metadata:
15
- labels:
16
- app: {{ include "npm-scan.name" . }}-postgresql
17
- spec:
18
- containers:
19
- - name: postgresql
20
- image: postgres:16-alpine
21
- ports:
22
- - containerPort: 5432
23
- env:
24
- - name: POSTGRES_DB
25
- value: "{{ .Values.postgresql.database }}"
26
- - name: POSTGRES_USER
27
- value: "{{ .Values.postgresql.username }}"
28
- - name: POSTGRES_PASSWORD
29
- valueFrom:
30
- secretKeyRef:
31
- name: {{ include "npm-scan.name" . }}-pg
32
- key: password
33
- {{- if .Values.persistence.enabled }}
34
- volumeMounts:
35
- - name: data
36
- mountPath: /var/lib/postgresql/data
37
- volumes:
38
- - name: data
39
- persistentVolumeClaim:
40
- claimName: {{ include "npm-scan.name" . }}-pg
41
- {{- end }}
42
- ---
43
- apiVersion: v1
44
- kind: Service
45
- metadata:
46
- name: {{ include "npm-scan.name" . }}-postgresql
47
- spec:
48
- ports:
49
- - port: 5432
50
- selector:
51
- app: {{ include "npm-scan.name" . }}-postgresql
52
- ---
53
- {{- if .Values.persistence.enabled }}
54
- apiVersion: v1
55
- kind: PersistentVolumeClaim
56
- metadata:
57
- name: {{ include "npm-scan.name" . }}-pg
58
- spec:
59
- accessModes: [ReadWriteOnce]
60
- resources:
61
- requests:
62
- storage: {{ .Values.persistence.size }}
63
- {{- with .Values.persistence.storageClass }}
64
- storageClassName: {{ . }}
65
- {{- end }}
66
- {{- end }}
1
+ {{- if .Values.postgresql.enabled }}
2
+ apiVersion: apps/v1
3
+ kind: Deployment
4
+ metadata:
5
+ name: {{ include "npm-scan.name" . }}-postgresql
6
+ labels:
7
+ app: {{ include "npm-scan.name" . }}-postgresql
8
+ spec:
9
+ replicas: 1
10
+ selector:
11
+ matchLabels:
12
+ app: {{ include "npm-scan.name" . }}-postgresql
13
+ template:
14
+ metadata:
15
+ labels:
16
+ app: {{ include "npm-scan.name" . }}-postgresql
17
+ spec:
18
+ containers:
19
+ - name: postgresql
20
+ image: postgres:16-alpine
21
+ ports:
22
+ - containerPort: 5432
23
+ env:
24
+ - name: POSTGRES_DB
25
+ value: "{{ .Values.postgresql.database }}"
26
+ - name: POSTGRES_USER
27
+ value: "{{ .Values.postgresql.username }}"
28
+ - name: POSTGRES_PASSWORD
29
+ valueFrom:
30
+ secretKeyRef:
31
+ name: {{ include "npm-scan.name" . }}-pg
32
+ key: password
33
+ {{- if .Values.persistence.enabled }}
34
+ volumeMounts:
35
+ - name: data
36
+ mountPath: /var/lib/postgresql/data
37
+ volumes:
38
+ - name: data
39
+ persistentVolumeClaim:
40
+ claimName: {{ include "npm-scan.name" . }}-pg
41
+ {{- end }}
42
+ ---
43
+ apiVersion: v1
44
+ kind: Service
45
+ metadata:
46
+ name: {{ include "npm-scan.name" . }}-postgresql
47
+ spec:
48
+ ports:
49
+ - port: 5432
50
+ selector:
51
+ app: {{ include "npm-scan.name" . }}-postgresql
52
+ ---
53
+ {{- if .Values.persistence.enabled }}
54
+ apiVersion: v1
55
+ kind: PersistentVolumeClaim
56
+ metadata:
57
+ name: {{ include "npm-scan.name" . }}-pg
58
+ spec:
59
+ accessModes: [ReadWriteOnce]
60
+ resources:
61
+ requests:
62
+ storage: {{ .Values.persistence.size }}
63
+ {{- with .Values.persistence.storageClass }}
64
+ storageClassName: {{ . }}
65
+ {{- end }}
66
+ {{- end }}
67
67
  {{- end }}
@@ -1,19 +1,19 @@
1
- apiVersion: v1
2
- kind: Secret
3
- metadata:
4
- name: {{ include "npm-scan.name" . }}-license
5
- labels: {{- include "npm-scan.labels" . | nindent 4 }}
6
- type: Opaque
7
- stringData:
8
- key: "{{ .Values.license.key }}"
9
- ---
10
- {{- if not .Values.postgresql.existingSecret }}
11
- apiVersion: v1
12
- kind: Secret
13
- metadata:
14
- name: {{ include "npm-scan.name" . }}-pg
15
- labels: {{- include "npm-scan.labels" . | nindent 4 }}
16
- type: Opaque
17
- stringData:
18
- password: "{{ .Values.postgresql.password }}"
1
+ apiVersion: v1
2
+ kind: Secret
3
+ metadata:
4
+ name: {{ include "npm-scan.name" . }}-license
5
+ labels: {{- include "npm-scan.labels" . | nindent 4 }}
6
+ type: Opaque
7
+ stringData:
8
+ key: "{{ .Values.license.key }}"
9
+ ---
10
+ {{- if not .Values.postgresql.existingSecret }}
11
+ apiVersion: v1
12
+ kind: Secret
13
+ metadata:
14
+ name: {{ include "npm-scan.name" . }}-pg
15
+ labels: {{- include "npm-scan.labels" . | nindent 4 }}
16
+ type: Opaque
17
+ stringData:
18
+ password: "{{ .Values.postgresql.password }}"
19
19
  {{- end }}
@@ -1,32 +1,32 @@
1
- {{- if .Values.worker.enabled }}
2
- apiVersion: apps/v1
3
- kind: Deployment
4
- metadata:
5
- name: {{ include "npm-scan.name" . }}-worker
6
- labels:
7
- app: {{ include "npm-scan.name" . }}-worker
8
- {{- include "npm-scan.labels" . | nindent 4 }}
9
- spec:
10
- replicas: {{ .Values.worker.replicas }}
11
- selector:
12
- matchLabels:
13
- app: {{ include "npm-scan.name" . }}-worker
14
- template:
15
- metadata:
16
- labels:
17
- app: {{ include "npm-scan.name" . }}-worker
18
- spec:
19
- containers:
20
- - name: worker
21
- image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
22
- imagePullPolicy: {{ .Values.image.pullPolicy }}
23
- command: ["node", "cli/cli.js"]
24
- env:
25
- - name: NPM_SCAN_LICENSE_KEY
26
- valueFrom:
27
- secretKeyRef:
28
- name: {{ include "npm-scan.name" . }}-license
29
- key: key
30
- optional: true
31
- resources: {{- toYaml .Values.worker.resources | nindent 12 }}
1
+ {{- if .Values.worker.enabled }}
2
+ apiVersion: apps/v1
3
+ kind: Deployment
4
+ metadata:
5
+ name: {{ include "npm-scan.name" . }}-worker
6
+ labels:
7
+ app: {{ include "npm-scan.name" . }}-worker
8
+ {{- include "npm-scan.labels" . | nindent 4 }}
9
+ spec:
10
+ replicas: {{ .Values.worker.replicas }}
11
+ selector:
12
+ matchLabels:
13
+ app: {{ include "npm-scan.name" . }}-worker
14
+ template:
15
+ metadata:
16
+ labels:
17
+ app: {{ include "npm-scan.name" . }}-worker
18
+ spec:
19
+ containers:
20
+ - name: worker
21
+ image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
22
+ imagePullPolicy: {{ .Values.image.pullPolicy }}
23
+ command: ["node", "cli/cli.js"]
24
+ env:
25
+ - name: NPM_SCAN_LICENSE_KEY
26
+ valueFrom:
27
+ secretKeyRef:
28
+ name: {{ include "npm-scan.name" . }}-license
29
+ key: key
30
+ optional: true
31
+ resources: {{- toYaml .Values.worker.resources | nindent 12 }}
32
32
  {{- end }}