docs consolidation and others
This commit is contained in:
@@ -45,7 +45,7 @@ public class IacBoundaryExtractorTests
|
||||
[InlineData("kong", false)]
|
||||
public void CanHandle_WithSource_ReturnsExpected(string source, bool expected)
|
||||
{
|
||||
var context = BoundaryExtractionContext.Empty with { Source = source };
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with { Source = source };
|
||||
Assert.Equal(expected, _extractor.CanHandle(context));
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ public class IacBoundaryExtractorTests
|
||||
[Fact]
|
||||
public void CanHandle_WithTerraformAnnotations_ReturnsTrue()
|
||||
{
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Annotations = new Dictionary<string, string>
|
||||
{
|
||||
@@ -68,7 +68,7 @@ public class IacBoundaryExtractorTests
|
||||
[Fact]
|
||||
public void CanHandle_WithCloudFormationAnnotations_ReturnsTrue()
|
||||
{
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Annotations = new Dictionary<string, string>
|
||||
{
|
||||
@@ -83,7 +83,7 @@ public class IacBoundaryExtractorTests
|
||||
[Fact]
|
||||
public void CanHandle_WithHelmAnnotations_ReturnsTrue()
|
||||
{
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Annotations = new Dictionary<string, string>
|
||||
{
|
||||
@@ -98,7 +98,7 @@ public class IacBoundaryExtractorTests
|
||||
[Fact]
|
||||
public void CanHandle_WithEmptyAnnotations_ReturnsFalse()
|
||||
{
|
||||
var context = BoundaryExtractionContext.Empty;
|
||||
var context = BoundaryExtractionContext.CreateEmpty();
|
||||
Assert.False(_extractor.CanHandle(context));
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithTerraformSource_ReturnsTerraformIacSource()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -127,7 +127,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithCloudFormationSource_ReturnsCloudFormationIacSource()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "cloudformation", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "cloudformation"
|
||||
};
|
||||
@@ -143,7 +143,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithCfnSource_ReturnsCloudFormationIacSource()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "cfn", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "cfn"
|
||||
};
|
||||
@@ -159,7 +159,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithPulumiSource_ReturnsPulumiIacSource()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "pulumi", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "pulumi"
|
||||
};
|
||||
@@ -175,7 +175,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithHelmSource_ReturnsHelmIacSource()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "helm", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "helm"
|
||||
};
|
||||
@@ -195,7 +195,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithTerraformPublicSecurityGroup_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -217,7 +217,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithTerraformInternetFacingAlb_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -239,7 +239,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithTerraformPublicIp_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -261,7 +261,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithTerraformPrivateResource_ReturnsInternalExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -287,7 +287,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithCloudFormationPublicSecurityGroup_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "cloudformation", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "cloudformation",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -309,7 +309,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithCloudFormationInternetFacingElb_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "cloudformation", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "cloudformation",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -331,7 +331,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithCloudFormationApiGateway_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "cloudformation", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "cloudformation",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -357,7 +357,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithHelmIngressEnabled_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "helm", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "helm",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -379,7 +379,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithHelmLoadBalancerService_ReturnsPublicExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "helm", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "helm",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -401,7 +401,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithHelmClusterIpService_ReturnsPrivateExposure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "helm", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "helm",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -427,7 +427,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithIamAuth_ReturnsIamAuthType()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -450,7 +450,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithCognitoAuth_ReturnsOAuth2AuthType()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "cloudformation", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "cloudformation",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -473,7 +473,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithAzureAdAuth_ReturnsOAuth2AuthType()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -496,7 +496,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithMtlsAuth_ReturnsMtlsAuthType()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -518,7 +518,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithNoAuth_ReturnsNullAuth()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -538,7 +538,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithSecurityGroup_ReturnsSecurityGroupControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -559,7 +559,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithWaf_ReturnsWafControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -580,7 +580,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithVpc_ReturnsNetworkIsolationControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -601,7 +601,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithNacl_ReturnsNetworkAclControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -622,7 +622,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithDdosProtection_ReturnsDdosControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -643,7 +643,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithTls_ReturnsEncryptionControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -664,7 +664,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithPrivateEndpoint_ReturnsPrivateEndpointControl()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -685,7 +685,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithMultipleControls_ReturnsAllControls()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -708,7 +708,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithNoControls_ReturnsNullControls()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -728,7 +728,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithHelmIngressPath_ReturnsSurfaceWithPath()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "helm", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "helm",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -749,7 +749,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithHelmIngressHost_ReturnsSurfaceWithHost()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "helm", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "helm",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -770,7 +770,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_DefaultSurfaceType_ReturnsInfrastructure()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -787,7 +787,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_DefaultProtocol_ReturnsHttps()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -808,7 +808,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_BaseConfidence_Returns0Point6()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "iac", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "iac"
|
||||
};
|
||||
@@ -824,7 +824,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithKnownIacType_IncreasesConfidence()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -840,7 +840,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithSecurityResources_IncreasesConfidence()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -860,7 +860,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_MaxConfidence_CapsAt0Point85()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -882,7 +882,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_ReturnsNetworkKind()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform"
|
||||
};
|
||||
@@ -898,7 +898,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_BuildsEvidenceRef_WithIacType()
|
||||
{
|
||||
var root = new RichGraphRoot("root-123", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Namespace = "production",
|
||||
@@ -920,7 +920,7 @@ public class IacBoundaryExtractorTests
|
||||
public async Task ExtractAsync_ReturnsSameResultAsExtract()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
@@ -947,7 +947,7 @@ public class IacBoundaryExtractorTests
|
||||
[Fact]
|
||||
public void Extract_WithNullRoot_ThrowsArgumentNullException()
|
||||
{
|
||||
var context = BoundaryExtractionContext.Empty with { Source = "terraform" };
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with { Source = "terraform" };
|
||||
Assert.Throws<ArgumentNullException>(() => _extractor.Extract(null!, null, context));
|
||||
}
|
||||
|
||||
@@ -956,7 +956,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WhenCannotHandle_ReturnsNull()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "k8s", null);
|
||||
var context = BoundaryExtractionContext.Empty with { Source = "k8s" };
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with { Source = "k8s" };
|
||||
|
||||
var result = _extractor.Extract(root, null, context);
|
||||
|
||||
@@ -968,7 +968,7 @@ public class IacBoundaryExtractorTests
|
||||
public void Extract_WithLoadBalancer_SetsBehindProxyTrue()
|
||||
{
|
||||
var root = new RichGraphRoot("root-1", "terraform", null);
|
||||
var context = BoundaryExtractionContext.Empty with
|
||||
var context = BoundaryExtractionContext.CreateEmpty() with
|
||||
{
|
||||
Source = "terraform",
|
||||
Annotations = new Dictionary<string, string>
|
||||
|
||||
Reference in New Issue
Block a user