Files
sigma-rules/Makefile
T
Ross Wolf c0af222e7e Move Rule into a dataclass (#1029)
* WIP: Convert Rule to a dataclass
* Fix make release
* Lint fixes
* Remove dead code
* Fix lint and tests
* Use Python 3.8 in GitHub actions
* Update README to 3.8+
* Add Python 3.8 assertion
* Fix is_dirty property
* Remove incorrect pop from contents
* Add mixin with from_dict() and to_dict() methods
* Bypass validation for deprecated rules
* Fix rule_prompt
* Fix dict_hash usage
* Fix rule_event_search
* Switch to definitions.Date
* Fix toml-lint command, ignoring 'unneeded defaults'
* Moved severity Literal to definitions.Severity
* Remove BaseMarshmallowDataclass
* Fix lint and tests
* Add maturity to metadata for rule prompt loop
* Fix typo in devtools
* Use rule loader to load single rule in toml-lint
* Add Schema hint to __schema method
* Add MITREAttackURL definition
* Fix is_dirty to compare sha<-->sha
* Normalize the autoformatted rule output for API and toml-lint
* Make the package hash match
* Make the rule object mutable but not rule contents
* Restore the rules
2021-03-24 10:24:32 -06:00

60 lines
1.2 KiB
Makefile

#################
### detection-rules
#################
VENV := ./env/detection-rules-build
VENV_BIN := $(VENV)/bin
PYTHON := $(VENV_BIN)/python
PIP := $(VENV_BIN)/python -m pip
.PHONY: all
all: release
$(VENV):
pip install virtualenv
virtualenv $(VENV) --python=python3.8
$(PIP) install -r requirements.txt
$(PIP) install setuptools -U
.PHONY: clean
clean:
rm -rf $(VENV) *.egg-info .eggs .egg htmlcov build dist packages .build .tmp .tox __pycache__
.PHONY: deps
deps: $(VENV)
$(PIP) install -r requirements.txt
.PHONY: pytest
pytest: $(VENV) deps
$(PYTHON) -m detection_rules test
.PHONY: license-check
license-check: $(VENV) deps
@echo "LICENSE CHECK"
$(PYTHON) -m detection_rules dev license-check
.PHONY: lint
lint: $(VENV) deps
@echo "LINTING"
$(PYTHON) -m flake8 tests detection_rules --ignore D203 --max-line-length 120
.PHONY: test
test: $(VENV) lint pytest
.PHONY: release
release: deps
@echo "RELEASE: $(app_name)"
$(PYTHON) -m detection_rules dev build-release
rm -rf dist
mkdir dist
cp -r releases/*/*.zip dist/
.PHONY: kibana-commit
kibana-commit: deps
@echo "PREP KIBANA-COMMIT: $(app_name)"
$(PYTHON) -m detection_rules dev kibana-commit