Skip to content

Commit

Permalink
merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
dlin2028 committed May 1, 2024
2 parents 89deeb6 + f130915 commit b1c162e
Show file tree
Hide file tree
Showing 220 changed files with 8,342 additions and 3,240 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @cliu123 @cwperks @DarshitChanpura @davidlago @peternied @RyanL1997 @scrawfor99 @reta @willyborankin
* @cliu123 @cwperks @DarshitChanpura @peternied @RyanL1997 @scrawfor99 @reta @willyborankin
127 changes: 0 additions & 127 deletions .github/actions/start-opensearch-with-one-plugin/action.yml

This file was deleted.

31 changes: 10 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,21 @@ jobs:
uses: actions/checkout@v4

- name: Build and Test
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: |
${{ matrix.gradle_task }} -Dbuild.snapshot=false
- uses: alehechka/upload-tartifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: ${{ matrix.platform }}-JDK${{ matrix.jdk }}-${{ matrix.gradle_task }}-reports
path: |
./build/reports/
report-coverage:
needs:
- "test"
- "integration-tests"
needs: ["test", "integration-tests"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -82,23 +80,12 @@ jobs:
run: ls -R
working-directory: downloaded-artifacts

- name: Extract downloaded artifacts
run: |
for archive in ./*/artifact.tar; do
(cd "$(dirname "$archive")" && tar -xvf artifact.tar)
done
working-directory: downloaded-artifacts

- name: Display structure of downloaded files
run: ls -R
working-directory: downloaded-artifacts

- name: Upload Coverage with retry
uses: Wandalen/wretry.action@v1.3.0
uses: Wandalen/wretry.action@v3.4.0
with:
attempt_limit: 5
attempt_delay: 2000
action: codecov/codecov-action@v3
action: codecov/codecov-action@v4
with: |
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
Expand All @@ -125,7 +112,7 @@ jobs:
uses: actions/checkout@v4

- name: Build and Test
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: |
Expand Down Expand Up @@ -160,7 +147,7 @@ jobs:
uses: actions/checkout@v4

- name: Build and Test
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: |
Expand All @@ -178,7 +165,7 @@ jobs:
uses: actions/checkout@v4

- name: Build BWC tests
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: |
Expand Down Expand Up @@ -259,6 +246,8 @@ jobs:

- run: ./gradlew clean assemble -Dbuild.version_qualifier=${{ env.TEST_QUALIFIER }} && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION_ONLY_NUMBER }}-${{ env.TEST_QUALIFIER }}-SNAPSHOT.zip

- run: ./gradlew clean publishPluginZipPublicationToZipStagingRepository && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION }}.zip && test -s ./build/distributions/opensearch-security-${{ env.SECURITY_PLUGIN_VERSION }}.pom

- name: List files in the build directory if there was an error
run: ls -al ./build/distributions/
if: failure()
6 changes: 3 additions & 3 deletions .github/workflows/code-hygiene.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 17

- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: spotlessCheck
Expand All @@ -40,7 +40,7 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 11

- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: checkstyleMain checkstyleTest checkstyleIntegrationTest
Expand All @@ -56,7 +56,7 @@ jobs:
distribution: temurin # Temurin is a distribution of adoptium
java-version: 11

- uses: gradle/gradle-build-action@v2
- uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: spotbugsMain
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/plugin_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: actions/checkout@v4

- name: Assemble target plugin
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: assemble
Expand All @@ -39,31 +39,16 @@ jobs:
run: mv ./build/distributions/${{ env.PLUGIN_NAME }}-*.zip ${{ env.PLUGIN_NAME }}.zip
shell: bash

- name: Create Setup Script
if: ${{ runner.os == 'Linux' }}
run: |
cat > setup.sh <<'EOF'
chmod +x ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh
/bin/bash -c "yes | ./opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT/plugins/${{ env.PLUGIN_NAME }}/tools/install_demo_configuration.sh -t"
EOF
- name: Create Setup Script
if: ${{ runner.os == 'Windows' }}
run: |
New-Item .\setup.bat -type file
Set-Content .\setup.bat -Value "powershell.exe .\opensearch-${{ env.OPENSEARCH_VERSION }}-SNAPSHOT\plugins\${{ env.PLUGIN_NAME }}\tools\install_demo_configuration.bat -i -c -y -t"
Get-Content .\setup.bat
- name: Run Opensearch with A Single Plugin
uses: ./.github/actions/start-opensearch-with-one-plugin
uses: derek-ho/start-opensearch@v4
with:
opensearch-version: ${{ env.OPENSEARCH_VERSION }}
plugin-name: ${{ env.PLUGIN_NAME }}
setup-script-name: setup
plugins: "file:$(pwd)/${{ env.PLUGIN_NAME }}.zip"
security-enabled: true
admin-password: ${{ steps.random-password.outputs.generated_name }}

- name: Run sanity tests
uses: gradle/gradle-build-action@v2
uses: gradle/gradle-build-action@v3
with:
cache-disabled: true
arguments: integTestRemote -Dtests.rest.cluster=localhost:9200 -Dtests.cluster=localhost:9200 -Dtests.clustername="opensearch" -Dhttps=true -Duser=admin -Dpassword=${{ steps.random-password.outputs.generated_name }} -i
2 changes: 1 addition & 1 deletion .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Drafts the next Release notes as Pull Requests are merged into "main"
- uses: release-drafter/release-drafter@v5
- uses: release-drafter/release-drafter@v6
with:
config-name: release-notes-drafter-config.yml
env:
Expand Down
8 changes: 5 additions & 3 deletions DEVELOPER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,21 +86,23 @@ rm -rf config/
## ROOT

openssl genrsa -out root-ca-key.pem 2048
openssl req -new -x509 -sha256 -key root-ca-key.pem -subj "/DC=com/DC=example/O=Example Com Inc./OU=Example Com Inc. Root CA/CN=Example Com Inc. Root CA" -addext "basicConstraints = critical,CA:TRUE" -addext "keyUsage = critical, digitalSignature, keyCertSign, cRLSign" -addext "subjectKeyIdentifier = hash" -addext "authorityKeyIdentifier = keyid:always,issuer:always" -out root-ca.pem
openssl req -new -x509 -sha256 -days 3650 -key root-ca-key.pem -subj "/DC=com/DC=example/O=Example Com Inc./OU=Example Com Inc. Root CA/CN=Example Com Inc. Root CA" -addext "basicConstraints = critical,CA:TRUE" -addext "keyUsage = critical, digitalSignature, keyCertSign, cRLSign" -addext "subjectKeyIdentifier = hash" -addext "authorityKeyIdentifier = keyid:always,issuer:always" -out root-ca.pem


## NODE

openssl genrsa -out esnode-key-temp.pem 2048
openssl pkcs8 -inform PEM -outform PEM -in esnode-key-temp.pem -topk8 -nocrypt -v1 PBE-SHA1-3DES -out esnode-key.pem
openssl req -new -key esnode-key.pem -subj "/C=de/L=test/O=node/OU=node/CN=node-0.example.com" -out esnode.csr
openssl x509 -req -in esnode.csr -out esnode.pem -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -days 3650 -extfile <(printf "subjectAltName = RID:1.2.3.4.5.5, DNS:node-0.example.com, DNS:localhost, IP:::1, IP:127.0.0.1\nkeyUsage = digitalSignature, nonRepudiation, keyEncipherment\nextendedKeyUsage = serverAuth, clientAuth\nbasicConstraints = critical,CA:FALSE")
printf "subjectAltName = RID:1.2.3.4.5.5, DNS:node-0.example.com, DNS:localhost, IP:::1, IP:127.0.0.1\nkeyUsage = digitalSignature, nonRepudiation, keyEncipherment\nextendedKeyUsage = serverAuth, clientAuth\nbasicConstraints = critical,CA:FALSE" > esnode_ext.conf
openssl x509 -req -in esnode.csr -out esnode.pem -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -days 3650 -extfile esnode_ext.conf


## ADMIN

openssl req -new -newkey rsa:2048 -keyout kirk-key.pem -out kirk.csr -nodes -subj "/C=de/L=test/O=client/OU=client/CN=kirk"
openssl x509 -req -in kirk.csr -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -out kirk.pem -days 3650 -extfile <(printf "basicConstraints = critical,CA:FALSE\nkeyUsage = critical,digitalSignature,nonRepudiation,keyEncipherment\nextendedKeyUsage = critical,clientAuth\nauthorityKeyIdentifier = keyid,issuer:always\nsubjectKeyIdentifier = hash")
printf "basicConstraints = critical,CA:FALSE\nkeyUsage = critical,digitalSignature,nonRepudiation,keyEncipherment\nextendedKeyUsage = critical,clientAuth\nauthorityKeyIdentifier=keyid,issuer:always\nsubjectKeyIdentifier = hash" > kirk_ext.conf
openssl x509 -req -in kirk.csr -CA root-ca.pem -CAkey root-ca-key.pem -CAcreateserial -out kirk.pem -days 3650 -extfile kirk_ext.conf

## Remove root-ca-key.pem and other temp keys

Expand Down
7 changes: 6 additions & 1 deletion MAINTAINERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ This document contains a list of maintainers in this repo. See [opensearch-proje
| ---------------- | ----------------------------------------------------- | ----------- |
| Chang Liu | [cliu123](https://github.com/cliu123) | Amazon |
| Darshit Chanpura | [DarshitChanpura](https://github.com/DarshitChanpura) | Amazon |
| Dave Lago | [davidlago](https://github.com/davidlago) | Amazon |
| Peter Nied | [peternied](https://github.com/peternied) | Amazon |
| Craig Perkins | [cwperks](https://github.com/cwperks) | Amazon |
| Ryan Liang | [RyanL1997](https://github.com/RyanL1997) | Amazon |
| Stephen Crawford | [scrawfor99](https://github.com/scrawfor99) | Amazon |
| Andriy Redko | [reta](https://github.com/reta) | Aiven |
| Andrey Pleskach | [willyborankin](https://github.com/willyborankin) | Aiven |

## Emeritus

| Maintainer | GitHub ID | Affiliation |
| ------------- | --------------------------------------------------- | ----------- |
| Dave Lago | [davidlago](https://github.com/davidlago) | Contributor |

## Practices

### Updating Practices
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ plugins.security.system_indices.indices: [".plugins-ml-model", ".plugins-ml-task

The demo configuration can be modified in the following files to add a new system index to the demo configuration:

- https://github.com/opensearch-project/security/blob/main/tools/install_demo_configuration.sh
- https://github.com/opensearch-project/security/blob/main/tools/install_demo_configuration.bat
- https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/tools/democonfig/SecuritySettingsConfigurer.java


## Contributing
Expand Down
Loading

0 comments on commit b1c162e

Please sign in to comment.