{"id":19285581,"url":"https://github.com/marcolivierbouch/solr-password-generator","last_synced_at":"2025-10-07T03:55:04.078Z","repository":{"id":198598091,"uuid":"701127945","full_name":"marcolivierbouch/solr-password-generator","owner":"marcolivierbouch","description":"Solr security.json password generator. Generate password for the file security.json using a script.","archived":false,"fork":false,"pushed_at":"2023-10-12T18:59:21.000Z","size":16,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T04:19:24.541Z","etag":null,"topics":["ci","cicd","password-rotation","script","security","security-automation","sitecore","solr","solr-configs"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/marcolivierbouch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"security.json","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-10-06T01:30:41.000Z","updated_at":"2024-03-25T12:04:22.000Z","dependencies_parsed_at":"2025-04-22T04:02:28.197Z","dependency_job_id":"d22d5dae-081d-4c05-a0d1-c4a7b08f5288","html_url":"https://github.com/marcolivierbouch/solr-password-generator","commit_stats":null,"previous_names":["marcolivierbouch/solr-password-generator"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/marcolivierbouch/solr-password-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcolivierbouch%2Fsolr-password-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcolivierbouch%2Fsolr-password-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcolivierbouch%2Fsolr-password-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcolivierbouch%2Fsolr-password-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marcolivierbouch","download_url":"https://codeload.github.com/marcolivierbouch/solr-password-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marcolivierbouch%2Fsolr-password-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717449,"owners_count":26033542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ci","cicd","password-rotation","script","security","security-automation","sitecore","solr","solr-configs"],"created_at":"2024-11-09T21:45:58.172Z","updated_at":"2025-10-07T03:55:04.051Z","avatar_url":"https://github.com/marcolivierbouch.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Solr security.json Configuration Password Generator\nThis bash script simplifies the process of generating secure passwords for your Solr instance's security.json file. Ensure the robustness of your Solr security by effortlessly creating strong passwords with the help of this tool.\n\nWith this script you can generate new passwort without using the API.\n\nWe all know that generating a password for Solr when deploying Sitecore it is the first step for a better security.\n\nSee more information here about Solr Basic Authentication Plugin: https://solr.apache.org/guide/7_1/basic-authentication-plugin.html \n\nRef: https://gist.github.com/rmalchow/51f5b23c2f59c687b001bfcdbf4bad5c\n\n## Requirements\nBefore diving in, make sure to install pwgen using the following command:\n\n```bash\napt install pwgen\n```\n\n## Usage Example\nGenerate a password tailored for your Solr setup using the script, as illustrated below:\n\n```bash\nsecret=$(./generate_config.sh SolrRocks)\nsed -i \"s/%REPLACE%/$secret/\" ./security.json\n```\n\nThis will generate a security.json like in the example here https://solr.apache.org/guide/7_1/basic-authentication-plugin.html but of course the salt will change. \n```json\n{\n\"authentication\":{ \n   \"blockUnknown\": true, \n   \"class\":\"solr.BasicAuthPlugin\",\n   \"credentials\":{\"solr\":\"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c=\"} \n},\n\"authorization\":{\n   \"class\":\"solr.RuleBasedAuthorizationPlugin\",\n   \"permissions\":[{\"name\":\"security-edit\",\n      \"role\":\"admin\"}], \n   \"user-role\":{\"solr\":\"admin\"} \n}}\n```\n\n\n## Automatic password rotation\nAssuming you have your [Solr instance set up in Azure app service](https://www.getfishtank.com/blog/sitecore-solr-docker-app-service-on-azure), Azure Key Vault configured, and the Solr Password Generator script ready, here's a simplified workflow on how you could implement password rotation in your CI:\n\n1. Retrieve Secret from Azure Key Vault:\nModify your script to fetch the secret from Azure Key Vault using Azure CLI or another appropriate method. Here's an example snippet:\n\n```bash\n# Fetch secret from Azure Key Vault\nsecret=$(az keyvault secret show --vault-name YourKeyVaultName --name YourSecretName --query value -o tsv)\n```\nReplace YourKeyVaultName and YourSecretName with your actual Key Vault name and secret name.\n\n2. Update Solr security.json:\nAfter obtaining the secret, use it to generate the configuration and update the Solr security.json file. This step remains the same as in your original script:\n\n```bash\npassword=$(./generate_config.sh \"$secret\")\nsed -i \"s~%REPLACE%~$password~\" ./security.json\n```\n\n3. Deploy Updated Configuration to Solr:\nUpload the updated security.json to your Solr instance. This step could involve copying the file to the appropriate directory or sending an HTTP request to Solr to update its configuration.\n\n```bash\n# Copy the updated security.json to Solr configuration directory\naz webapp deploy --resource-group YOUR_RG --name APP_SERVICE_NAME --src-path ./security.json --type=static --target-path=\"{PUT_GOOD_PATH_HERE}/security.json\"\n```\n\nIntegrate these steps into your deployment pipeline or automation script. For instance, if you're using a CI/CD tool like Azure DevOps or Jenkins, include the script in your deployment process.\n\nEnsure that the secrets, such as Azure Key Vault credentials, are securely stored and accessed during the deployment process.\n\nBy following these steps, you establish a secure and automated password rotation process for Solr, leveraging Azure Key Vault for secret management.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcolivierbouch%2Fsolr-password-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcolivierbouch%2Fsolr-password-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcolivierbouch%2Fsolr-password-generator/lists"}