Collects members of the fixed server roles and CONTROL SERVER every 15
minutes with login type, disabled state and SQL login password policy.
Windows groups are unfolded recursively through Active Directory on a
Windows agent (cached, 20 s timeout, failures shown with the reason).
Changes since the previous collection are logged, and who/when is read
from the default trace (event 108) when the agent has the optional
ALTER TRACE; authors that only reach the buffered trace later are filled
in at the next collection. The first collection is the baseline.
New rules SQLI-SEC-001 (new privilege, High for sysadmin/securityadmin/
CONTROL SERVER) and SQLI-SEC-002 (more sysadmins than the limit, default
3). Names are sensitive evidence and never in titles or subjects.
Web: /instanser/{navn}/rettigheder and /rettigheder with change log by
period, alert banner on the instance page and overview, and an audit
PDF (/rapporter/rettigheder.pdf) linked from Rapporter.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
23 lines
676 B
C#
23 lines
676 B
C#
using SQLInsight.Rules.Engine;
|
|
|
|
namespace SQLInsight.Rules.Tests;
|
|
|
|
public class RuleCatalogTests
|
|
{
|
|
[Fact]
|
|
public void Every_rule_has_a_unique_well_formed_id()
|
|
{
|
|
var rules = BuiltInRules.Create();
|
|
|
|
Assert.Equal(rules.Count, rules.Select(r => r.Id).Distinct(StringComparer.OrdinalIgnoreCase).Count());
|
|
Assert.All(rules, r => Assert.Matches("^SQLI-[A-Z]+-[0-9]{3}$", r.Id));
|
|
Assert.All(rules, r => Assert.False(string.IsNullOrWhiteSpace(r.Title)));
|
|
}
|
|
|
|
/// <summary>Keeps the rule count in the README honest.</summary>
|
|
[Fact]
|
|
public void Rule_count()
|
|
{
|
|
Assert.Equal(64, BuiltInRules.Create().Count);
|
|
}
|
|
}
|