diff --git a/.ansible-lint b/.ansible-lint new file mode 100644 index 0000000..8d9bb70 --- /dev/null +++ b/.ansible-lint @@ -0,0 +1,5 @@ +--- +profile: production + +exclude_paths: + - changelogs/changelog.yaml diff --git a/.config/dictionary.txt b/.config/dictionary.txt new file mode 100644 index 0000000..ee8d051 --- /dev/null +++ b/.config/dictionary.txt @@ -0,0 +1,29 @@ +antsichaut +argspec +astimezone +autoupdate +basepython +cdcp +cidrblock +cmds +dataclass +KB-perByte +devel +endgroup +envname +envtmpdir +etime +extraheader +fileh +isoformat +nolabel +notesdir +passenv +returncode +setenv +setuptools +suboptions +tmpvtm +toxfile +toxinidir +tracebackhide diff --git a/.darglint b/.darglint new file mode 100644 index 0000000..8e68aa3 --- /dev/null +++ b/.darglint @@ -0,0 +1,7 @@ +[darglint] +# NOTE: All `darglint` styles except for `sphinx` hit ridiculously low +# NOTE: performance on some of the in-project Python modules. +# Refs: +# * https://github.com/terrencepreilly/darglint/issues/186 +docstring_style = sphinx +strictness = full diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..4795515 --- /dev/null +++ b/.flake8 @@ -0,0 +1,72 @@ +[flake8] + +builtins = _ + +# Print the total number of errors: +count = true + +# Don't even try to analyze these: +extend-exclude = + # No need to traverse egg info dir + *.egg-info, + # tool cache dirs + *_cache + # project env vars + .env, + # GitHub configs + .github, + # Cache files of MyPy + .mypy_cache, + # Cache files of pytest + .pytest_cache, + # Temp dir of pytest-testmon + .tmontmp, + # Occasional virtualenv dir + .venv + # VS Code + .vscode, + # Temporary build dir + build, + # This contains sdists and wheels of ansible-navigator that we don't want to check + dist, + # Metadata of `pip wheel` cmd is autogenerated + pip-wheel-metadata, + # adjacent venv + venv + # ansible won't let me + __init__.py + +# IMPORTANT: avoid using ignore option, always use extend-ignore instead +# Completely and unconditionally ignore the following errors: +extend-ignore = + # Safeguard neutering of flake8-quotes : https://github.com/zheller/flake8-quotes/issues/105 + Q, + # annoy black by allowing white space before : https://github.com/psf/black/issues/315 + E203, + # duplicate of pylint W0611 (unused-import) + F401, + # duplicate of pylint E0602 (undefined-variable) + F821, + # duplicate of pylint W0612 (unused-variable) + F841, + +# Accessibility/large fonts and PEP8 unfriendly: +max-line-length = 100 + +# Allow certain violations in certain files: +# Please keep both sections of this list sorted, as it will be easier for others to find and add entries in the future +per-file-ignores = + # The following ignores have been researched and should be considered permanent + # each should be preceeded with an explanation of each of the error codes + # If other ignores are added for a specific file in the section following this, + # these will need to be added to that line as well. + + + # S101: Allow the use of assert within the tests directory, since tests require it. + tests/**.py: S101 + + # The following were present during the initial implementation. + # They are expected to be fixed and unignored over time. + +# Count the number of occurrences of each error/warning code and print a report: +statistics = true diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..e69de29 diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..5b32d4c --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +--- +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: daily + labels: + - "skip-changelog" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..e3e5966 --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,3 @@ +--- +# see https://github.com/ansible-community/devtools +_extends: ansible-community/devtools diff --git a/.github/workflows/ack.yml b/.github/workflows/ack.yml new file mode 100644 index 0000000..fda595d --- /dev/null +++ b/.github/workflows/ack.yml @@ -0,0 +1,15 @@ +--- +# See https://github.com/ansible-community/devtools/blob/main/.github/workflows/ack.yml +name: ack + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +on: # yamllint disable-line rule:truthy + pull_request_target: + types: [opened, labeled, unlabeled, synchronize] + +jobs: + ack: + uses: ansible/devtools/.github/workflows/ack.yml@main diff --git a/.github/workflows/codecoverage.yml b/.github/workflows/codecoverage.yml new file mode 100644 index 0000000..c2a7ad6 --- /dev/null +++ b/.github/workflows/codecoverage.yml @@ -0,0 +1,15 @@ +--- +name: code_coverage + +on: # yamllint disable-line rule:truthy + push: + pull_request: + branches: [ main ] + +jobs: + codecoverage: + uses: ansible-network/github_actions/.github/workflows/coverage_network_devices.yml@main + with: + collection_pre_install: >- + git+https://github.com/ansible-collections/ansible.utils.git + git+https://github.com/ansible-collections/ansible.netcommon.git diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..853e4b6 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,12 @@ +--- +name: ansible-lint +on: # yamllint disable-line rule:truthy + pull_request: + branches: ["main"] +jobs: + build: + name: Ansible Lint + runs-on: ubuntu-latest + steps: + - name: Run ansible-lint + uses: ansible/ansible-lint@main diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..3bf1a82 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,27 @@ +--- +# push workflow is shared and expected to perform actions after a merge happens +# on a maintenance branch (default or release). For example updating the +# draft release-notes. +# based on great work from +# https://github.com/T-Systems-MMS/ansible-collection-icinga-director +name: push + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +on: # yamllint disable-line rule:truthy + workflow_dispatch: + +env: + NAMESPACE: trendmicro + COLLECTION_NAME: deepsec + ANSIBLE_COLLECTIONS_PATHS: ./ + +jobs: + update_release_draft: + uses: ansible/devtools/.github/workflows/push_network.yml@main + with: + repo: ansible-collections/trendmicro.deepsec + secrets: + BOT_PAT: ${{ secrets.BOT_PAT }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..eb04259 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,14 @@ +--- +name: release +on: # yamllint disable-line rule:truthy + release: + types: [published] + +jobs: + release: + uses: ansible/devtools/.github/workflows/release_collection.yml@main + with: + environment: release + secrets: + ah_token: ${{ secrets.AH_TOKEN }} + ansible_galaxy_api_key: ${{ secrets.ANSIBLE_GALAXY_API_KEY }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..0fb4cc0 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,46 @@ +--- +name: test_collection + +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +on: # yamllint disable-line rule:truthy + pull_request: + branches: [main] + workflow_dispatch: + schedule: + - cron: '0 0 * * *' + + +jobs: + changelog: + uses: ansible-network/github_actions/.github/workflows/changelog.yml@main + if: github.event_name != 'schedule' + sanity: + uses: ansible-network/github_actions/.github/workflows/sanity.yml@main + unit-galaxy: + uses: ansible-network/github_actions/.github/workflows/unit_galaxy.yml@main + unit-source: + uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main + with: + collection_pre_install: >- + git+https://github.com/ansible-collections/ansible.utils.git + git+https://github.com/ansible-collections/ansible.netcommon.git + all_green: + if: ${{ always() && (github.event_name != 'schedule') }} + needs: + - changelog + - sanity + - unit-galaxy + - unit-source + runs-on: ubuntu-latest + steps: + - run: >- + python -c "assert 'failure' not in + set([ + '${{ needs.changelog.result }}', + '${{ needs.sanity.result }}', + '${{ needs.unit-galaxy.result }}', + '${{ needs.unit-source.result }}' + ])" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1f9858c --- /dev/null +++ b/.gitignore @@ -0,0 +1,118 @@ +# CML/virl lab cache +.virl/ + +# A collection directory, resulting from the use of the pytest-ansible-units plugin +collections/ + + +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# pyenv +.python-version + +# celery beat schedule file +celerybeat-schedule + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ + +# ide +*.code-workspace +.vscode/ +.DS_Store + +changelogs/.plugin-cache.yaml diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 0000000..4b9db23 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,6 @@ +[settings] +known_first_party=ansible_collections.trendmicro.deepsec +line_length=100 +lines_after_imports=2 +lines_between_types=1 +profile=black diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..8fdbd4b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,46 @@ +--- +repos: + - repo: https://github.com/ansible-network/collection_prep + rev: 1.1.1 + hooks: + # - id: autoversion # removed as being handled by GHA push and release drafter + - id: update-docs + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.4.0 + hooks: + - id: check-merge-conflict + - id: check-symlinks + - id: debug-statements + - id: end-of-file-fixer + - id: no-commit-to-branch + args: [--branch, main] + - id: trailing-whitespace + + - repo: https://github.com/asottile/add-trailing-comma + rev: v3.1.0 + hooks: + - id: add-trailing-comma + + - repo: https://github.com/pre-commit/mirrors-prettier + rev: "v3.0.3" + hooks: + - id: prettier + entry: env CI=1 bash -c "prettier --list-different . || ec=$? && prettier --loglevel=error --write . && exit $ec" + pass_filenames: false + args: [] + additional_dependencies: + - prettier + - prettier-plugin-toml + + - repo: https://github.com/PyCQA/isort + rev: 5.12.0 + hooks: + - id: isort + name: Sort import statements using isort + args: ["--filter-files"] + + - repo: https://github.com/psf/black + rev: 23.9.1 + hooks: + - id: black diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..110b795 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,19 @@ +# Stuff we don't want priettier to ever to look into +.*/ + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# A linked collection directory created by pytest-ansible-units + +collections/ + +# Tracked but not manually edited + +# Tracked but manually formatted diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..3adaf90 --- /dev/null +++ b/.yamllint @@ -0,0 +1,15 @@ +--- +extends: default + +ignore: | + .tox + changelogs/* + +rules: + braces: + max-spaces-inside: 1 + level: error + brackets: + max-spaces-inside: 1 + level: error + line-length: disable diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..e49c152 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,92 @@ +================================================ +TrendMicro DeepSecurity Collection Release Notes +================================================ + +.. contents:: Topics + + +v2.0.0 +====== + +Major Changes +------------- + +- Minimum required ansible.netcommon version is 2.5.1. +- Updated base plugin references to ansible.netcommon. + +Documentation Changes +--------------------- + +- Update module doc + +v1.2.0 +====== + +Minor Changes +------------- + +- Add AntiMalware rules resource module. +- Add Firewall rules resource module. +- Add Log Inspection rules resource module. +- Add new Integrity Monitoring rules module (https://github.com/ansible-collections/trendmicro.deepsec/pull/24). +- Add new RM states to Intrusion prevention rules module (https://github.com/ansible-collections/trendmicro.deepsec/pull/25). + +Documentation Changes +--------------------- + +- To update comments to get included TM collection under Ansible (https://github.com/ansible-collections/ansible-inclusion/discussions/27#discussioncomment-1016085). + +New Modules +----------- + +Private +~~~~~~~ + +var.folders._0.m716s5gx1g3d5j1dw_s2w1ph0000gn.T.antsibull-changeloghfeb6_9p.collections.ansible_collections.trendmicro.deepsec.plugins.modules +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- deepsec_anti_malwares - Manages AntiMalware Rule resource module +- deepsec_firewall_rules - Manages Firewall Rule resource module +- deepsec_integrity_monitoring_rules - Manages Integrity Monitoring Rule resource module +- deepsec_intrusion_prevention_rules - Intrusion Prevention Rule resource module. +- deepsec_log_inspection_rules - Manages Log Inspection Rule resource module + +v1.1.0 +====== + +Minor Changes +------------- + +- Add deepsec_apikey config module. +- Add deepsec_system_settings config module. + +New Modules +----------- + +- deepsec_apikey - Create a new and manage API Keys. +- deepsec_system_settings - Modify the system settings for TrendMicro Deep Security. + +v1.0.0 +====== + +Minor Changes +------------- + +- Add deepsec_anti_malware config module. +- Add deepsec_firewallrules config module. +- Add deepsec_hosts_info config module. +- Add deepsec_log_inspectionrules module. +- Add deepsec_syslog module. + +Bugfixes +-------- + +- Fix no log issues for private_key for deepsec_syslog_config module. + +New Modules +----------- + +- deepsec_anti_malware - Create a new antimalware under TrendMicro Deep Security Policy +- deepsec_firewallrules - Create a new firewall rule. +- deepsec_hosts_info - Obtain information about one or many Hosts defined by TrendMicro Deep Security +- deepsec_log_inspectionrules - Create a new log inspection rule. diff --git a/README.md b/README.md index e798296..dbad971 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ The Ansible TrendMicro DeepSecurity collection includes a variety of Ansible con ## Ansible version compatibility -This collection has been tested against following Ansible versions: **>=2.9.10,<2.11**. +This collection has been tested against following Ansible versions: **>=2.9.10**. Plugins and modules within a collection may be tested with only specific Ansible versions. A collection may contain metadata that identifies these versions. @@ -25,13 +25,28 @@ The TrendMicro DeepSecurity collection supports ``httpapi`` connections. ## Included content -### httpapi plugins +### Httpapi plugins Name | Description --- | --- +[trendmicro.deepsec.deepsec](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_httpapi.rst)|HttpApi Plugin for Trend Micro Deep Security ### Modules Name | Description --- | --- +[trendmicro.deepsec.deepsec_anti_malware](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_anti_malware_module.rst)|Create a new antimalware under TrendMicro Deep Security Policy +[trendmicro.deepsec.deepsec_anti_malwares](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_anti_malwares_module.rst)|Manages AntiMalware Rule resource module +[trendmicro.deepsec.deepsec_apikey](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_apikey_module.rst)|Create a new and manage API Keys. +[trendmicro.deepsec.deepsec_firewall_rules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_firewall_rules_module.rst)|Manages Firewall Rule resource module +[trendmicro.deepsec.deepsec_firewallrules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_firewallrules_module.rst)|Create a new firewall rule. +[trendmicro.deepsec.deepsec_hosts_info](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_hosts_info_module.rst)|Obtain information about one or many Hosts defined by TrendMicro Deep Security +[trendmicro.deepsec.deepsec_integrity_monitoring_rules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_integrity_monitoring_rules_module.rst)|Manages Integrity Monitoring Rule resource module +[trendmicro.deepsec.deepsec_integrity_monitoringrules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_integrity_monitoringrules_module.rst)|Create/Configure Integrity Monitoring Rules. +[trendmicro.deepsec.deepsec_intrusion_prevention_rules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_intrusion_prevention_rules_module.rst)|Intrusion Prevention Rule resource module. +[trendmicro.deepsec.deepsec_intrusion_preventionrules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_intrusion_preventionrules_module.rst)|Create a new intrusion prevention rule. +[trendmicro.deepsec.deepsec_log_inspection_rules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_log_inspection_rules_module.rst)|Manages Log Inspection Rule resource module +[trendmicro.deepsec.deepsec_log_inspectionrules](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_log_inspectionrules_module.rst)|Create a new log inspection rule. +[trendmicro.deepsec.deepsec_syslog](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_syslog_module.rst)|Configure or create a syslog configuration for TrendMicro Deep Security +[trendmicro.deepsec.deepsec_system_settings](https://github.com/ansible-collections/trendmicro.deepsec/blob/main/docs/trendmicro.deepsec.deepsec_system_settings_module.rst)|Modify the system settings for TrendMicro Deep Security. @@ -57,11 +72,26 @@ An example for using this collection to manage a TM deepsecurity policy resource is as follows: `inventory.ini` (Note the password should be managed by a [Vault](https://docs.ansible.com/ansible/latest/user_guide/vault.html) for a production environment. +Trend Micro Deep security currently supports two ways as to how their REST API can be interacted with, and for each of the respective cases, the Ansible inventory will be changed slightly as mentioned below: +1. In case of the [newer REST APIs](https://automation.deepsecurity.trendmicro.com/article/fr/api-reference/) the Ansible inventory will work with the network OS `trendmicro.deepsec.deepsec`, a Trend Micro `api-secret-key` and `api-version` key: ``` -[trendmicro] -host_tm.example.com +[deepsec] +host_deepsec.example.com -[trendmicro:vars] +[deepsec:vars] +ansible_network_os=trendmicro.deepsec.deepsec +ansible_httpapi_use_ssl=true +ansible_httpapi_validate_certs=false +ansible_connection=httpapi +ansible_python_interpreter=/usr/bin/python +ansible_httpapi_session_key={'api-secret-key': 'secret-key', 'api-version': 'v1'} +``` +2. In case of APIs using the [legacy REST APIs](https://automation.deepsecurity.trendmicro.com/legacy-rest/12_5/index.html?env=onprem#overview), the Ansible inventory will also require the network OS `trendmicro.deepsec.deepsec`, but uses a `username` and a `password`. +``` +[deepsec] +host_deepsec.example.com + +[deepsec:vars] ansible_user=admin ansible_httpapi_pass=password ansible_httpapi_use_ssl=true @@ -85,30 +115,19 @@ You can either call modules by their Fully Qualified Collection Namespace (FQCN) - trendmicro.deepsec tasks: - - name: Create and Config new policy - trendmicro.deepsec.policies_config: - name: test_ansible_pol - description: TM pol via Ansible + - name: Create/Config a new Firewall Rule Config + trendmicro.deepsec.deepsec_firewallrules: state: present - policy_settings: - firewall_setting_engine_option_connections_cleanup_max: - value: 100 - recommendation_scan_mode: ongoing - anti_malware: - state: off - real_time_scan_configuration_id: 0 - firewall: - state: off - global_stateful_configuration_id: 1 - rule_id: - - 1 - - 2 - intrusion_prevention: - state: prevent - rule_id: - - 1 - - 2 - application_type_id: [1, 2] + name: test_firewallrule config + description: test firewall description + action: deny + priority: 0 + source_iptype: any + destination_iptype: any + direction: incoming + protocol: tcp + tcpflags: + - syn ``` ## Contributing to this collection @@ -117,7 +136,7 @@ We welcome community contributions to this collection. If you find problems, ple You can also join us on: -- Freenode IRC - ``#ansible-security`` Freenode channel +- IRC - the ``#ansible-security`` [irc.libera.chat](https://libera.chat/) channel See the [Ansible Community Guide](https://docs.ansible.com/ansible/latest/community/index.html) for details on contributing to Ansible. @@ -145,4 +164,4 @@ Release notes are available [here](https://github.com/ansible-collections/trendm GNU General Public License v3.0 or later. -See [LICENSE](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text. \ No newline at end of file +See [LICENSE](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text. diff --git a/bindep.txt b/bindep.txt new file mode 100644 index 0000000..ba9c980 --- /dev/null +++ b/bindep.txt @@ -0,0 +1,6 @@ +# This is a cross-platform list tracking distribution packages needed by tests; +# see https://docs.openstack.org/infra/bindep/ for additional information. + +gcc-c++ [doc test platform:rpm] +python3-devel [test platform:rpm] +python3 [test platform:rpm] diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml new file mode 100644 index 0000000..88f9aa1 --- /dev/null +++ b/changelogs/changelog.yaml @@ -0,0 +1,105 @@ +ancestor: null +releases: + 1.0.0: + changes: + bugfixes: + - Fix no log issues for private_key for deepsec_syslog_config module. + minor_changes: + - Add deepsec_anti_malware config module. + - Add deepsec_firewallrules config module. + - Add deepsec_hosts_info config module. + - Add deepsec_log_inspectionrules module. + - Add deepsec_syslog module. + fragments: + - anti_malware_config.yml + - fix_sanity_no_log_issue.yaml + modules: + - description: Create a new antimalware under TrendMicro Deep Security Policy + name: deepsec_anti_malware + namespace: "" + - description: Create a new firewall rule. + name: deepsec_firewallrules + namespace: "" + - description: + Obtain information about one or many Hosts defined by TrendMicro + Deep Security + name: deepsec_hosts_info + namespace: "" + - description: Create a new log inspection rule. + name: deepsec_log_inspectionrules + namespace: "" + - description: Configure or create a syslog configuration for TrendMicro Deep Security + name: deepsec_syslog + release_date: "2021-06-23" + 1.1.0: + changes: + minor_changes: + - Add deepsec_apikey config module. + - Add deepsec_system_settings config module. + fragments: + - add_api_key_module.yaml + - add_system_settings_module.yaml + modules: + - description: Create a new and manage API Keys. + name: deepsec_apikey + namespace: "" + - description: Modify the system settings for TrendMicro Deep Security. + name: deepsec_system_settings + namespace: "" + release_date: "2021-06-24" + 1.2.0: + changes: + doc_changes: + - To update comments to get included TM collection under Ansible + (https://github.com/ansible-collections/ansible-inclusion/discussions/27#discussioncomment-1016085). + minor_changes: + - Add AntiMalware rules resource module. + - Add Firewall rules resource module. + - Add Log Inspection rules resource module. + - Add new Integrity Monitoring rules module (https://github.com/ansible-collections/trendmicro.deepsec/pull/24). + - Add new RM states to Intrusion prevention rules module (https://github.com/ansible-collections/trendmicro.deepsec/pull/25). + fragments: + - 23_add_intrusion_prevention_rules_module.yaml + - 24_add_integrity_monitoring_rules_mosule.yaml + - Add_antimalware_rules.yaml + - Add_firewall_rules_resource_module.yaml + - Add_integrity_monitoring_rules_resource_module.yaml + - Add_log_inspection_rules_resource_module.yaml + - fix_comments_for_getting_tm_to_get_included_to_ansible.yaml + - reinstate_ipr_legacy_module.yaml + - support_rm_states_for_ipr_module.yaml + modules: + - description: Manages AntiMalware Rule resource module + name: deepsec_anti_malwares + namespace: private.var.folders._0.m716s5gx1g3d5j1dw_s2w1ph0000gn. + T.antsibull-changeloghfeb6_9p.collections.ansible_collections.trendmicro.deepsec.plugins.modules + - description: Manages Firewall Rule resource module + name: deepsec_firewall_rules + namespace: private.var.folders._0.m716s5gx1g3d5j1dw_s2w1ph0000gn. + T.antsibull-changeloghfeb6_9p.collections.ansible_collections.trendmicro.deepsec.plugins.modules + - description: Manages Integrity Monitoring Rule resource module + name: deepsec_integrity_monitoring_rules + namespace: private.var.folders._0.m716s5gx1g3d5j1dw_s2w1ph0000gn. + T.antsibull-changeloghfeb6_9p.collections.ansible_collections.trendmicro.deepsec.plugins.modules + - description: Intrusion Prevention Rule resource module. + name: deepsec_intrusion_prevention_rules + namespace: private.var.folders._0.m716s5gx1g3d5j1dw_s2w1ph0000gn. + T.antsibull-changeloghfeb6_9p.collections.ansible_collections.trendmicro.deepsec.plugins.modules + - description: Manages Log Inspection Rule resource module + name: deepsec_log_inspection_rules + namespace: private.var.folders._0.m716s5gx1g3d5j1dw_s2w1ph0000gn. + T.antsibull-changeloghfeb6_9p.collections.ansible_collections.trendmicro.deepsec.plugins.modules + release_date: "2021-12-13" + 2.0.0: + changes: + doc_changes: + - Update module doc + major_changes: + - Minimum required ansible.netcommon version is 2.5.1. + - Updated base plugin references to ansible.netcommon. + fragments: + - 0-ignore.yml + - 1.2.0_release_prep.yaml + - bindep_update.yaml + - netcommon_ref_update.yaml + release_date: "2022-04-29" diff --git a/changelogs/config.yaml b/changelogs/config.yaml new file mode 100644 index 0000000..1b83081 --- /dev/null +++ b/changelogs/config.yaml @@ -0,0 +1,33 @@ +--- +changelog_filename_template: CHANGELOG.rst +changelog_filename_version_depth: 0 +changes_file: changelog.yaml +changes_format: combined +keep_fragments: false +mention_ancestor: true +new_plugins_after_name: removed_features +notesdir: fragments +prelude_section_name: release_summary +prelude_section_title: Release Summary +flatmap: true +sections: + - - major_changes + - Major Changes + - - minor_changes + - Minor Changes + - - breaking_changes + - Breaking Changes / Porting Guide + - - deprecated_features + - Deprecated Features + - - removed_features + - Removed Features (previously deprecated) + - - security_fixes + - Security Fixes + - - bugfixes + - Bugfixes + - - known_issues + - Known Issues + - - doc_changes + - Documentation Changes +title: TrendMicro DeepSecurity Collection +trivial_section_name: trivial diff --git a/changelogs/fragments/docs_update_tm_deepsec_modules.yaml b/changelogs/fragments/docs_update_tm_deepsec_modules.yaml new file mode 100644 index 0000000..196bfe7 --- /dev/null +++ b/changelogs/fragments/docs_update_tm_deepsec_modules.yaml @@ -0,0 +1,3 @@ +--- +doc_changes: + - To add run output to the docs of all of the existing TM deepsec resource modules. diff --git a/changelogs/fragments/log_inspection_rule_log_file_param_issue.yaml b/changelogs/fragments/log_inspection_rule_log_file_param_issue.yaml new file mode 100644 index 0000000..4b0a1c8 --- /dev/null +++ b/changelogs/fragments/log_inspection_rule_log_file_param_issue.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - To fix the Log inspection rules module bug, where log_files param was not parsed as expected in idempotent play output. diff --git a/changelogs/fragments/maintenance_pr.yaml b/changelogs/fragments/maintenance_pr.yaml new file mode 100644 index 0000000..e4897d1 --- /dev/null +++ b/changelogs/fragments/maintenance_pr.yaml @@ -0,0 +1,4 @@ +--- +trivial: + - Add github action and enable precommit. + - Fix lint issues. diff --git a/changelogs/fragments/utc_deepsec_anti_malwares.yaml b/changelogs/fragments/utc_deepsec_anti_malwares.yaml new file mode 100644 index 0000000..e21f1ec --- /dev/null +++ b/changelogs/fragments/utc_deepsec_anti_malwares.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - To add unit test case for deepsec_anti_malwares module diff --git a/changelogs/fragments/utc_deepsec_firewall_rules.yaml b/changelogs/fragments/utc_deepsec_firewall_rules.yaml new file mode 100644 index 0000000..fefb365 --- /dev/null +++ b/changelogs/fragments/utc_deepsec_firewall_rules.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - To add unit test case for deepsec_firewall_rules module diff --git a/changelogs/fragments/utc_for_tm_deepsec_rm.yaml b/changelogs/fragments/utc_for_tm_deepsec_rm.yaml new file mode 100644 index 0000000..0efdfdf --- /dev/null +++ b/changelogs/fragments/utc_for_tm_deepsec_rm.yaml @@ -0,0 +1,3 @@ +--- +minor_changes: + - To add unit test case for deepsec_integrity_monitoring_rules, deepsec_intrusion_prevention_rules, and deepsec_log_inspection_rules module diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 0000000..c77c91a --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +--- +codecov: + require_ci_to_pass: true +comment: + layout: " diff, flags, files" + behavior: default + require_changes: false + require_base: false + require_head: true +coverage: + status: + patch: false + project: + default: + threshold: 0.3% diff --git a/cspell.config.yaml b/cspell.config.yaml new file mode 100644 index 0000000..20e7d88 --- /dev/null +++ b/cspell.config.yaml @@ -0,0 +1,37 @@ +--- +dictionaryDefinitions: + - name: words + path: .config/dictionary.txt + addWords: true +dictionaries: + - bash + - networking-terms + - python + - words + - "!aws" + - "!backwards-compatibility" + - "!cryptocurrencies" + - "!cpp" +ignorePaths: + # All dot files in the root + - \.* + # This file + - cspell.config.yaml + # Generated rst files in the docs directory + - docs/*.rst + # The mypy configuration file + - mypy.ini + # The shared file for tool configuration + - pyproject.toml + # requirements.txt + - requirements.txt + # test-requirements.txt + - test-requirements.txt + # the bindep file + - bindep.txt + # The tox configuration file + - tox.ini + +languageSettings: + - languageId: python + allowCompoundWords: false diff --git a/docs/trendmicro.deepsec.deepsec_anti_malware_module.rst b/docs/trendmicro.deepsec.deepsec_anti_malware_module.rst new file mode 100644 index 0000000..d97f695 --- /dev/null +++ b/docs/trendmicro.deepsec.deepsec_anti_malware_module.rst @@ -0,0 +1,856 @@ +.. _trendmicro.deepsec.deepsec_anti_malware_module: + + +*************************************** +trendmicro.deepsec.deepsec_anti_malware +*************************************** + +**Create a new antimalware under TrendMicro Deep Security Policy** + + +Version added: 1.0.0 + +.. contents:: + :local: + :depth: 1 + +DEPRECATED +---------- +:Removed in collection release after 2023-12-01 +:Why: Newer and updated modules released with more functionality +:Alternative: deepsec_anti_malwares + + + +Synopsis +-------- +- This module creates a new antimalware under TrendMicro Deep Security + + + + +Parameters +---------- + +.. raw:: html + +
Parameter | +Choices/Defaults | +Comments | +
---|---|---|
+
+ id
+
+
+ integer
+
+ |
+ + | +
+ Obtain only information of the Rule with provided ID
+ |
+