Skip to content

Instantly share code, notes, and snippets.

View danifitz's full-sized avatar

Daniel Fitzgerald danifitz

View GitHub Profile
@danifitz
danifitz / lighthousemetrics.json
Last active February 15, 2021 17:40
JSON definition for New Relic dashboard visualising Google Lighthouse Metrics
{
"title": "Lighthouse Metrics",
"icon": "line-chart",
"grid_column_count": 12,
"filter": null,
"owner": {
"email": "[email protected]",
"id": 2334598
},
"widgets": [{
;window.NREUM||(NREUM={});NREUM.init={privacy:{cookies_enabled:true}};
window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o||e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,n){function r(t){try{c.console&&console.log(t)}catch(e){}}var o,i=t("ee"),a=t(27),c={};try{o=localStorage.getItem("__nr_flags").split(","),console&&"function"==typeof console.log&&(c.console=!0,o.indexOf("dev")!==-1&&(c.dev=!0),o.indexOf("nr_dev")!==-1&&(c.nrDev=!0))}catch(s){}c.nrDev&&i.on("internal-error",function(t){r(t.stack)}),c.dev&&i.on("fn-err",function(t,e,n){r(n.stack)}),c.dev&&(r("NR AGENT IN DEVELOPMENT MODE"),r("flags: "+a(c,function(t,e){return t}).join(", ")))},{}],2:[function(t,e,n){function r(t,e,n,r,c){try{l?l-=1:o(c||new UncaughtException(t,e,n),!0)}catch(u){try{i("ierr",[u,s.now(),!0])}catch(d){}}return"fu
@danifitz
danifitz / nr.txt
Created April 16, 2021 09:21
nr snippet
<script type="text/javascript">
;window.NREUM||(NREUM={});NREUM.init={privacy:{cookies_enabled:true}};
window.NREUM||(NREUM={}),__nr_require=function(t,e,n){function r(n){if(!e[n]){var o=e[n]={exports:{}};t[n][0].call(o.exports,function(e){var o=t[n][1][e];return r(o||e)},o,o.exports)}return e[n].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<n.length;o++)r(n[o]);return r}({1:[function(t,e,n){function r(t){try{c.console&&console.log(t)}catch(e){}}var o,i=t("ee"),a=t(28),c={};try{o=localStorage.getItem("__nr_flags").split(","),console&&"function"==typeof console.log&&(c.console=!0,o.indexOf("dev")!==-1&&(c.dev=!0),o.indexOf("nr_dev")!==-1&&(c.nrDev=!0))}catch(s){}c.nrDev&&i.on("internal-error",function(t){r(t.stack)}),c.dev&&i.on("fn-err",function(t,e,n){r(n.stack)}),c.dev&&(r("NR AGENT IN DEVELOPMENT MODE"),r("flags: "+a(c,function(t,e){return t}).join(", ")))},{}],2:[function(t,e,n){function r(t,e,n,r,c){try{l?l-=1:o(c||new UncaughtException(t,e,n),!0)}catch(u){try{i("ierr",[u,s
@danifitz
danifitz / ms-teams-newrelic-webhook-payload.json
Created May 14, 2021 13:57
A JSON payload for a Microsoft Teams webhook that makes alerts look pretty
{
"summary":"$ACCOUNT_NAME New Relic Alert: $CONDITION_NAME in New Relic Alert - $POLICY_NAME",
"themeColor":"0076D7",
"@type":"MessageCard",
"potentialAction":[
{
"@type":"openUri",
"name":"Go To Incident",
"targets":[
{
@danifitz
danifitz / lacework-k8s-psp.yml
Created October 21, 2021 08:02
Kubernetes PSP for Lacework agent (can be applied just to lacework namespace)
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: lacework
spec:
allowedHostPaths:
- pathPrefix: /var/lib/lacework/config
- pathPrefix: /var/run/docker.sock
- pathPrefix: /var/run/docker.pid
- pathPrefix: /
@danifitz
danifitz / values.yml
Created January 10, 2022 10:23
values.yml admission controller
proxy-scanner:
config:
static_cache_location: /opt/lacework/cache
default_registry: index.docker.io
lacework:
account_name: myAccount
integration_access_token: myToken
registries:
- domain: index.docker.io
ssl: true
@danifitz
danifitz / taskdef.json
Created January 20, 2022 17:38
example task definition with lacework
{
"ipcMode": null,
"executionRoleArn": "arn:aws:iam::009213923942:role/ecsTaskExecutionRole",
"containerDefinitions": [
{
"dnsSearchDomains": null,
"environmentFiles": null,
"logConfiguration": {
"logDriver": "awslogs",
"secretOptions": null,
stages: # List of stages for jobs, and their order of execution
- iac-scan
docker:image:
stage: iac-scan
image: docker:1.11
services:
- docker:dind
script:
@danifitz
danifitz / lacework-tf-scan-azure-devops.yml
Created April 22, 2022 13:41
lacework-tf-scan-azure-devops.yml
# This pipeline has a single step which installs the LW IAC CLI, setups an auth token
# stored as a pipeline variable and then scans TF code within a directory.
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
@danifitz
danifitz / lacework-azure-devops.yml
Created April 25, 2022 15:46
lacework-container-scan-azure-devops-with-dockerized-scanner
trigger:
- main
pool:
vmImage: ubuntu-latest
steps:
- script: |
docker pull ubuntu:latest
docker run \