2.1.12 • Published 2 days ago

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

Weekly downloads
141
License
MIT
Repository
github
Last release
2 days 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.12

11 months ago

2.1.11

12 months ago

2.1.10

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

2 years ago

2.1.6

2 years ago

2.1.5

2 years ago

2.1.4

2 years ago

2.1.3

2 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.0

3 years ago

2.0.1

3 years ago

1.4.4

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.1

4 years ago

1.3.0

5 years ago

1.2.5

5 years ago

1.2.4-PR-28-1

5 years ago

1.2.4-PR-26-1

5 years ago

1.2.4-PR-25-1

5 years ago

1.2.4-PR-24-1

5 years ago

1.2.4-develop-61

5 years ago

1.2.4

5 years ago

1.2.3-develop-60

5 years ago

1.2.3-develop-59

5 years ago

1.2.3

5 years ago

1.2.1-PR-13-1

5 years ago

1.2.1-PR-14-1

5 years ago

1.2.1-PR-11-1

5 years ago

1.2.1-develop-47

5 years ago

1.2.1

5 years ago

1.1.0

5 years ago

1.0.2-develop-32

5 years ago

1.0.2-develop-31

5 years ago

1.0.2

5 years ago

1.0.2-develop-30

5 years ago

1.0.1-develop-29

5 years ago

1.0.1

5 years ago

1.0.1-develop-28

5 years ago

1.0.0-develop-27

5 years ago

1.0.0-develop-26

5 years ago

1.0.0-PR-3-1

5 years ago

1.0.0-develop-25

5 years ago

1.0.0-develop-24

5 years ago

1.0.0

5 years ago

0.4.1-develop-23

5 years ago

0.4.1-develop-22

5 years ago

0.4.1

5 years ago

0.4.0-develop-21

5 years ago

0.3.4-develop-17

5 years ago

0.3.4-develop-16

5 years ago

0.3.4

5 years ago

0.3.3-develop-15

5 years ago

0.3.3-develop-14

5 years ago

0.3.3

5 years ago

0.3.2-develop-13

5 years ago

0.3.2

5 years ago

0.3.2-develop-12

5 years ago

0.3.1

5 years ago

0.3.1-develop-11

5 years ago

0.3.0-develop-10

5 years ago

0.3.0-develop-9

5 years ago

0.3.0

5 years ago

0.3.0-develop-8

5 years ago

0.2.1-develop-7

5 years ago

0.2.1-PR-1-1

5 years ago

0.2.1

5 years ago

0.2.1-develop-6

5 years ago

0.2.0-develop-5

5 years ago

0.2.0

5 years ago

0.2.0-develop-3

5 years ago

0.1.0-develop-2

5 years ago

0.1.0-develop-1

5 years ago

0.1.0

5 years ago