From 34d39640c07d001d064c5cd2fa3918f578c1a59f Mon Sep 17 00:00:00 2001 From: Chase Engelbrecht Date: Thu, 18 Apr 2024 09:47:59 -0700 Subject: [PATCH] Bootstrap rule engine project Signed-off-by: Chase Engelbrecht --- rule-engine/CONTRIBUTING.md | 120 ++++++++++++++++++ rule-engine/DEVELOPER_GUIDE.md | 1 + rule-engine/README.md | 27 ++++ rule-engine/build.gradle | 27 ++++ .../org/opensearch/ruleengine/RuleEngine.java | 10 ++ .../opensearch/ruleengine/RuleEngineTest.java | 4 + 6 files changed, 189 insertions(+) create mode 100644 rule-engine/CONTRIBUTING.md create mode 100644 rule-engine/DEVELOPER_GUIDE.md create mode 100644 rule-engine/README.md create mode 100644 rule-engine/build.gradle create mode 100644 rule-engine/src/main/java/org/opensearch/ruleengine/RuleEngine.java create mode 100644 rule-engine/src/test/java/org/opensearch/ruleengine/RuleEngineTest.java diff --git a/rule-engine/CONTRIBUTING.md b/rule-engine/CONTRIBUTING.md new file mode 100644 index 0000000000..38972a8625 --- /dev/null +++ b/rule-engine/CONTRIBUTING.md @@ -0,0 +1,120 @@ +# Contributing Guidelines + +Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional +documentation, we greatly value feedback and contributions from our community. + +Please read through this document before submitting any issues or pull requests to ensure we have all the necessary +information to effectively respond to your bug report or contribution. + + +## Reporting Bugs/Feature Requests + +We welcome you to use the GitHub issue tracker to report bugs or suggest features. + +When filing an issue, please check existing open, or recently closed, issues to make sure somebody else hasn't already +reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: + +* A reproducible test case or series of steps +* The version of our code being used +* Any modifications you've made relevant to the bug +* Anything unusual about your environment or deployment + + +## Contributing via Pull Requests +Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: + +1. You are working against the latest source on the *main* branch. +2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. +3. You open an issue to discuss any significant work - we would hate for your time to be wasted. + +To send us a pull request, please: + +1. Fork the repository. +2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. +3. Ensure local tests pass. +4. Commit to your fork using clear commit messages. Please sign your commits - see the DCO section below. +5. Send us a pull request, answering any default questions in the pull request interface. +6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. + +GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and +[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). + + +## Finding contributions to work on +Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels (enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any 'help wanted' issues is a great place to start. + + +## Security issue notifications +If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. + + +## Developer Certificate of Origin (DCO) +We respect intellectual property rights of others and we want to make sure all incoming contributions are correctly attributed and licensed. A Developer Certificate of Origin (DCO) is a lightweight mechanism to do that. + +The DCO is a declaration attached to every contribution made by every developer. In the commit message of the contribution, the developer simply adds a `Signed-off-by` statement and thereby agrees to the DCO, which you can find below or at [DeveloperCertificate.org](http://developercertificate.org/). + +``` +Developer's Certificate of Origin 1.1 + +By making a contribution to this project, I certify that: + +(a) The contribution was created in whole or in part by me and I + have the right to submit it under the open source license + indicated in the file; or + +(b) The contribution is based upon previous work that, to the + best of my knowledge, is covered under an appropriate open + source license and I have the right under that license to + submit that work with modifications, whether created in whole + or in part by me, under the same open source license (unless + I am permitted to submit under a different license), as + Indicated in the file; or + +(c) The contribution was provided directly to me by some other + person who certified (a), (b) or (c) and I have not modified + it. + +(d) I understand and agree that this project and the contribution + are public and that a record of the contribution (including + all personal information I submit with it, including my + sign-off) is maintained indefinitely and may be redistributed + consistent with this project or the open source license(s) + involved. + ``` +We require that every contribution is signed with a Developer Certificate of Origin. Additionally, please use your real name. We do not accept anonymous contributors nor those utilizing pseudonyms. + +Each commit must include a DCO which looks like this + +``` +Signed-off-by: Jane Smith +``` +You may type this line on your own when writing your commit messages. However, if your user.name and user.email are set in your git configs, you can use `-s` or `--signoff` to add the `Signed-off-by` line to the end of the commit message. + +## License Headers + +New files in your code contributions should contain the following license header. +If you are modifying existing files with license headers, or including new files that already have license headers, do not remove or modify them without guidance. + +### Java, Gradle/Groovy + +``` +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + * + * The OpenSearch Contributors require contributions made to + * this file be licensed under the Apache-2.0 license or a + * compatible open source license. + * +*/ +``` + +### Shell, Python +``` +# Copyright OpenSearch Contributors +# SPDX-License-Identifier: Apache-2.0 +# +# The OpenSearch Contributors require contributions made to +# this file be licensed under the Apache-2.0 license or a +# compatible open source license. +``` diff --git a/rule-engine/DEVELOPER_GUIDE.md b/rule-engine/DEVELOPER_GUIDE.md new file mode 100644 index 0000000000..30404ce4c5 --- /dev/null +++ b/rule-engine/DEVELOPER_GUIDE.md @@ -0,0 +1 @@ +TODO \ No newline at end of file diff --git a/rule-engine/README.md b/rule-engine/README.md new file mode 100644 index 0000000000..e4161e998c --- /dev/null +++ b/rule-engine/README.md @@ -0,0 +1,27 @@ +# Rule Engine + +This project implements an engine to perform real-time security rule matching against a stream of incoming data. + +## Getting Started +TODO + +## Contribute +We invite developers from the larger OpenSearch community to contribute and help improve test coverage and give us feedback on where improvements can be made in design, code and documentation. You can look at [contribution guide](CONTRIBUTING.md) for more information on how to contribute. + +If you are looking to contribute code, or just to build from source, please see our [Developer Guide](DEVELOPER_GUIDE.md). + +## Code of Conduct + +This project has adopted an [Open Source Code of Conduct](CODE_OF_CONDUCT.md). + +## Security Issue Notifications + +If you discover a potential security issue in this project, please refer to the [security policy](https://github.com/opensearch-project/data-prepper/security/policy). + +## License + +This library is licensed under the [Apache 2.0 License](LICENSE) + +## Copyright + +Copyright OpenSearch Contributors. See [NOTICE](NOTICE) for details. \ No newline at end of file diff --git a/rule-engine/build.gradle b/rule-engine/build.gradle new file mode 100644 index 0000000000..f16af523a3 --- /dev/null +++ b/rule-engine/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' +} + +group 'org.opensearch.ruleengine' +version '0.0.1-SNAPSHOT' + +repositories { + mavenCentral() +} + +dependencies { + implementation platform('org.apache.logging.log4j:log4j-bom:2.22.1') + implementation 'org.apache.logging.log4j:log4j-core' + implementation 'org.apache.logging.log4j:log4j-slf4j2-impl' + + implementation 'org.projectlombok:lombok:1.18.26' + compileOnly 'org.projectlombok:lombok:1.18.26' + annotationProcessor 'org.projectlombok:lombok:1.18.26' + + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1' +} + +test { + useJUnitPlatform() +} \ No newline at end of file diff --git a/rule-engine/src/main/java/org/opensearch/ruleengine/RuleEngine.java b/rule-engine/src/main/java/org/opensearch/ruleengine/RuleEngine.java new file mode 100644 index 0000000000..7aa0dbd530 --- /dev/null +++ b/rule-engine/src/main/java/org/opensearch/ruleengine/RuleEngine.java @@ -0,0 +1,10 @@ +package org.opensearch.ruleengine; + +import lombok.extern.slf4j.Slf4j; + +@Slf4j +public class RuleEngine { + public RuleEngine() { + + } +} \ No newline at end of file diff --git a/rule-engine/src/test/java/org/opensearch/ruleengine/RuleEngineTest.java b/rule-engine/src/test/java/org/opensearch/ruleengine/RuleEngineTest.java new file mode 100644 index 0000000000..dc06cbdf3f --- /dev/null +++ b/rule-engine/src/test/java/org/opensearch/ruleengine/RuleEngineTest.java @@ -0,0 +1,4 @@ +package org.opensearch.ruleengine; + +public class RuleEngineTest { +}