2.1.13 • Published 11 months ago

@toolisticon/ssl-hostinfo-prometheus-exporter v2.1.13

Weekly downloads
141
License
MIT
Repository
github
Last release
11 months ago

Monitor SSL certificates in Prometheus

License Build Status Build Status Docker Build Status npm version Docker Stars Docker Pulls

Still WIP

Usage

Install the app first

npm i -g @toolisticon/ssl-hostinfo-prometheus-exporter

This nodejs application assumes that you define a list of urls to check via environment variables:

export URLS_TO_CHECK=app1.sample.com,app2.sample.com
ssl-hostinfo-prom

The metrics are available via via localhost:9000 :

security_ssl_mozilla_observatory{algorithm_version="2",end_time="1547804767000",grade="D",hidden="false",likelihood_indicator="MEDIUM",response_headers_cache-control="no-cache, no-store, max-age=0, must-revalidate",response_headers_content-type="996616800000",response_headers_date="1547804765000",response_headers_expires="946681200000",response_headers_pragma="no-cache",response_headers_set-cookie="556448b8f044ea9c0fe56ec8eabb3577=6dda08a289298b570c8daa5a12e94408; path=/; HttpOnly; Secure",response_headers_transfer-encoding="chunked",response_headers_x-application-context="193033926000000",response_headers_x-content-type-options="nosniff",response_headers_x-xss-protection="1; mode=block",scan_id="9783173",score="35",start_time="1547804762000",state="FINISHED",status_code="404",tests_failed="3",tests_passed="9",tests_quantity="12",url="sub.domain-sample.com",security_ssl_mozilla_observatory{algorithm_version="2",end_time="1547804767000",grade="D",hidden="false",likelihood_indicator="MEDIUM",response_headers_cache-control="no-cache, no-store, max-age=0, must-revalidate",response_headers_content-type="996616800000",response_headers_date="1547804765000",response_headers_expires="946681200000",response_headers_pragma="no-cache",response_headers_set-cookie="556448b8f044ea9c0fe56ec8eabb3577=6dda08a289298b570c8daa5a12e94408; path=/; HttpOnly; Secure",response_headers_transfer-encoding="chunked",response_headers_x-application-context="193033926000000",response_headers_x-content-type-options="nosniff",response_headers_x-xss-protection="1; mode=block",scan_id="9783173",score="35",start_time="1547804762000",state="FINISHED",status_code="404",tests_failed="3",tests_passed="9",tests_quantity="12",url="sub1.domain-sample.com",} 35
security_ssl_mozilla_observatory{algorithm_version="2",end_time="1547804767000",grade="D",hidden="false",likelihood_indicator="MEDIUM",response_headers_cache-control="no-cache, no-store, max-age=0, must-revalidate",response_headers_content-type="996616800000",response_headers_date="1547804765000",response_headers_expires="946681200000",response_headers_pragma="no-cache",response_headers_set-cookie="556448b8f044ea9c0fe56ec8eabb3577=6dda08a289298b570c8daa5a12e94408; path=/; HttpOnly; Secure",response_headers_transfer-encoding="chunked",response_headers_x-application-context="193033926000000",response_headers_x-content-type-options="nosniff",response_headers_x-xss-protection="1; mode=block",scan_id="9783173",score="35",start_time="1547804762000",state="FINISHED",status_code="404",tests_failed="3",tests_passed="9",tests_quantity="12",url="sub.domain-sample.com",security_ssl_mozilla_observatory{algorithm_version="2",end_time="1547804767000",grade="D",hidden="false",likelihood_indicator="MEDIUM",response_headers_cache-control="no-cache, no-store, max-age=0, must-revalidate",response_headers_content-type="996616800000",response_headers_date="1547804765000",response_headers_expires="946681200000",response_headers_pragma="no-cache",response_headers_set-cookie="556448b8f044ea9c0fe56ec8eabb3577=6dda08a289298b570c8daa5a12e94408; path=/; HttpOnly; Secure",response_headers_transfer-encoding="chunked",response_headers_x-application-context="193033926000000",response_headers_x-content-type-options="nosniff",response_headers_x-xss-protection="1; mode=block",scan_id="9783173",score="35",start_time="1547804762000",state="FINISHED",status_code="404",tests_failed="3",tests_passed="9",tests_quantity="12",url="sub2.domain-sample.com",} 35

Configuration

You can override the config via environment variables:

   URLS_TO_CHECK: // list of urls
   SERVER_PORT: // set desired port for prometheus endpoint, defaults to 9000
   CRON: // set cron pattern, default is '0 0 * * * *',
   LOG_LEVEL: // set log level, default is 'ERROR' ('INFO' outputs details info)

Troubleshooting

If the service account does not have access to projects, you will see this message

Logged into "https://...:8443" as "system:serviceaccount:security:sslverify" using the token provided.

You don't have any projects. Contact your system administrator to request a project.
Welcome! See 'oc help' to get started.

Development

Usage as library

The package can be also used as a dependency:

npm i @toolisticon/ssl-hostinfo-prometheus-exporter

In your app you can use then the api:

const updateRoutesInfo = require('@toolisticon/ssl-hostinfo-prometheus-exporter').updateRoutesInfo;
const startPrometheusListener = require('@toolisticon/ssl-hostinfo-prometheus-exporter').startPrometheusListener;

// trigger one update immediatly
triggerUpdate();

startPrometheusListener();

Debug

To debug run the following command:

node --inspect-brk index.js

To debug unit tests:

npm run test:debug
2.1.13

1 year ago

2.1.12

2 years ago

2.1.11

2 years ago

2.1.10

2 years ago

2.1.9

2 years ago

2.1.8

2 years ago

2.1.7

3 years ago

2.1.6

3 years ago

2.1.5

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.1

4 years ago

1.4.4

5 years ago

1.4.3

5 years ago

1.4.2

5 years ago

1.4.1

5 years ago

1.3.0

6 years ago

1.2.5

6 years ago

1.2.4-PR-28-1

6 years ago

1.2.4-PR-26-1

6 years ago

1.2.4-PR-25-1

6 years ago

1.2.4-PR-24-1

6 years ago

1.2.4-develop-61

6 years ago

1.2.4

6 years ago

1.2.3-develop-60

6 years ago

1.2.3-develop-59

6 years ago

1.2.3

6 years ago

1.2.1-PR-13-1

6 years ago

1.2.1-PR-14-1

6 years ago

1.2.1-PR-11-1

6 years ago

1.2.1-develop-47

6 years ago

1.2.1

6 years ago

1.1.0

6 years ago

1.0.2-develop-32

6 years ago

1.0.2-develop-31

6 years ago

1.0.2

6 years ago

1.0.2-develop-30

6 years ago

1.0.1-develop-29

6 years ago

1.0.1

6 years ago

1.0.1-develop-28

6 years ago

1.0.0-develop-27

6 years ago

1.0.0-develop-26

6 years ago

1.0.0-PR-3-1

6 years ago

1.0.0-develop-25

6 years ago

1.0.0-develop-24

6 years ago

1.0.0

6 years ago

0.4.1-develop-23

6 years ago

0.4.1-develop-22

6 years ago

0.4.1

6 years ago

0.4.0-develop-21

6 years ago

0.3.4-develop-17

6 years ago

0.3.4-develop-16

6 years ago

0.3.4

6 years ago

0.3.3-develop-15

6 years ago

0.3.3-develop-14

6 years ago

0.3.3

6 years ago

0.3.2-develop-13

6 years ago

0.3.2

6 years ago

0.3.2-develop-12

6 years ago

0.3.1

6 years ago

0.3.1-develop-11

6 years ago

0.3.0-develop-10

6 years ago

0.3.0-develop-9

6 years ago

0.3.0

6 years ago

0.3.0-develop-8

6 years ago

0.2.1-develop-7

6 years ago

0.2.1-PR-1-1

6 years ago

0.2.1

6 years ago

0.2.1-develop-6

6 years ago

0.2.0-develop-5

6 years ago

0.2.0

6 years ago

0.2.0-develop-3

6 years ago

0.1.0-develop-2

6 years ago

0.1.0-develop-1

6 years ago

0.1.0

6 years ago