[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6ACQ49SQGNDN476GXJT6ERS":3,"skill-same:01M6ACQ49SQGNDN476GXJT6ERS":60},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":17,"categories":18,"keywords":29,"publishedAt":33,"linkOnly":34,"markdownContent":35,"markdownBody":35,"frontMatter":36,"refName":37,"commitSha":38,"skillDirectory":39,"forksCount":40,"repositoryHtmlUrl":41,"repositoryHomepageUrl":42,"ownerHtmlUrl":43,"ownerBlogUrl":44,"ownerDescription":7,"updatedAt":45,"install":46,"resources":59},"01M6ACQ49SQGNDN476GXJT6ERS","manage-security-deployment","OFBiz 安全部署管理",null,"","apache\u002Fofbiz-plugins","apache","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F47359?v=4","01M6AC83E6K4FDKK7HZ8WNMQKE","The Apache Software Foundation","01M6ACMJJ1Q4WYATY4GXZ2FAVD",178,"Apache-2.0","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-security-deployment\u002FSKILL.md",[19,24],{"categoryNo":20,"categoryName":21,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":25,"categoryName":26,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BXREJNJE7HY785DVVKG7CW","Web应用安全防护","SCENARIO","使用场景",[30,31,32],"security","deployment","manage security deployment","2026-11-10 10:12:30",false,"\u003C!--\nLicensed to the Apache Software Foundation (ASF) under one\nor more contributor license agreements.  See the NOTICE file\ndistributed with this work for additional information\nregarding copyright ownership.  The ASF licenses this file\nto you under the Apache License, Version 2.0 (the\n\"License\"); you may not use this file except in compliance\nwith the License.  You may obtain a copy of the License at\n\nhttp:\u002F\u002Fwww.apache.org\u002Flicenses\u002FLICENSE-2.0\n\nUnless required by applicable law or agreed to in writing,\nsoftware distributed under the License is distributed on an\n\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, either express or implied.  See the License for the\nspecific language governing permissions and limitations\nunder the License.\n-->\n\n---\nname: manage-security-deployment\ndescription: |\n  Harden and secure an OFBiz deployment at the infrastructure limit. Manage global security properties, password policies, HTTP boundaries, and file upload protection. Use when:\n  - Moving an OFBiz instance to a production environment.\n  - Configuring global password strength and expiration policies.\n  - Minimizing exposed webapp surface area.\n  - Securing Tomcat server settings against host header injection, CSRF, or Webshells.\n---\n\n## Goal\nSecure an OFBiz system for production deployment by hardening infrastructure configurations, minimizing surface area, enforcing strict system-wide password policies, and establishing network-level defenses.\n\n## Triggers\n**ALWAYS** read this skill when:\n- **Going Live**: Transitioning an OFBiz instance from development to production.\n- **Configuring Security Properties**: Modifying any value in `framework\u002Fsecurity\u002Fconfig\u002Fsecurity.properties`.\n- **System Hardening**: Restricting endpoint exposure, protecting against webshells, modifying password requirements, or configuring CSP headers.\n- **Remediating Demo Data**: Disabling default accounts or cleaning up development seed data.\n\n> [!TIP]\n> If you are looking on how to securely write Java\u002FGroovy code, implement Service-Level authentication, or enforce business data scoping boundaries, see the [manage-security-advanced](..\u002Fmanage-security-advanced\u002FSKILL.md) skill instead.\n\n## Core Principles\n\n### 1. Trust Model & Architectural Assumptions\nBefore configuring OFBiz security, developers and sysadmins must understand its foundational trust boundaries:\n- **Administrative Trust Boundary**: OFBiz does **not** sandbox administrators from the host OS JVM. Any user with administrative rights is considered fully trusted.\n- **Plugin & Extension Trust**: All custom extensions and distributed plugins (e.g., the `ecommerce` plugin) are assumed fully trusted. They execute with the same privileges as the core framework.\n- **OS Privilege Boundary**: Because OFBiz lacks internal privilege separation, the application must be run by a dedicated, heavily restricted OS user account.\n- **Log File Protection**: OFBiz does not automatically redact sensitive data. Deployers must secure log files independently to prevent information disclosure.\n\n### 2. Remediating Demo Data\nNever use credentials contained in demo data for production. If demo data was loaded (e.g., via `gradlew loadAll`), you **must** immediately change the passwords or disable the accounts for `admin`, `flexadmin`, `demoadmin`, `ltdadmin`, and `supplier`.\n\n### 3. The Account Lockout Quirk (`login.disable.minutes`)\nWhen disabling an account in the Party Manager UI, **leave the \"disabled date\" blank**. If you supply a disabled date, the account will automatically be re-enabled after 30 minutes! This auto-reactivation behavior is controlled by the `login.disable.minutes` property in `security.properties`.\n\n### 4. Minimizing Webapp Surface Area\nOFBiz ships with numerous webapps. You must dramatically reduce this surface area in production to save resources and deny attack vectors:\n- **Global Level**: Comment out entire component groups in `framework\u002Fbase\u002Fconfig\u002Fcomponent-load.xml`.\n- **Component Level**: If a component must load for its backend logic but its web UI should be hidden, add `app-bar-display=\"false\"` to the `\u003Cwebapp>` tag in the component's `ofbiz-component.xml`.\n\n### 5. Hardening File Uploads (Webshell Defense)\nBecause OFBiz allows dynamic content upload, it is a target for Webshell injection. \n- Restrict upload directories (e.g., `themes\u002Fcommon-theme\u002Fwebapp\u002Fimages\u002Fproducts`) to trusted users.\n- Make upload directories **non-executable** at the OS level.\n- Actively manage `deniedFileExtensions` and `deniedWebShellTokens` inside `security.properties` to ensure modern exploits (e.g., `.phar`, `.phtml`, explicit execution commands) are instantly blocked globally.\n\n### 6. Network Defense & Host Headers\nIf OFBiz is exposed beyond localhost, validate incoming request locations to prevent Host Header Injection caching attacks, and configure modern cookie rules.\n- Maintain a strict `host-headers-allowed` blocklist in `security.properties`.\n- Explicitly define `Content-Security-Policy` and `SameSiteCookieAttribute`.\n\n---\n\n## Procedure: Core Property Overrides\n\nAll critical infrastructure rules are managed in `framework\u002Fsecurity\u002Fconfig\u002Fsecurity.properties`.\n\n### 1. Enforcing Strong Password Policies & Hashing\nChange defaults to enforce enterprise-grade passwords and transition to slow, iterated hashes to defeat offline rainbow table attacks.\n\n```properties\n# Force strong passwords utilizing Lookahead Assertions\nsecurity.login.password.pattern.enable=true\nsecurity.login.password.pattern=^.*(?=.{8,})(?=.*[a-z])(?=.*[A-Z])(?=.*[\\d]).*$\n\n# ENFORCE MODERN HASHING (Prevents offline cracking)\n# Type should be SHA-256, SHA-512, or PBKDF2\npassword.encrypt.hash.type=SHA-256\n# Iterations must be high (100,000+) to slow down attackers\npassword.encrypt.hash.iterations=600000\n\n# Extend lockout penalties for brute forcing\nmax.failed.logins=3\nlogin.disable.minutes=30\n\n# Enable automated expirations\nuser.auto.change.password.enable=true\nuser.change.password.days=90\n```\n\n### 2. Locking Down Tomcat CSRF, Host Headers, and HSTS\nExplicitly configure the HTTP layer to prevent token leakage, domain spoofing, and man-in-the-middle attacks.\n\n```properties\n# Whitelist expected hostnames (prevents proxy spoofing \u002F cache poisoning)\nhost-headers-allowed=localhost,127.0.0.1,store.yourcompany.com,internal.yourcompany.com\n\n# STRICT CSRF DEFENSE\n# Use Token-based defense for all mutating requests\ncsrf.defence.strategy=org.apache.ofbiz.webapp.control.ControlFilter$TokenDefenseStrategy\ncsrf.token.generator=org.apache.ofbiz.webapp.control.ControlFilter$DefaultTokenGenerator\n\n# TRANSPORT SECURITY (HSTS)\nsecurity.hsts.enable=true\nsecurity.hsts.maxAge=31536000\nsecurity.hsts.includeSubDomains=true\n\n# SECURITY HEADERS (Content protection)\nsecurity.x-frame-options=SAMEORIGIN\nsecurity.x-content-type-options=nosniff\nsecurity.x-xss-protection=1; mode=block\n\n# Explicit modern cookie strategies\nSameSiteCookieAttribute=Strict\nuseContent-Security-Policy=true\nContent-Security-Policy=Content-Security-Policy\nPolicyDirectives=default-src 'self'\n```\n\n### 3. Disabling Default Features\nDisable unnecessary diagnostic features that could leak system context to attackers.\n\n```properties\n# Disable cross-webapp token leaking if you do not use SSO\nsecurity.login.externalLoginKey.enabled=false\n\n# Prevent accidental or malicious admin impersonation\nsecurity.disable.impersonation=true\n```\n\n---\n\n## Examples\n\n### Safely Shutting Down Webapps (`component-load.xml`)\nIf you only need the eCommerce app, do not load the massive manufacturing and accounting dashboards into the servlet environment.\n\n```xml\n\u003C?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\u003C!-- framework\u002Fbase\u002Fconfig\u002Fcomponent-load.xml -->\n\u003Ccomponent-loader xmlns:xsi=\"http:\u002F\u002Fwww.w3.org\u002F2001\u002FXMLSchema-instance\" ...>\n    \u003C!-- Core is required -->\n    \u003Cload-component component-location=\"framework\"\u002F>\n    \n    \u003C!-- Disable entire backend branches in production if not needed -->\n    \u003C!-- \u003Cload-component component-location=\"applications\"\u002F> -->\n    \u003C!-- \u003Cload-component component-location=\"specialpurpose\"\u002F> -->\n\u003C\u002Fcomponent-loader>\n```\n\n### Hiding Webapps from the UI (`ofbiz-component.xml`)\nIf you need the component logically but want to hide it from the App Bar UI.\n\n```xml\n\u003C!-- Example: Accounting must be loaded for eCommerce, but end-users shouldn't see an \"Accounting\" tab -->\n\u003Cwebapp name=\"accounting\"\n    title=\"Accounting\"\n    server=\"default-server\"\n    location=\"webapp\u002Faccounting\"\n    app-bar-display=\"false\" \n    mount-point=\"\u002Faccounting\"\u002F>\n```\n\n---\n\n## Anti-Patterns\n\n- **❌ Deploying Demo Users to Production**: Releasing an instance where `admin:ofbiz` can log in to the internet-facing server. If demo data *must* be utilized, every single default account's password must be scrambled or universally deleted.\n- **❌ Setting a Disabled Date for Immediate Lockout**: Filling out the \"disabled date\" string in the Party Manager expecting it to permanently lock the user out. The `login.disable.minutes` auto-recovery daemon will immediately see a timestamp, do the math, and reactivate the rogue account shortly after.\n- **❌ Permissive Host Headers**: Leaving `host-headers-allowed` set only to `localhost` when the app is placed behind a proxy\u002Fload-balancer. The server will begin rejecting legitimate proxied traffic, or if left entirely undefined, accept malicious host headers that poison the cache.\n- **❌ Leaving Impersonation Enabled**: Allowing `security.disable.impersonation=false` on a live environment where a compromised QA or limited Admin account can suddenly `impersonate` the SuperAdmin without needing their password.\n- **❌ Application Level Logic Flaws**: Assuming configuring `security.properties` perfectly protects your system. A single missing `auth=\"true\"` in a controller or unprotected mutating service exposes your database regardless of Tomcat hardening. See [manage-security-advanced](..\u002Fmanage-security-advanced\u002FSKILL.md).\n",{},"trunk","6c6c27710443de03e9247605d33a2e2f5bc3d1e2","ai-agent-skills\u002Fmanage-security-deployment",222,"https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins","https:\u002F\u002Fofbiz.apache.org\u002F","https:\u002F\u002Fgithub.com\u002Fapache","https:\u002F\u002Fwww.apache.org\u002F","2026-11-12 22:04:06",{"source":9,"skillName":5,"commands":47,"prompt":57,"zipAvailable":58},[48,51,54],{"tool":49,"command":50},"npx","npx skills add apache\u002Fofbiz-plugins --skill manage-security-deployment",{"tool":52,"command":53},"bunx","bunx skills add apache\u002Fofbiz-plugins --skill manage-security-deployment",{"tool":55,"command":56},"pnpm","pnpm dlx skills add apache\u002Fofbiz-plugins --skill manage-security-deployment","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-security-deployment\u002FSKILL.md",true,[],[61,75,87,101,115,129],{"skillNo":62,"name":63,"nameZh":64,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":65,"categories":66,"keywords":73,"publishedAt":33},"01M6ACQSN90YKJZ92MQ52D9R8H","prepush-readiness","推送前就绪检查","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fprepush-readiness\u002FSKILL.md",[67,70],{"categoryNo":68,"categoryName":69,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":71,"categoryName":72,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BR5V701HCN066VEP7H4812","代码仓库协作管理",[74],"prepush readiness",{"skillNo":76,"name":77,"nameZh":78,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":79,"categories":80,"keywords":85,"publishedAt":33},"01M6ACQPR1WRA751V4DXVC3AHF","manage-webapps","Web 应用管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-webapps\u002FSKILL.md",[81,82],{"categoryNo":68,"categoryName":69,"taxonomyType":22,"taxonomyTypeDesc":23},{"categoryNo":83,"categoryName":84,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BWKS60NTYJHFE9FQSXGDKS","低代码应用开发",[86],"manage webapps",{"skillNo":88,"name":89,"nameZh":90,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":91,"categories":92,"keywords":99,"publishedAt":33},"01M6ACQMCX8Z7NY2CE08NCV6ND","manage-themes","主题管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-themes\u002FSKILL.md",[93,96],{"categoryNo":94,"categoryName":95,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TQMKHSMFVQHR2KYAEVN","界面设计师",{"categoryNo":97,"categoryName":98,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[100],"manage themes",{"skillNo":102,"name":103,"nameZh":104,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":105,"categories":106,"keywords":113,"publishedAt":33},"01M6ACQHYN20AFWF6TKK4RGQ8A","manage-tests","测试管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-tests\u002FSKILL.md",[107,110],{"categoryNo":108,"categoryName":109,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":111,"categoryName":112,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[114],"manage tests",{"skillNo":116,"name":117,"nameZh":118,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":119,"categories":120,"keywords":127,"publishedAt":33},"01M6ACQFRMW7R45YD3HRAXPGWF","manage-templates","模板管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-templates\u002FSKILL.md",[121,124],{"categoryNo":122,"categoryName":123,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BQ6TK1MPB82068236GSXDE","文档处理",{"categoryNo":125,"categoryName":126,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8BQ6TPH3VQWKQZXV7EPF8VZ","办公行政人员",[128],"manage templates",{"skillNo":130,"name":131,"nameZh":132,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":7,"sourceHtmlUrl":133,"categories":134,"keywords":141,"publishedAt":33},"01M6ACQCSSDZQMD8VX2K3WRR93","manage-strategies","策略管理","https:\u002F\u002Fgithub.com\u002Fapache\u002Fofbiz-plugins\u002Fblob\u002Ftrunk\u002Fai-agent-skills\u002Fmanage-strategies\u002FSKILL.md",[135,138],{"categoryNo":136,"categoryName":137,"taxonomyType":27,"taxonomyTypeDesc":28},"01M8BTXF8K9DFQC4T4TXVH0NMZ","策略与托管设置管理",{"categoryNo":139,"categoryName":140,"taxonomyType":22,"taxonomyTypeDesc":23},"01M8C6RQ852C9AEJFCBGG1YA7S","IT 管理员",[142],"manage strategies"]