-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
74 lines (65 loc) · 2.55 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
TF_DOCS := go run github.com/terraform-docs/[email protected]
DOCS_CHECK_UPDATE ?= false
.PHONY: all
all: fmt modules docs validate
.PHONY: modules
modules: fleet-modules docs
# Generate fleet module. The modules are specified using selectors that are formatted as:
# {package_name}/{policy_template}/{data_stream}/{input_type} - for integrations
# {package_name/{policy_template}/{input_type} - for inputs
# Any slashes (/) contained in the attribute values are replaced with underscores. For
# example, if matching the input_type of "prometheus/metrics" use "prometheus_metrics".
.PHONY: fleet-modules
fleet-modules: install
rm -f fleet_integration/*/*
rm -f fleet_input/*/*
fleet-terraform-generator generate batch --packages-dir ../integrations/packages --out . \
"aws/cloudtrail/*/aws-s3" \
"aws/guardduty/guardduty/*" \
"aws_bedrock/*/invocation/*" \
"aws_logs/aws_logs/generic/*" \
"barracuda_cloudgen_firewall/*/*/lumberjack" \
"barracuda_cloudgen_firewall/*/*/lumberjack" \
"cloud_security_posture/*/*/*" \
"entityanalytics_entra_id/*/entity/*" \
"github/*/issues/httpjson" \
"google_workspace/*/*/httpjson" \
"m365_defender/*/event/*" \
"m365_defender/*/incident/*" \
"qualys_vmdr/*/*/cel" \
"system/*/application/winlog" \
"system/*/security/winlog" \
"system/system/diskio/system_metrics" \
"system/system/process_summary/system_metrics" \
"ti_abusech/*/*/cel" \
"ti_recordedfuture/*/*/httpjson" \
"ti_threatconnect/*/*/cel" \
"windows/*/powershell*/winlog" \
"windows/*/*sysmon*/winlog" \
"cel/*/*" \
"log/*/*" \
"sql/*/*" \
"winlog/*/*"
# Ignore shadowing for these packages. See https://github.com/elastic/integrations/issues/6148.
fleet-terraform-generator generate batch --packages-dir ../integrations/packages --ignore-var-shadow --out . \
"aws/securityhub/*/*"
.PHONY: install
install:
cd tools/cmd/fleet-terraform-generator && go install .
.PHONY: fmt
fmt:
terraform fmt --recursive .
.PHONY: validate
validate:
cd examples/github && terraform init && terraform validate
.PHONY: docs
docs:
@for i in $(shell find fleet_* -name '*.tf' -or -name '*.tf.json' -not -path '*/.terraform*' -print0 | xargs -0 -n1 dirname | sort --unique); do \
module=$$i; \
with_header=$$(test -f "$$module/.readme.md" && echo -n --header-from=".readme.md"); \
${TF_DOCS} markdown table --output-check=${DOCS_CHECK_UPDATE} $$with_header --output-file="README.md" "$$module" || exit 1; \
done
# docs-check verifies that all README.md files are up to date.
.PHONY: docs-check
docs-check:
${MAKE} docs DOCS_CHECK_UPDATE=true