diff --git a/.addonmatrix b/.addonmatrix index dfb15b12..9985080e 100644 --- a/.addonmatrix +++ b/.addonmatrix @@ -1 +1 @@ ---splunkfeatures METRICS_MULTI,PYTHON3 \ No newline at end of file +--splunkfeatures METRICS_MULTI,PYTHON3 diff --git a/.eslintrc.yml b/.eslintrc.yml new file mode 100644 index 00000000..d45232fd --- /dev/null +++ b/.eslintrc.yml @@ -0,0 +1,19 @@ +--- +env: + browser: true + es6: true + jest: true + +globals: + Atomics: readonly + SharedArrayBuffer: readonly + +parser: '@typescript-eslint/parser' +parserOptions: + ecmaVersion: 2018 + sourceType: module + +plugins: + - '@typescript-eslint' + +rules: { } diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index fde83a49..de577950 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -7,12 +7,12 @@ on: tags: - "v[0-9]+.[0-9]+.[0-9]+" pull_request: - branches: + branches: - "**" jobs: call-workflow: - uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-build-test-release.yml@v1.7 + uses: splunk/addonfactory-workflow-addon-release/.github/workflows/reusable-build-test-release.yml@v2.0 secrets: GH_TOKEN_ADMIN: ${{ secrets.GH_TOKEN_ADMIN }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish-manual.yaml b/.github/workflows/publish-manual.yaml index f28278e3..49e24f0c 100644 --- a/.github/workflows/publish-manual.yaml +++ b/.github/workflows/publish-manual.yaml @@ -1,9 +1,9 @@ name: publish-untested -on: +on: workflow_dispatch: inputs: tag: - description: 'Tag to release' + description: 'Tag to release' required: true jobs: diff --git a/.github/workflows/review-secrets.yml b/.github/workflows/review-secrets.yml index bc0c84cb..5b751dd7 100644 --- a/.github/workflows/review-secrets.yml +++ b/.github/workflows/review-secrets.yml @@ -9,4 +9,3 @@ jobs: uses: actions/checkout@v1 - name: Trufflehog Actions Scan uses: edplato/trufflehog-actions-scan@v0.9f-beta - diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..a835782b --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,28 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.2.0 + hooks: + - id: check-merge-conflict + - id: debug-statements + - id: trailing-whitespace + - id: check-yaml + - id: check-xml + - id: check-toml + - id: check-json + - id: end-of-file-fixer + - repo: https://github.com/psf/black + rev: 22.3.0 + hooks: + - id: black + - repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks + rev: v2.4.0 + hooks: + - id: pretty-format-java + args: [ --autofix ] + - repo: https://github.com/eslint/eslint + rev: v8.21.0 + hooks: + - id: eslint + additional_dependencies: + - "@typescript-eslint/parser" + - "@typescript-eslint/eslint-plugin" diff --git a/.releaserc b/.releaserc index 924fc746..6dc5b2ce 100644 --- a/.releaserc +++ b/.releaserc @@ -30,7 +30,7 @@ "assets": ["THIRDPARTY"], "message": "chore(release): ${nextRelease.version}\n\n${nextRelease.notes}", }, - ], + ], ["@semantic-release/github", {}], ] } diff --git a/.releaserc.json b/.releaserc.json index 6c904d81..12a4403d 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -35,4 +35,4 @@ } ] ] -} \ No newline at end of file +} diff --git a/.reuse/dep5 b/.reuse/dep5 index 2152cb7d..8a15c979 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -83,4 +83,4 @@ License: Apache-2.0 Files: semtag Copyright: $YEAR $NAME <$CONTACT> -License: Apache-2.0 \ No newline at end of file +License: Apache-2.0 diff --git a/.semgrepignore b/.semgrepignore index 12ce9da7..5c3b7908 100644 --- a/.semgrepignore +++ b/.semgrepignore @@ -27,4 +27,4 @@ tests/ .github/ .reuse/ .vscode/ -deps/ \ No newline at end of file +deps/ diff --git a/.splunkbase b/.splunkbase index 8cca5fac..b4656b8b 100755 --- a/.splunkbase +++ b/.splunkbase @@ -1,3 +1,3 @@ SPLUNKBASE_ID=3022 SPLUNKBASE_SPLUNK_VERSION=8.0,8.1 -SPLUNKBASE_SPLUNK_CIM_VERSION=4.x \ No newline at end of file +SPLUNKBASE_SPLUNK_CIM_VERSION=4.x diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 9c29f13e..00000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,14 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Splunk, Inc. - * SPDX-License-Identifier: LicenseRef-Splunk-8-2021 - * - */ -{ - "recommendations": [ - "rogalmic.bash-debug", - "ms-azuretools.vscode-docker", - "cameron.vscode-pytest", - "ms-python.python", - "donjayamanne.python-extension-pack", - ] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 96284019..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,10 +0,0 @@ -/* - * SPDX-FileCopyrightText: 2021 Splunk, Inc. - * SPDX-License-Identifier: LicenseRef-Splunk-8-2021 - * - */ -{ - "python.pythonPath": ".venv/bin/python", - "python.testing.pytestEnabled": true, - "python.testing.autoTestDiscoverOnSaveEnabled": true -} \ No newline at end of file diff --git a/Dockerfile-http_proxy b/Dockerfile-http_proxy index e6400ad3..cae88700 100644 --- a/Dockerfile-http_proxy +++ b/Dockerfile-http_proxy @@ -20,4 +20,4 @@ RUN echo "auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/pas "http_port 3128\n" > /etc/squid/squid.conf RUN cat /etc/squid/squid.conf RUN service squid start -RUN service squid restart \ No newline at end of file +RUN service squid restart diff --git a/Dockerfile-saucelabs b/Dockerfile-saucelabs index 0ca7e23d..0edc2a82 100644 --- a/Dockerfile-saucelabs +++ b/Dockerfile-saucelabs @@ -9,4 +9,4 @@ FROM circleci/python:3.7 RUN curl https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz -o /home/circleci/saucelabs.tar.gz RUN tar -xzf /home/circleci/saucelabs.tar.gz --directory /home/circleci/ -CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445 \ No newline at end of file +CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445 diff --git a/Dockerfile-splunk b/Dockerfile-splunk index dae2f604..bd44a4b4 100644 --- a/Dockerfile-splunk +++ b/Dockerfile-splunk @@ -13,4 +13,4 @@ COPY deps/build/addonfactory_test_matrix_splunk/packages/all/addon_factory_web / COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID COPY .pytest.expect /home/circleci/work_backend/.pytest.expect -COPY tests /home/circleci/work_backend/tests \ No newline at end of file +COPY tests /home/circleci/work_backend/tests diff --git a/Dockerfile-splunk-local b/Dockerfile-splunk-local index 234ac053..3de488c8 100644 --- a/Dockerfile-splunk-local +++ b/Dockerfile-splunk-local @@ -11,4 +11,4 @@ COPY deps/build/addonfactory_test_matrix_splunk/packages/all/addon_factory_web / COPY $SPLUNK_APP_PACKAGE /opt/splunk/etc/apps/$SPLUNK_APP_ID COPY .pytest.expect /home/circleci/work_backend/.pytest.expect -COPY tests /home/circleci/work_backend/tests \ No newline at end of file +COPY tests /home/circleci/work_backend/tests diff --git a/Dockerfile-uf b/Dockerfile-uf index 4ea86be1..3f0e455c 100644 --- a/Dockerfile-uf +++ b/Dockerfile-uf @@ -5,4 +5,4 @@ ARG SPLUNK_APP_ID=TA_UNKNOWN ARG SPLUNK_APP_PACKAGE=$SPLUNK_APP_PACKAGE RUN echo Splunk VERSION=$SPLUNK_VERSION -COPY $SPLUNK_APP_PACKAGE /opt/splunkforwarder/etc/apps/$SPLUNK_APP_ID \ No newline at end of file +COPY $SPLUNK_APP_PACKAGE /opt/splunkforwarder/etc/apps/$SPLUNK_APP_ID diff --git a/LICENSES/Apache-2.0.txt b/LICENSES/Apache-2.0.txt index 4ed90b95..527a83a2 100644 --- a/LICENSES/Apache-2.0.txt +++ b/LICENSES/Apache-2.0.txt @@ -7,17 +7,17 @@ AND DISTRIBUTION 1. Definitions. - + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. @@ -26,31 +26,31 @@ or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - + "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - + "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - + "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, @@ -59,7 +59,7 @@ original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - + "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative @@ -74,7 +74,7 @@ for the purpose of discussing and improving the Work, but excluding communicatio that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated diff --git a/LICENSES/LicenseRef-Splunk-8-2021.txt b/LICENSES/LicenseRef-Splunk-8-2021.txt index b62c047d..c4063024 100644 --- a/LICENSES/LicenseRef-Splunk-8-2021.txt +++ b/LICENSES/LicenseRef-Splunk-8-2021.txt @@ -4,17 +4,17 @@ Last Updated: August 12, 2021 These Splunk General Terms (“General Terms”) between Splunk Inc., a Delaware corporation, with its principal place of business at 270 Brannan Street, San Francisco, California 94107, U.S.A (“Splunk” or “we” or “us” or “our”) and you (“Customer” or “you” or “your”) apply to the purchase of licenses and subscriptions for Splunk’s Offerings. By clicking on the appropriate button, or by downloading, installing, accessing or using the Offerings, you agree to these General Terms. If you are entering into these General Terms on behalf of Customer, you represent that you have the authority to bind Customer. If you do not agree to these General Terms, or if you are not authorized to accept the General Terms on behalf of the Customer, do not download, install, access, or use any of the Offerings. -See the General Terms Definitions Exhibit attached for definitions of capitalized terms not defined herein. +See the General Terms Definitions Exhibit attached for definitions of capitalized terms not defined herein. 1. License Rights -(A) General Rights. You have the nonexclusive, worldwide, nontransferable and nonsublicensable right, subject to payment of applicable Fees and compliance with the terms of these General Terms, to use your Purchased Offerings for your Internal Business Purposes during the Term and up to the Capacity purchased. +(A) General Rights. You have the nonexclusive, worldwide, nontransferable and nonsublicensable right, subject to payment of applicable Fees and compliance with the terms of these General Terms, to use your Purchased Offerings for your Internal Business Purposes during the Term and up to the Capacity purchased. (B) Copies for On-Premises Products. You have the right to make a reasonable number of copies of On-Premises Products for archival and back-up purposes. -(C) Splunk Extensions. You may use Splunk Extensions solely in connection with the applicable Purchased Offering subject to the same terms and conditions for that Offering (including with respect to Term) and payment of any Fees associated with the Splunk Extensions. Some Splunk Extensions may be made available under license terms that provide broader rights than the license rights you have to the applicable underlying Offering (e.g., if the Extension is Open Source Software). These broader rights will apply to that Splunk Extension. Splunk Extensions may be installed on Hosted Services pursuant to our instructions. +(C) Splunk Extensions. You may use Splunk Extensions solely in connection with the applicable Purchased Offering subject to the same terms and conditions for that Offering (including with respect to Term) and payment of any Fees associated with the Splunk Extensions. Some Splunk Extensions may be made available under license terms that provide broader rights than the license rights you have to the applicable underlying Offering (e.g., if the Extension is Open Source Software). These broader rights will apply to that Splunk Extension. Splunk Extensions may be installed on Hosted Services pursuant to our instructions. (D) Trials, Evaluations, Beta and Free Licenses. -(i) Trials and Evaluations. Offerings provided for trials and evaluations are provided at no charge, and their use will be for a limited duration. +(i) Trials and Evaluations. Offerings provided for trials and evaluations are provided at no charge, and their use will be for a limited duration. (ii) Beta Licenses. Some Offerings and features may be available to you as a preview, or as an alpha, beta or other pre-release version (each, a “Beta Offering”). All rights for Beta Offerings are solely for internal testing and evaluation. Your use of a Beta Offering will be for the term specified by us, and if no term is specified, then for the earlier of one year from the start date of the Beta Offering or when that version of the Beta Offering becomes generally available. We may discontinue the Beta Offering at any time and may decide not to make any of the features and functionality generally available. @@ -29,7 +29,7 @@ See the General Terms Definitions Exhibit attached for definitions of capitalize 2. Purchasing Through Authorized Resellers, Digital Marketplaces, and Splunk Affiliates (A) Authorized Resellers and Digital Marketplaces. If you purchase Offerings through a Splunk authorized reseller or Digital Marketplace, these General Terms will govern those Offerings. Your payment obligations for the Purchased Offerings will be with the authorized reseller or Digital Marketplace, as applicable, not Splunk. You will have no direct Fee payment obligations to Splunk for those Offerings. However, in the event that you fail to pay the Digital Marketplace for your Purchased Offerings, Splunk retains the right to enforce your payment obligations and collect directly from you. -Any terms agreed to between you and the authorized reseller that are in addition to these General Terms are solely between you and the authorized reseller and Digital Marketplace, as applicable. No agreement between you and an authorized reseller or Digital Marketplace is binding on Splunk or will have any force or effect with respect to the rights in, or the operation, use or provision of, the Offerings. +Any terms agreed to between you and the authorized reseller that are in addition to these General Terms are solely between you and the authorized reseller and Digital Marketplace, as applicable. No agreement between you and an authorized reseller or Digital Marketplace is binding on Splunk or will have any force or effect with respect to the rights in, or the operation, use or provision of, the Offerings. (B) Splunk Affiliate Distributors. Splunk has appointed certain Splunk Affiliates as its non-exclusive distributors of the Offerings (each, a “Splunk Affiliate Distributor”). Each Splunk Affiliate Distributor is authorized by Splunk to negotiate and enter into Orders with Customers. Where a purchase from Splunk is offered by a Splunk Affiliate Distributor, Customer will issue Orders, and make payments, to the Splunk Affiliate Distributor which issued the quote for the Offering. Each Order will be deemed a separate contract between Customer and the relevant Splunk Affiliate Distributor and will be subject to these General Terms. For the avoidance of doubt, Customer agrees that: (i) the total liability of Splunk under these General Terms as set forth in Section 22 (Limitation of Liability) states the overall combined liability of Splunk and Splunk Affiliate Distributors; (ii) the entering into Orders by a Splunk Affiliate Distributor will not be deemed to expand Splunk and its Affiliates’ overall responsibilities or liability under these General Terms; and (iii) Customer will have no right to recover more than once from the same event. @@ -59,7 +59,7 @@ Splunk offers standard services to implement and configure your Purchased Offeri Splunk will follow globally recognized data protection principles and industry-leading standards for the security of personal data. Splunk will comply with the requirements and obligations set forth in Splunk’s Data Protection Addendum (“DPA”), located at https://www.splunk.com/en_us/legal/splunk-dpa.html, which includes standard terms for the processing of personal data (including, as applicable, personal data in a Hosted Service). 8. Security -(A) Security for Hosted Services: Standard Environment. Splunk will implement industry leading security safeguards for the protection of Customer Confidential Information, including Customer Content transferred to and stored within the Hosted Services. These safeguards include commercially reasonable administrative, technical, and organizational measures to protect Customer Content against destruction, loss, alteration, unauthorized disclosure, or unauthorized access, including such things as information security policies and procedures, security awareness training, threat and vulnerability management, incident response and breach notification, and vendor risk management. Splunk’s technical safeguards are further described in the Splunk Cloud Platform Security Addendum (“SC-SA”), located at https://www.splunk.com/en_us/legal/splunk-cloud-security-addendum.html, and the Observability Suite Security Addendum (“OS-SA”), located at https://www.splunk.com/en_us/legal/splunk-observability-security-addendum.html, as applicable, and are incorporated herein by reference. +(A) Security for Hosted Services: Standard Environment. Splunk will implement industry leading security safeguards for the protection of Customer Confidential Information, including Customer Content transferred to and stored within the Hosted Services. These safeguards include commercially reasonable administrative, technical, and organizational measures to protect Customer Content against destruction, loss, alteration, unauthorized disclosure, or unauthorized access, including such things as information security policies and procedures, security awareness training, threat and vulnerability management, incident response and breach notification, and vendor risk management. Splunk’s technical safeguards are further described in the Splunk Cloud Platform Security Addendum (“SC-SA”), located at https://www.splunk.com/en_us/legal/splunk-cloud-security-addendum.html, and the Observability Suite Security Addendum (“OS-SA”), located at https://www.splunk.com/en_us/legal/splunk-observability-security-addendum.html, as applicable, and are incorporated herein by reference. (B) Security for Hosted Services: Premium HIPAA Environment. For Hosted Services Offerings provisioned in Splunk Cloud Platform’s Premium HIPAA environment (as specified in an Order), in addition to the protections under the SC-SA and these General Terms, Splunk will comply with the requirements and obligations set forth in Splunk Business Associate Agreement found here: https://www.splunk.com/en_us/legal/splunk-baa.html. @@ -72,7 +72,7 @@ Splunk will follow globally recognized data protection principles and industry-l (F) Maintaining Protections. Notwithstanding anything to contrary in these General Terms, or any policy or terms referenced herein via hyperlink (or any update thereto), Splunk may not, during a Term materially diminish the security protections set forth in these General Terms, any Specific Offering Terms, or the applicable security addendum. 9. Use Restrictions -Except as expressly permitted in an Order, these General Terms or our Documentation, you agree not to (nor allow any user or Third Party Provider to): (a) reverse engineer (except to the extent specifically permitted by statutory law), decompile, disassemble or otherwise attempt to discover source code or underlying structures, ideas or algorithms of any Offering; (b) modify, translate or create derivative works based on the Offerings; (c) use an Offering for service bureau purposes, or for any purpose other than your own Internal Business Purposes; (d) resell, transfer or distribute any Offering; (e) access or use any Offering in order to monitor its availability, performance, or functionality for competitive purposes; (f) attempt to disable or circumvent any license key or other technological mechanisms or measures intended to prevent, limit or control use or copying of, or access to, Offerings; (g) separately use any of the applicable features and functionalities of the Offerings with external applications or code not furnished by Splunk or any data not processed by the Offering; (h) exceed the Capacity purchased or (i) use any Offering in violation of all applicable laws and regulations (including but not limited to any applicable privacy and intellectual property laws). +Except as expressly permitted in an Order, these General Terms or our Documentation, you agree not to (nor allow any user or Third Party Provider to): (a) reverse engineer (except to the extent specifically permitted by statutory law), decompile, disassemble or otherwise attempt to discover source code or underlying structures, ideas or algorithms of any Offering; (b) modify, translate or create derivative works based on the Offerings; (c) use an Offering for service bureau purposes, or for any purpose other than your own Internal Business Purposes; (d) resell, transfer or distribute any Offering; (e) access or use any Offering in order to monitor its availability, performance, or functionality for competitive purposes; (f) attempt to disable or circumvent any license key or other technological mechanisms or measures intended to prevent, limit or control use or copying of, or access to, Offerings; (g) separately use any of the applicable features and functionalities of the Offerings with external applications or code not furnished by Splunk or any data not processed by the Offering; (h) exceed the Capacity purchased or (i) use any Offering in violation of all applicable laws and regulations (including but not limited to any applicable privacy and intellectual property laws). 10. Our Ethics, Compliance and Corporate Responsibility (A) Ethics and Corporate Responsibility. Splunk is committed to acting ethically and in compliance with applicable law, and we have policies and guidelines in place to provide awareness of, and compliance with, the laws and regulations that apply to our business globally. We are committed to ethical business conduct, and we use diligent efforts to perform in accordance with the highest global ethical principles, as described in the Splunk Code of Conduct and Ethics found here: https://investors.splunk.com/code-business-conduct-and-ethics-1. @@ -82,7 +82,7 @@ Except as expressly permitted in an Order, these General Terms or our Documentat (C) Export. We certify that Splunk is not on any of the relevant U.S. or EU government lists of prohibited persons, including the Treasury Department’s List of Specially Designated Nationals and the Commerce Department’s List of Denied Persons or Entity List. Export information regarding our Offerings, including our export control classifications for our Offerings, is found here: https://www.splunk.com/en_us/legal/export-controls.html. 11. Usage Data -From time to time, Splunk may collect Usage Data generated as a by-product of your use of Offerings (e.g., technical information about your operating environment and sessions, systems architecture, page loads and views, product versions, number and type of searches, number of users, source type and format). Usage Data does not include Customer Content. We collect Usage Data for a variety of reasons, such as to identify, understand, and anticipate performance issues and the factors that affect them, to provide updates and personalized experiences to customers, and to improve the Splunk Offerings. Details on Splunk’s Usage Data collection practices are set forth in Splunk's Privacy Policy found here: https://www.splunk.com/en_us/legal/privacy/privacy-policy.html. +From time to time, Splunk may collect Usage Data generated as a by-product of your use of Offerings (e.g., technical information about your operating environment and sessions, systems architecture, page loads and views, product versions, number and type of searches, number of users, source type and format). Usage Data does not include Customer Content. We collect Usage Data for a variety of reasons, such as to identify, understand, and anticipate performance issues and the factors that affect them, to provide updates and personalized experiences to customers, and to improve the Splunk Offerings. Details on Splunk’s Usage Data collection practices are set forth in Splunk's Privacy Policy found here: https://www.splunk.com/en_us/legal/privacy/privacy-policy.html. 12. Capacity and Usage Verification (A) Certification and Verification. At Splunk’s request, you will furnish Splunk a certification signed by your authorized representative verifying that your use of the Purchased Offering is in accordance with these General Terms and the applicable Order. For On-Premises Products, we may also ask you from time to time, but not more frequently than once per calendar period, to cooperate with us to verify usage and adherence to purchased Capacities. If Splunk requests a verification process, you agree to provide Splunk reasonable access to the On-Premises Product installed at your facility (or as hosted by your Third-Party Provider). If Splunk does any verification, it will be performed with as little interference as possible to your use of the On-Premises Product and your business operations. Splunk will comply with your (or your Third-Party Providers’) reasonable security procedures. @@ -118,7 +118,7 @@ You have a nonexclusive, worldwide, nontransferable, nonsublicensable right, sub (E) Acceptable Use. Without limiting any terms under these General Terms, you will also abide by our Hosted Services acceptable use policy: https://www.splunk.com/view/SP-CAAAMB6. 17. Confidentiality -(A) Confidential Information. Each party will protect the Confidential Information of the other. Accordingly, Receiving Party agrees to: (i) protect the Disclosing Party’s Confidential Information using the same degree of care (but in no event less than reasonable care) that it uses to protect its own Confidential Information of a similar nature; (ii) limit use of Disclosing Party’s Confidential Information for purposes consistent with these General Terms, and (iii) use commercially reasonable efforts to limit access to Disclosing Party’s Confidential Information to its employees, contractors and agents or those of its Affiliates who have a bona fide need to access such Confidential Information for purposes consistent with these General Terms and who are subject to confidentiality obligations no less stringent than those herein. +(A) Confidential Information. Each party will protect the Confidential Information of the other. Accordingly, Receiving Party agrees to: (i) protect the Disclosing Party’s Confidential Information using the same degree of care (but in no event less than reasonable care) that it uses to protect its own Confidential Information of a similar nature; (ii) limit use of Disclosing Party’s Confidential Information for purposes consistent with these General Terms, and (iii) use commercially reasonable efforts to limit access to Disclosing Party’s Confidential Information to its employees, contractors and agents or those of its Affiliates who have a bona fide need to access such Confidential Information for purposes consistent with these General Terms and who are subject to confidentiality obligations no less stringent than those herein. (B) Compelled Disclosure of Confidential Information. Notwithstanding the foregoing terms, the Receiving Party may disclose Confidential Information of the Disclosing Party if it is compelled by law enforcement agencies or regulators to do so, provided the Receiving Party gives the Disclosing Party prior notice of such compelled disclosure (to the extent legally permitted) and reasonable assistance, at the Disclosing Party's cost, if the Disclosing Party wishes to contest the disclosure. If the Receiving Party is compelled to disclose the Disclosing Party’s Confidential Information as part of a civil proceeding to which the Disclosing Party is a Party, and the Disclosing Party is not contesting the disclosure, the Disclosing Party will reimburse the Receiving Party for its reasonable cost of compiling and providing secure access to such Confidential Information. @@ -132,7 +132,7 @@ The payment terms below only apply when you purchase Offerings directly from Spl (C) Taxes. All Fees quoted are exclusive of applicable taxes and duties, including any applicable sales and use tax. You are responsible for paying any taxes or similar government assessments (including, without limitation, value-added, sales, use or withholding taxes). We will be solely responsible for taxes assessable against us based on our net income, property, and employees. 19. Splunk’s Warranties -(A) Relationship to Applicable Law. We will not seek to limit our liability, or any of your warranties, rights and remedies, to the extent the limits are not permitted by applicable law (e.g., warranties, remedies or liabilities that cannot be excluded by applicable law). +(A) Relationship to Applicable Law. We will not seek to limit our liability, or any of your warranties, rights and remedies, to the extent the limits are not permitted by applicable law (e.g., warranties, remedies or liabilities that cannot be excluded by applicable law). (B) General Corporate Warranty. Splunk warrants that it has the legal power and authority to enter into these General Terms. @@ -176,7 +176,7 @@ The foregoing disclaimers of damages will also not apply to the extent prohibite (C) Mutual Indemnity. Each party will defend, indemnify and pay all damages (including attorneys’ fees and costs) awarded against the other party, or that are agreed to in a settlement to the extent that an action brought against the other party by a third party is based upon a claim for bodily injury (including death) to any person, or damage to tangible property resulting from the negligent acts or willful misconduct of the indemnifying party or its personnel hereunder, and will pay any reasonable, direct, out-of-pocket costs, damages and reasonable attorneys’ fees attributable to such claim that are awarded against the indemnified party (or are payable in settlement by the indemnified party). -(D) Process for Indemnification. The indemnification obligations above are subject to the party seeking indemnification to: (i) provide the other party with prompt written notice of the specific claim; (ii) give the indemnifying party sole control of the defense and settlement of the claim (except that the indemnifying party may not settle any claim that requires any action or forbearance on the indemnified party’s part without their prior consent, which will not unreasonably withhold or delay); and (iii) gives the indemnifying party all reasonable assistance, at such party’s expense. +(D) Process for Indemnification. The indemnification obligations above are subject to the party seeking indemnification to: (i) provide the other party with prompt written notice of the specific claim; (ii) give the indemnifying party sole control of the defense and settlement of the claim (except that the indemnifying party may not settle any claim that requires any action or forbearance on the indemnified party’s part without their prior consent, which will not unreasonably withhold or delay); and (iii) gives the indemnifying party all reasonable assistance, at such party’s expense. 24. Updates to Offerings Our Offerings and policies may be updated over the course of our relationship. From time to time, Splunk may update or modify an Offering and our policies, provided that: (a) the change and modification applies to all customers generally, and are not targeted to any particular customer; (b) no such change or modification will impose additional fees on you during the applicable Term or additional restrictions on your use of the Offering, (c) no such change will override or supersede the allocation of risk between us under these General Terms, including without limitation the terms under Sections 22 (Limitation of Liability) and 23 (Indemnity); (d) no such change or modification will materially reduce the security protections or overall functionality of the applicable Offering; and (e) any such change or modification will apply only prospectively, and will not apply to any breach or dispute that arose between the parties prior to the effective date of the change or modification. In the event of any conflict between these General Terms and the policies incorporated herein by reference, these General Terms will control. @@ -187,10 +187,10 @@ These General Terms will be governed by and construed in accordance with the law Neither the Uniform Computer Information Transactions Act nor the United Nations Convention for the International Sale of Goods will apply to these General Terms. 26. Use of Customer Name -You agree that we may add your name to our customer list and identify you as a Splunk customer on Splunk’s websites. Any further public use of your name in connection with Splunk marketing activities (e.g., press releases) will require your prior approval. +You agree that we may add your name to our customer list and identify you as a Splunk customer on Splunk’s websites. Any further public use of your name in connection with Splunk marketing activities (e.g., press releases) will require your prior approval. 27. Miscellaneous -(A) Different Terms. Splunk expressly rejects terms or conditions in any Customer purchase order or other similar document that are different from or additional to the terms and conditions set forth in these General Terms. Such different or additional terms and conditions will not become a part of the agreement between the parties notwithstanding any subsequent acknowledgement, invoice or license key that Splunk may issue. +(A) Different Terms. Splunk expressly rejects terms or conditions in any Customer purchase order or other similar document that are different from or additional to the terms and conditions set forth in these General Terms. Such different or additional terms and conditions will not become a part of the agreement between the parties notwithstanding any subsequent acknowledgement, invoice or license key that Splunk may issue. (B) No Future Functionality. You agree that your purchase of any Offering is not contingent on the delivery of any future functionality or features, or dependent on any oral or written statements made by Splunk regarding future functionality or features. @@ -273,7 +273,7 @@ General Terms Definitions Exhibit “Third-Party Content” means information, data, technology, or materials made available to you by any third party that you license and add to a Hosted Service or direct Splunk to install in connection with a Hosted Service. Third-Party Content includes but is not limited to, Third-Party Extensions, web-based or offline software applications, data service or content that are provided by third parties. -“Usage Data” means data generated from the usage, configuration, deployment, access, and performance of an Offering. For example, this may include such things as information about your operating environment, such as your network and systems architecture, or sessions, such as page loads and session views, duration, or interactions, errors, number of searches, source types and format (e.g., json, xml, csv), ingest volume, number of active and licensed users, or search concurrency. Usage Data does not include Customer Content. +“Usage Data” means data generated from the usage, configuration, deployment, access, and performance of an Offering. For example, this may include such things as information about your operating environment, such as your network and systems architecture, or sessions, such as page loads and session views, duration, or interactions, errors, number of searches, source types and format (e.g., json, xml, csv), ingest volume, number of active and licensed users, or search concurrency. Usage Data does not include Customer Content. Support Exhibit to Splunk General Terms @@ -313,7 +313,7 @@ Should we determine that an Offering has a defect, we will, at our sole option, Should you report a purported defect or error in an Offering, we may require you to provide us with the following information: (a) a general description of your operating environment; (b) a list of all hardware components, operating systems and networks; (c) a reproducible test case; and (d) any log files, trace and systems files. Your failure to provide this information may prevent us from identifying and fixing that purported defect. 10. Changes to Support Programs -You acknowledge that, subject to the Support Policy, and subject to any commitment we have during the Term, we have the right to discontinue the manufacture, development, sale or support of any Offering, at any time, in our sole discretion. We further reserve the right to alter Support Programs from time to time, using reasonable discretion, but in no event will such alterations, during the Term of any Order, result in diminished Support Services from the level of your applicable purchased Support Program. +You acknowledge that, subject to the Support Policy, and subject to any commitment we have during the Term, we have the right to discontinue the manufacture, development, sale or support of any Offering, at any time, in our sole discretion. We further reserve the right to alter Support Programs from time to time, using reasonable discretion, but in no event will such alterations, during the Term of any Order, result in diminished Support Services from the level of your applicable purchased Support Program. Configuration and Implementation Services Exhibit to Splunk General Terms @@ -328,11 +328,11 @@ We will perform the C&I Services for you that are set forth in the applicable St In each Statement of Work, we will designate our primary point of contact for you for all matters relating to the applicable C&I Services (which we may change from time to time upon notice). 2. Our Personnel -(A) Qualifications. The Personnel we assign to perform the C&I Services will be qualified, skilled, experienced and otherwise fit for the performance of the C&I Services. If you, in your reasonable judgement, determine that Personnel assigned to your project are unfit, we will in good faith discuss alternatives, and we will replace Personnel as reasonably necessary. You acknowledge that any replacement may cause delay in the performance of the C&I Services. +(A) Qualifications. The Personnel we assign to perform the C&I Services will be qualified, skilled, experienced and otherwise fit for the performance of the C&I Services. If you, in your reasonable judgement, determine that Personnel assigned to your project are unfit, we will in good faith discuss alternatives, and we will replace Personnel as reasonably necessary. You acknowledge that any replacement may cause delay in the performance of the C&I Services. (B) Personnel Conduct. Our Personnel are subject to our Splunk Code of Conduct and Ethics https://investors.splunk.com/code-business-conduct-and-ethics-1, which includes, without limitation, an obligation to comply with our policies on protecting customer information, prohibitions on illegal drugs and any impaired job performance, avoiding conflicts of interest, and acting ethically at all times. We also background check our employees, per the Section below. -(C) Use of Subcontractors. We reserve the right to use subcontractors in performance of the C&I Services, provided: (a) any subcontractor we use meets the requirements herein and conditions of these General Terms and the Statement of Work; (b) we will be responsible for the subcontractor’s compliance with the terms herein and the Statement of Work; and (c) upon your request or inquiry, we will identify any subcontractor that we are using, or plan to use, for C&I Services, and will cooperate in good faith to provide you with all relevant information regarding such subcontractors. +(C) Use of Subcontractors. We reserve the right to use subcontractors in performance of the C&I Services, provided: (a) any subcontractor we use meets the requirements herein and conditions of these General Terms and the Statement of Work; (b) we will be responsible for the subcontractor’s compliance with the terms herein and the Statement of Work; and (c) upon your request or inquiry, we will identify any subcontractor that we are using, or plan to use, for C&I Services, and will cooperate in good faith to provide you with all relevant information regarding such subcontractors. (D) No Employee Benefits. We acknowledge and agree that our Personnel are not eligible for or entitled to receive any compensation, benefits, or other incidents of employment that you make available to your employees. We are solely responsible for all employment related taxes, expenses, withholdings, and other similar statutory obligations arising out of the relationship between us and our Personnel and the performance of C&I Services by such Personnel. @@ -385,7 +385,7 @@ Configuration and Implementation Services Definitions Exhibit “C&I Services” means the services outlined in the Statement of Work. -“C&I Services Materials” means the materials and other deliverables that are provided to you as part of the C&I Services, and any materials, technology, know-how and other innovations of any kind that we or our Personnel may create or reduce to practice in the course of performing the C&I Services, including without limitation all improvements or modifications to our proprietary technology, and all Intellectual Property Rights therein. +“C&I Services Materials” means the materials and other deliverables that are provided to you as part of the C&I Services, and any materials, technology, know-how and other innovations of any kind that we or our Personnel may create or reduce to practice in the course of performing the C&I Services, including without limitation all improvements or modifications to our proprietary technology, and all Intellectual Property Rights therein. “Customer Materials” means the data, information, and materials you provide to us in connection with your use of the C&I Services. @@ -397,4 +397,4 @@ Configuration and Implementation Services Definitions Exhibit “Splunk Preexisting IP” means, with respect to any C&I Services Materials, all associated Splunk technology and all Intellectual Property Rights created or acquired: (a) prior to the date of the Statement of Work that includes such C&I Services Materials, or (b) after the date of such Statement of Work but independently of the C&I Services provided under such Statement of Work. -“Statement of Work” means the statements of work and/or any and all applicable Orders, that describe the specific services to be performed by Splunk, including any materials and deliverables to be delivered by Splunk. \ No newline at end of file +“Statement of Work” means the statements of work and/or any and all applicable Orders, that describe the specific services to be performed by Splunk, including any materials and deliverables to be delivered by Splunk. diff --git a/README-test.md b/README-test.md index 7cc8ec17..6f78e43b 100644 --- a/README-test.md +++ b/README-test.md @@ -152,4 +152,4 @@ Password is "secret" Install [splunk-add-on-for-modinput-test](https://github.com/splunk/splunk-add-on-for-modinput-test/releases/latest/) addon in splunk and set all variables in environment mentioned at [test_credentials.env](test_credentials.env) file with appropriate values encoded with base64 or add variables in pytest command mentioned in conftest file. ```bash pytest -vv --username= --password= --splunk-url= --remote -``` \ No newline at end of file +``` diff --git a/README.md b/README.md index 103e2bd9..a645fccf 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ pip install https://download.splunk.com/misc/appinspect/splunk-appinspect-latest ## Test -Using docker +Using docker ```bash pytest diff --git a/additional_packaging.py b/additional_packaging.py index 6480eefb..b75f1918 100644 --- a/additional_packaging.py +++ b/additional_packaging.py @@ -9,16 +9,17 @@ import shutil import logging from pathlib import Path -import requests -import tarfile +import requests +import tarfile from tempfile import NamedTemporaryFile -def additional_packaging(ta_name=None,outputdir="output"): + +def additional_packaging(ta_name=None, outputdir="output"): noshipdirs = ["aiohttp/.hash"] - libdir = os.path.join(outputdir,ta_name,"lib") + libdir = os.path.join(outputdir, ta_name, "lib") for nsd in noshipdirs: try: - o = os.path.join(libdir,nsd) + o = os.path.join(libdir, nsd) # Glob can return FileNotFoundError exception if no match logging.info(f" removing directory {o} from output must not ship") shutil.rmtree(o) @@ -26,18 +27,21 @@ def additional_packaging(ta_name=None,outputdir="output"): pass p = "geoipupdate_4.8.0_linux_amd64" - url = f'https://github.com/maxmind/geoipupdate/releases/download/v4.8.0/{p}.tar.gz' - + url = f"https://github.com/maxmind/geoipupdate/releases/download/v4.8.0/{p}.tar.gz" + response = requests.get(url, stream=True) if response.status_code == 200: f = NamedTemporaryFile(delete=False) f.write(response.raw.read()) f.close() - # open file - file = tarfile.open(f.name) - # extracting file - file.extractall('output/SecKit_SA_geolocation/bin/geoipupdate/') - file.close() - os.rename(f"output/SecKit_SA_geolocation/bin/geoipupdate/{p}","output/SecKit_SA_geolocation/bin/geoipupdate/linux_amd64") - os.unlink(f.name) \ No newline at end of file + # open file + file = tarfile.open(f.name) + # extracting file + file.extractall("output/SecKit_SA_geolocation/bin/geoipupdate/") + file.close() + os.rename( + f"output/SecKit_SA_geolocation/bin/geoipupdate/{p}", + "output/SecKit_SA_geolocation/bin/geoipupdate/linux_amd64", + ) + os.unlink(f.name) diff --git a/docker-compose-ci.yml b/docker-compose-ci.yml index a3748e26..5fdc1dd3 100644 --- a/docker-compose-ci.yml +++ b/docker-compose-ci.yml @@ -132,7 +132,7 @@ services: hostname: sauceconnect ports: - "4445" - + http_proxy: build: context: . diff --git a/docker-compose.yml b/docker-compose.yml index 283a83c9..1e3f73c0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -165,7 +165,7 @@ services: - SPLUNK_START_ARGS=--accept-license volumes: - results:/home/circleci/work - + chrome-grid: image: selenium/standalone-chrome-debug:91.0 shm_size: 2gb @@ -184,4 +184,4 @@ volumes: results: external: false backend_results: - external: false \ No newline at end of file + external: false diff --git a/globalConfig.json b/globalConfig.json index 4b13bed9..c708a606 100644 --- a/globalConfig.json +++ b/globalConfig.json @@ -365,4 +365,4 @@ ] } } -} \ No newline at end of file +} diff --git a/package/README.md b/package/README.md index f98cd5ac..c5ea785a 100644 --- a/package/README.md +++ b/package/README.md @@ -12,7 +12,7 @@ Supported databases: * ConnectionType (optional) -# Installation +# Installation * This application requires Splunk Enterprise or Splunk Enterprise Cloud >=8.0 * This application does not support search head clustering @@ -24,7 +24,7 @@ Supported databases: ## Macros -```text +```text | `seckit_iplocation(fieldname)` | `seckit_iplocation(fieldname,prefix)` ``` diff --git a/package/data/README b/package/data/README index 9d73a767..8b4f190c 100644 --- a/package/data/README +++ b/package/data/README @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2020 Splunk Inc (Ryan Faircloth) # # SPDX-License-Identifier: Apache-2.0 -Intentionally left blank \ No newline at end of file +Intentionally left blank diff --git a/package/default/app.conf b/package/default/app.conf index 37acfbfc..6f9b040c 100644 --- a/package/default/app.conf +++ b/package/default/app.conf @@ -26,4 +26,4 @@ version = 0.1.1 reload.seckit_sa_geolocation_account = simple reload.seckit_sa_geolocation_settings = simple reload.inputs.geoipupdate = simple -reload.passwords.credential:__REST_CREDENTIAL__#SecKit_SA_geolocation#configs/conf-seckit_sa_geolocation_account = simple \ No newline at end of file +reload.passwords.credential:__REST_CREDENTIAL__#SecKit_SA_geolocation#configs/conf-seckit_sa_geolocation_account = simple diff --git a/package/default/data/ui/nav/default.xml b/package/default/data/ui/nav/default.xml index c09506d1..3b22413c 100644 --- a/package/default/data/ui/nav/default.xml +++ b/package/default/data/ui/nav/default.xml @@ -3,4 +3,4 @@ - \ No newline at end of file + diff --git a/package/default/data/ui/views/health.xml b/package/default/data/ui/views/health.xml index 10873f26..2596d019 100644 --- a/package/default/data/ui/views/health.xml +++ b/package/default/data/ui/views/health.xml @@ -1,5 +1,5 @@ - + MMDB Status @@ -51,4 +51,4 @@ - \ No newline at end of file + diff --git a/package/default/inputs.conf b/package/default/inputs.conf index 58ede4ee..2b0f3689 100644 --- a/package/default/inputs.conf +++ b/package/default/inputs.conf @@ -17,4 +17,4 @@ sourcetype = geoipupdate interval = 10000 edition_ids = GeoLite2-Country GeoLite2-City global_account = main -disabled = 1 \ No newline at end of file +disabled = 1 diff --git a/package/default/props.conf b/package/default/props.conf index 9c954e83..9f5a6024 100644 --- a/package/default/props.conf +++ b/package/default/props.conf @@ -12,4 +12,4 @@ sourcetype = SecKit_SA_geolocation:log [SecKit_SA_geolocation:log] SHOULD_LINEMERGE = 0 -LINE_BREAKER = ([\r\n]+)\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d,\d\d\d \ No newline at end of file +LINE_BREAKER = ([\r\n]+)\d\d\d\d-\d\d-\d\d \d\d:\d\d:\d\d,\d\d\d diff --git a/package/default/restmap.conf b/package/default/restmap.conf index 3feeeb2b..c1cf4c67 100644 --- a/package/default/restmap.conf +++ b/package/default/restmap.conf @@ -45,4 +45,4 @@ restReplayStanza = restreplayshc #The following seting is required for SHC support however this is prelease as of 8.2 contact Splunk Support before enabling #[global] -#allowRestReplay = true \ No newline at end of file +#allowRestReplay = true diff --git a/package/default/transforms.conf b/package/default/transforms.conf index 02f8139b..a79ff92f 100644 --- a/package/default/transforms.conf +++ b/package/default/transforms.conf @@ -6,4 +6,3 @@ python.version = python3 external_cmd = SecKit_geo_lookup.py ip fields_list = ip,country,city,lat,long,connection_type,network,isp,isp_ip,isp_asn,isp_asn_organization,is_anonymous,is_anonymous_proxy,is_anonymous_vpn,is_hosting_provider,is_legitimate_proxy,is_public_proxy,is_satellite_provider,is_tor_exit_node - diff --git a/test_credentials.env b/test_credentials.env index 098a2630..2a400be7 100644 --- a/test_credentials.env +++ b/test_credentials.env @@ -1,4 +1,4 @@ # SPDX-FileCopyrightText: 2020 Splunk Inc (Ryan Faircloth) # # SPDX-License-Identifier: Apache-2.0 -# Add Addon specific Environment variables in this file. Variables must be set in CircleCI Environment." \ No newline at end of file +# Add Addon specific Environment variables in this file. Variables must be set in CircleCI Environment." diff --git a/tests/entrypoint.sh b/tests/entrypoint.sh index 2eeef6e9..9af3b255 100755 --- a/tests/entrypoint.sh +++ b/tests/entrypoint.sh @@ -31,18 +31,18 @@ cp -f .pytest.expect ${TEST_SET} echo "Executing Tests..." RERUN_COUNT=${RERUN_COUNT:-1} -if [ -z ${TEST_BROWSER} ] +if [ -z ${TEST_BROWSER} ] then # echo Test Args $@ ${TEST_DEBUG} --reportportal -o "rp_endpoint=${RP_ENDPOINT}" -o "rp_launch_attributes=${RP_LAUNCH_ATTRIBUTES}" \ # -o "rp_project=${RP_PROJECT}" -o "rp_launch=${RP_LAUNCH}" -o "rp_launch_description='${RP_LAUNCH_DESC}'" -o "rp_ignore_attributes='xfail' 'usefixture'" \ - # ${TEST_SET} - echo Test Args $@ ${TEST_DEBUG} - ${TEST_SET} - + # ${TEST_SET} + echo Test Args $@ ${TEST_DEBUG} + ${TEST_SET} + if [ "${IMAGE_TAG}" = "2.7.17" ] then pytest $@ ${TEST_DEBUG} \ - ${TEST_SET} + ${TEST_SET} test_exit_code=$? else # pytest $@ ${TEST_DEBUG} \ @@ -65,15 +65,15 @@ else # echo Test Args $@ ${TEST_DEBUG} --local --persist-browser --headless --reruns=${RERUN_COUNT} --browser=${TEST_BROWSER}\ # --reportportal -o "rp_endpoint=${RP_ENDPOINT}" -o "rp_launch_attributes=${RP_LAUNCH_ATTRIBUTES}" \ # -o "rp_project=${RP_PROJECT}" -o "rp_launch=${RP_LAUNCH}" -o "rp_launch_description='${RP_LAUNCH_DESC}'" -o "rp_ignore_attributes='xfail' 'usefixture'" \ - # ${TEST_SET} - + # ${TEST_SET} + # pytest $@ ${TEST_DEBUG} --local --persist-browser --headless --reruns=${RERUN_COUNT} --browser=${TEST_BROWSER} \ # --reportportal -o "rp_endpoint=${RP_ENDPOINT}" -o "rp_launch_attributes=${RP_LAUNCH_ATTRIBUTES}" \ # -o "rp_project=${RP_PROJECT}" -o "rp_launch=${RP_LAUNCH}" -o "rp_launch_description='${RP_LAUNCH_DESC}'" -o "rp_ignore_attributes='xfail' 'usefixture'" \ # ${TEST_SET} pytest $@ ${TEST_DEBUG} --local --persist-browser --headless --reruns=${RERUN_COUNT} --browser=${TEST_BROWSER} \ ${TEST_SET} - + test_exit_code=$? else echo "Check Saucelab connection..." @@ -91,4 +91,4 @@ else test_exit_code=$? fi fi -exit "$test_exit_code" \ No newline at end of file +exit "$test_exit_code" diff --git a/tests/knowledge/conftest.py b/tests/knowledge/conftest.py index 4667f630..64e14153 100644 --- a/tests/knowledge/conftest.py +++ b/tests/knowledge/conftest.py @@ -29,13 +29,13 @@ def docker_compose_files(request): def pytest_addoption(parser): group = parser.getgroup("seckit-geolocation") - - MAXMIND_ACCOUNT = os.getenv('MAXMIND_ACCOUNT') - MAXMIND_KEY = os.getenv('MAXMIND_KEY') + + MAXMIND_ACCOUNT = os.getenv("MAXMIND_ACCOUNT") + MAXMIND_KEY = os.getenv("MAXMIND_KEY") if MAXMIND_ACCOUNT is None: - MAXMIND_ACCOUNT = "1111" + MAXMIND_ACCOUNT = "1111" if MAXMIND_KEY is None: - MAXMIND_KEY = "invalid" + MAXMIND_KEY = "invalid" group.addoption( "--maxmind_id", action="store", @@ -43,7 +43,7 @@ def pytest_addoption(parser): default=MAXMIND_ACCOUNT, help="Numeric ID assigned by maxmind", ) - + group.addoption( "--maxmind_password", action="store", diff --git a/tests/knowledge/test_common.py b/tests/knowledge/test_common.py index 2f6cdd57..f4260488 100644 --- a/tests/knowledge/test_common.py +++ b/tests/knowledge/test_common.py @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 -def test_positive(record_property, splunk_search_util,seckit_input): +def test_positive(record_property, splunk_search_util, seckit_input): search = '| makeresults | eval src="8.8.8.8" | `seckit_iplocation(src,src)` | search src_country=US' @@ -13,8 +13,9 @@ def test_positive(record_property, splunk_search_util,seckit_input): assert result -def test_negative(record_property, splunk_search_util,seckit_input): - + +def test_negative(record_property, splunk_search_util, seckit_input): + search = '| makeresults | eval src="example.com" | `seckit_iplocation(src,src)` | search NOT src_lat=*' result = splunk_search_util.checkQueryCountIsGreaterThanZero( @@ -26,8 +27,6 @@ def test_negative(record_property, splunk_search_util,seckit_input): def test_update(record_property, splunk_search_util, seckit_input): - - search = 'search index=_internal source="*/SecKit_SA_geolocation_rh_updater.log" mmdb=GeoLite2-City.mmdb size=*' result = splunk_search_util.checkQueryCountIsGreaterThanZero(