Skip to main content

Scraping

Every config item has the following metadata:

FieldDescriptionExample
idA UUID representing the item, where possible the resource providers id is used
name
typeThe config item typeEC2::Instance, Kubernetes::Pod, Azure:VM
config_classA non-cloud specific class of resourcesVM
external_idOne or more aliases that refer to the same itemAmazonEC2/i-abcd, aws::ec2::instance:/i-abcd
statusThe externally reported status of the item using is-healthyHealthy,Progressing, Terminated
configThe JSON representation of an item
e.g. the json returned from kubectl get -o json

Transformation

Exclusions

Exclusions allow you to remove fields from the config of an item. This is useful when you want to remove sensitive or overly verbose from being recorded.

kubernetes-exclude-superfluous-fields.yaml
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: kubernetes-scraper
spec:
kubernetes:
- clusterName: local-kind-cluster
transform:
exclude:
- jsonpath: '.metadata.ownerReferences'
- types:
- Kubernetes::Pod
jsonpath: '.metadata.generateName'
FieldDescriptionSchemeRequired
jsonpathAll matching elements will be removed from the configjsonpathtrue
typesOnly run exclusion rules for these config types, if empty apply to all[]string

Masking

Masking allows replacing sensitive fields with a hash or static string.

file-mask-scraper.yaml
apiVersion: configs.flanksource.com/v1
kind: ScrapeConfig
metadata:
name: file-mask-scraper
spec:
file:
- type: Config
id: $.id
name: $.name
transform:
mask:
- selector: config.name == 'Config1'
jsonpath: $.password
value: md5sum
- selector: config.name == 'Config1'
jsonpath: $.secret
value: '***'
paths:
- fixtures/data/single-config.json
FieldDescriptionSchemeRequiredContext
selectorFilter which config items to apply masks onCELtrueScrapeResult
jsonpathValues to maskjsonpathtrue
valueThe replacement value of matched elementsmd5 or any static string e.g. ***true
info

Masks are applied in the order they are specified in the configuration file.