Sign inSign up

macnicadevops/prismachecker

By macnicadevops

•Updated over 6 years ago

this image is to check your prisma cloud tenant respond.

Image
0

206

macnicadevops/prismachecker repository overview

⁠AIM

This image is used for your prisma cloud tenant respond check, When your tenant is not responding, this image will send alert to your slack channel.

⁠Requirement

you will need your slack webhook URL

⁠Usage

$ docker run --rm -e PCURL="[your prisma tenant API URL]" -e WHURL="[your slack webhook URL]" -e CHANNEL="[your slack channel name]" -d macnicadevops/prismachecker:1.0

Example:

$ docker run --rm -e PCURL="https://asia-northeast1.cloud.twistlock.com/abc-3456789" -e WHURL="https://hooks.slack.com/services/O9D6H25KQ/BUHAN8JC8/cH4bO0uxKJYDSxD69pxT7eBC" -e NAME="prisma-alert" -d macnicadevops/prismachecker:1.0

⁠Options

KeyValuedefault value
PCURLURL for your Prisma cloud tenant API"https://regionid.cloud.twistlock.com/xxx-00000000⁠"
WHURLWebhook URL for your slack"https://hooks.slack.com/services/slack-webhook-url⁠"
NAME(Optional) Webhook User name"Health-Checker"
TEXT(Optional) Actual Alert Message in your Slack"PrismaCloud-Ping-Error!!@channel"
INT(Optional) Ping Interval to your Prisma Cloud tenant60

⁠Dockerfile

From ubuntu:18.04
RUN apt-get update && apt-get install -y curl
ENV PCURL="https://regionid.cloud.twistlock.com/xxx-00000000"
ENV WHURL="https://hooks.slack.com/services/slack-webhook-url"
ENV NAME="Health-Checker"
ENV TEXT="PrismaCloud-Ping-Error!!@channel"
ENV INT=60
COPY checker.sh /
RUN chmod +x checker.sh
ENTRYPOINT ["/checker.sh"]

⁠checker.sh

#!/bin/bash
while :
do
  result=`curl -k $PCURL"/api/v1/_ping"`
  time=`date +%s`
  if [ $result != "OK" ]; then
    curl -X POST -d 'payload={"username":"'$NAME'","link_names": 1,"attachments": [{"pretext":"'$time'","text": "'$TEXT'"}]}' $WHURL ;
  fi
  sleep $INT
done

Tag summary

Content type

Image

Digest

Size

51 MB

Last updated

over 6 years ago

docker pull macnicadevops/prismachecker:1.0