Added xsd support
This commit is contained in:
321
software-rules-html-xml.xml
Normal file
321
software-rules-html-xml.xml
Normal file
@ -0,0 +1,321 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<SoftwareRules xmlns="http://example.com/software-rules"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://example.com/software-rules software-rules.xsd"
|
||||
version="2.0"
|
||||
lastUpdated="2025-01-15">
|
||||
|
||||
<Rule enabled="true">
|
||||
<ruleId>SEC-001</ruleId>
|
||||
<ruleName><strong>Password Complexity Check</strong></ruleName>
|
||||
<category>Security</category>
|
||||
<priority>Critical</priority>
|
||||
<status>Active</status>
|
||||
<description>
|
||||
Ensures passwords meet <strong>minimum complexity requirements</strong>:
|
||||
<ul>
|
||||
<li>At least <mark>12 characters</mark> in length</li>
|
||||
<li>Contains <em>uppercase</em> and <em>lowercase</em> letters</li>
|
||||
<li>Includes <u>numbers</u> and special characters</li>
|
||||
<li>No <s>dictionary words</s> allowed</li>
|
||||
</ul>
|
||||
<blockquote>A strong password is your first line of defense.</blockquote>
|
||||
</description>
|
||||
<condition><code>password.length >= 13 AND hasUpperCase AND hasLowerCase AND hasNumber AND hasSpecialChar</code></condition>
|
||||
<action>VALIDATE_PASSWORD</action>
|
||||
<errorMessage><strong>Error:</strong> Password must be <mark>at least 12 characters</mark> and contain uppercase, lowercase, numbers, and special characters</errorMessage>
|
||||
<appliesTo>UserRegistration</appliesTo>
|
||||
<appliesTo>PasswordReset</appliesTo>
|
||||
<appliesTo>AccountCreation</appliesTo>
|
||||
<createdBy>admin</createdBy>
|
||||
<createdDate>2024-01-15</createdDate>
|
||||
<modifiedBy>security_team</modifiedBy>
|
||||
<modifiedDate>2024-06-20</modifiedDate>
|
||||
<tags>authentication</tags>
|
||||
<tags>security</tags>
|
||||
<tags>compliance</tags>
|
||||
<riskLevel>5</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="true">
|
||||
<ruleId>PERF-002</ruleId>
|
||||
<ruleName><em>Query Timeout Limit</em></ruleName>
|
||||
<category>Performance</category>
|
||||
<priority>High</priority>
|
||||
<status>Active</status>
|
||||
<description>
|
||||
<h3>Performance Protection Rule</h3>
|
||||
<p>This rule prevents database queries from running longer than <strong>30 seconds</strong>.</p>
|
||||
<p>Key settings:</p>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Parameter</th>
|
||||
<th>Value</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Max Execution Time</td>
|
||||
<td><code>30000ms</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Action</td>
|
||||
<td>Terminate Query</td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr/>
|
||||
<small>Note: This limit can be overridden for batch operations.</small>
|
||||
</description>
|
||||
<condition><pre>if (query.executionTime > 30000) {
|
||||
return TERMINATE;
|
||||
}</pre></condition>
|
||||
<action>TERMINATE_QUERY</action>
|
||||
<errorMessage>Query execution exceeded maximum allowed time of <strong>30 seconds</strong></errorMessage>
|
||||
<appliesTo>DatabaseOperations</appliesTo>
|
||||
<appliesTo>ReportGeneration</appliesTo>
|
||||
<createdBy>dba_team</createdBy>
|
||||
<createdDate>2024-02-10</createdDate>
|
||||
<modifiedBy>performance_team</modifiedBy>
|
||||
<modifiedDate>2024-11-05</modifiedDate>
|
||||
<tags>database</tags>
|
||||
<tags>performance</tags>
|
||||
<riskLevel>3</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="false">
|
||||
<ruleId>VAL-003</ruleId>
|
||||
<ruleName>Email Format Validation</ruleName>
|
||||
<category>DataValidation</category>
|
||||
<priority>Medium</priority>
|
||||
<status>Testing</status>
|
||||
<description>
|
||||
Validates email addresses against <abbr title="Request for Comments">RFC</abbr> 5322 standard.
|
||||
<br/><br/>
|
||||
<strong>Valid format:</strong> <code>user@domain.com</code>
|
||||
<br/>
|
||||
<strong>Invalid formats:</strong>
|
||||
<ul>
|
||||
<li><del>user@</del></li>
|
||||
<li><del>@domain.com</del></li>
|
||||
<li><del>user domain.com</del></li>
|
||||
</ul>
|
||||
<details>
|
||||
<summary>Click for regex pattern</summary>
|
||||
<code>^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$</code>
|
||||
</details>
|
||||
</description>
|
||||
<condition>email.matches(RFC5322_REGEX)</condition>
|
||||
<action>VALIDATE_EMAIL</action>
|
||||
<errorMessage>Please enter a <u>valid email address</u></errorMessage>
|
||||
<appliesTo>UserProfile</appliesTo>
|
||||
<appliesTo>ContactForm</appliesTo>
|
||||
<createdBy>dev_team</createdBy>
|
||||
<createdDate>2024-03-22</createdDate>
|
||||
<tags>validation</tags>
|
||||
<tags>email</tags>
|
||||
<riskLevel>1</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="true">
|
||||
<ruleId>BUS-004</ruleId>
|
||||
<ruleName>Transaction Amount Limit</ruleName>
|
||||
<category>BusinessLogic</category>
|
||||
<priority>High</priority>
|
||||
<status>Active</status>
|
||||
<description>
|
||||
<h4>Transaction Limits by User Tier</h4>
|
||||
<ol>
|
||||
<li><strong>Basic Tier:</strong> Maximum $1,000 per transaction</li>
|
||||
<li><strong>Premium Tier:</strong> Maximum $10,000 per transaction</li>
|
||||
<li><strong>Enterprise Tier:</strong> Maximum $100,000 per transaction</li>
|
||||
</ol>
|
||||
<p>Transactions exceeding these limits will be <mark>automatically blocked</mark> and flagged for review.</p>
|
||||
<p>For limit increases, contact <a href="mailto:support@example.com">support@example.com</a></p>
|
||||
</description>
|
||||
<condition>transaction.amount > user.maxTransactionLimit</condition>
|
||||
<action>BLOCK_TRANSACTION</action>
|
||||
<errorMessage>Transaction amount of <strong>${amount}</strong> exceeds your account limit</errorMessage>
|
||||
<appliesTo>PaymentProcessing</appliesTo>
|
||||
<appliesTo>WireTransfers</appliesTo>
|
||||
<appliesTo>ACHTransfers</appliesTo>
|
||||
<createdBy>compliance_officer</createdBy>
|
||||
<createdDate>2024-01-05</createdDate>
|
||||
<modifiedBy>risk_management</modifiedBy>
|
||||
<modifiedDate>2024-09-15</modifiedDate>
|
||||
<tags>financial</tags>
|
||||
<tags>limits</tags>
|
||||
<tags>risk</tags>
|
||||
<riskLevel>4</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="true">
|
||||
<ruleId>COMP-005</ruleId>
|
||||
<ruleName><mark>GDPR Data Retention</mark></ruleName>
|
||||
<category>Compliance</category>
|
||||
<priority>Critical</priority>
|
||||
<status>Active</status>
|
||||
<description>
|
||||
<h3>⚠️ GDPR Compliance Rule</h3>
|
||||
<p>Personal data retention must comply with <strong>GDPR Article 5(1)(e)</strong>.</p>
|
||||
<blockquote>
|
||||
"Personal data shall be kept in a form which permits identification of data subjects for
|
||||
<u>no longer than is necessary</u> for the purposes for which the personal data are processed."
|
||||
</blockquote>
|
||||
<p><strong>Maximum retention periods:</strong></p>
|
||||
<dl>
|
||||
<dt>Customer Data</dt>
|
||||
<dd>2 years after account closure</dd>
|
||||
<dt>Employee Data</dt>
|
||||
<dd>7 years after employment ends</dd>
|
||||
<dt>Marketing Data</dt>
|
||||
<dd>1 year after last interaction</dd>
|
||||
</dl>
|
||||
<p><small>Reference: <cite>GDPR Regulation (EU) 2016/679</cite></small></p>
|
||||
</description>
|
||||
<condition>data.retentionPeriod > 730 AND data.type == 'PERSONAL'</condition>
|
||||
<action>FLAG_FOR_DELETION</action>
|
||||
<errorMessage><strong>⚠️ Warning:</strong> Personal data retention period exceeded <mark>GDPR requirements</mark></errorMessage>
|
||||
<appliesTo>DataManagement</appliesTo>
|
||||
<appliesTo>UserRecords</appliesTo>
|
||||
<createdBy>legal_team</createdBy>
|
||||
<createdDate>2024-05-25</createdDate>
|
||||
<tags>GDPR</tags>
|
||||
<tags>privacy</tags>
|
||||
<tags>compliance</tags>
|
||||
<riskLevel>5</riskLevel>
|
||||
<automationEnabled>false</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="true">
|
||||
<ruleId>ACC-006</ruleId>
|
||||
<ruleName>Multi-Factor Authentication Required</ruleName>
|
||||
<category>UserAccess</category>
|
||||
<priority>High</priority>
|
||||
<status>Active</status>
|
||||
<description>
|
||||
<p>MFA is <strong>mandatory</strong> for privileged accounts.</p>
|
||||
<p>Press <kbd>Ctrl</kbd> + <kbd>Alt</kbd> + <kbd>M</kbd> to open MFA settings.</p>
|
||||
<p>Supported methods:</p>
|
||||
<ul>
|
||||
<li>📱 SMS verification</li>
|
||||
<li>📧 Email OTP</li>
|
||||
<li>🔐 Authenticator app</li>
|
||||
<li>🔑 Hardware token</li>
|
||||
</ul>
|
||||
<p>Formula: <var>security_score</var> = <var>password_strength</var> × <var>mfa_enabled</var><sup>2</sup></p>
|
||||
</description>
|
||||
<condition>user.role IN ('admin', 'finance', 'hr') AND !session.hasMFA</condition>
|
||||
<action>REQUIRE_MFA</action>
|
||||
<errorMessage><strong>🔒 Security Alert:</strong> Multi-factor authentication is <u>required</u> for this operation</errorMessage>
|
||||
<appliesTo>AdminPanel</appliesTo>
|
||||
<appliesTo>FinancialReports</appliesTo>
|
||||
<appliesTo>EmployeeData</appliesTo>
|
||||
<createdBy>security_team</createdBy>
|
||||
<createdDate>2024-04-10</createdDate>
|
||||
<modifiedBy>ciso</modifiedBy>
|
||||
<modifiedDate>2024-12-01</modifiedDate>
|
||||
<tags>security</tags>
|
||||
<tags>authentication</tags>
|
||||
<tags>MFA</tags>
|
||||
<riskLevel>4</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="true">
|
||||
<ruleId>SEC-007</ruleId>
|
||||
<ruleName><strong style="color: red;">SQL Injection Prevention</strong></ruleName>
|
||||
<category>Security</category>
|
||||
<priority>Critical</priority>
|
||||
<status>Active</status>
|
||||
<description>
|
||||
<h2>🛡️ Critical Security Rule</h2>
|
||||
<p>This rule detects and blocks potential SQL injection attempts.</p>
|
||||
<p><strong>Common injection patterns blocked:</strong></p>
|
||||
<pre>
|
||||
SELECT * FROM users WHERE id = '1' OR '1'='1'
|
||||
DROP TABLE users; --
|
||||
UNION SELECT * FROM passwords
|
||||
</pre>
|
||||
<p>Protection includes:</p>
|
||||
<ol>
|
||||
<li><strong>Input validation</strong> - All inputs sanitized</li>
|
||||
<li><strong>Parameterized queries</strong> - No direct concatenation</li>
|
||||
<li><strong>Escape sequences</strong> - Special characters handled</li>
|
||||
</ol>
|
||||
<figure>
|
||||
<img src="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Crect width='100' height='100' fill='%23ff0000'/%3E%3Ctext x='50' y='50' text-anchor='middle' fill='white' font-size='40'%3E⚠️%3C/text%3E%3C/svg%3E" alt="Warning"/>
|
||||
<figcaption>High Risk Alert</figcaption>
|
||||
</figure>
|
||||
<p><ins>Updated: Now includes NoSQL injection prevention</ins></p>
|
||||
</description>
|
||||
<condition><samp>if (detectSQLInjection(input)) { return BLOCK; }</samp></condition>
|
||||
<action>BLOCK_REQUEST</action>
|
||||
<errorMessage><span style="color: red; font-weight: bold;">⛔ SECURITY VIOLATION:</span> Potentially malicious input detected and blocked</errorMessage>
|
||||
<appliesTo>APIEndpoints</appliesTo>
|
||||
<appliesTo>SearchFunctions</appliesTo>
|
||||
<createdBy>security_team</createdBy>
|
||||
<createdDate>2024-01-20</createdDate>
|
||||
<tags>security</tags>
|
||||
<tags>injection</tags>
|
||||
<tags>SQL</tags>
|
||||
<riskLevel>5</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
<Rule enabled="false">
|
||||
<ruleId>PERF-008</ruleId>
|
||||
<ruleName>API Rate Limiting</ruleName>
|
||||
<category>Performance</category>
|
||||
<priority>Medium</priority>
|
||||
<status>Deprecated</status>
|
||||
<description>
|
||||
<p><s>This rule has been deprecated</s> in favor of the new adaptive rate limiting system.</p>
|
||||
<p>Previous limits were:</p>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Tier</th>
|
||||
<th>Requests/Hour</th>
|
||||
<th>Burst Limit</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Free</td>
|
||||
<td>100</td>
|
||||
<td>10</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Pro</td>
|
||||
<td>1,000</td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Enterprise</td>
|
||||
<td>10,000</td>
|
||||
<td>500</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<address>
|
||||
For questions, contact:<br/>
|
||||
API Team<br/>
|
||||
api-support@example.com
|
||||
</address>
|
||||
<time datetime="2024-12-31">Deprecated on December 31, 2024</time>
|
||||
</description>
|
||||
<condition>user.apiCalls > 1000 AND timeWindow == '1hour'</condition>
|
||||
<action>THROTTLE_REQUESTS</action>
|
||||
<errorMessage>API rate limit exceeded. Please try again later</errorMessage>
|
||||
<appliesTo>PublicAPI</appliesTo>
|
||||
<createdBy>api_team</createdBy>
|
||||
<createdDate>2024-02-28</createdDate>
|
||||
<tags>API</tags>
|
||||
<tags>rate-limiting</tags>
|
||||
<riskLevel>2</riskLevel>
|
||||
<automationEnabled>true</automationEnabled>
|
||||
</Rule>
|
||||
|
||||
</SoftwareRules>
|
||||
Reference in New Issue
Block a user