Skip to content

Commit

Permalink
add authZ to reports
Browse files Browse the repository at this point in the history
  • Loading branch information
anmalkov committed Jan 9, 2024
1 parent 88e3e67 commit b967b34
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Crisp.Core/Helpers/OpenXmlHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using DocumentFormat.OpenXml;
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using A = DocumentFormat.OpenXml.Drawing;
using DW = DocumentFormat.OpenXml.Drawing.Wordprocessing;
Expand Down Expand Up @@ -55,6 +56,7 @@ public static void AddDataflowAttributes(Stream stream, IEnumerable<DataflowAttr
new TableCell(new Paragraph(new Run(new Text(attribute.Transport)))),
new TableCell(new Paragraph(new Run(new Text(attribute.DataClassification)))),
new TableCell(new Paragraph(new Run(new Text(attribute.Authentication)))),
new TableCell(new Paragraph(new Run(new Text(attribute.Authorization)))),
new TableCell(new Paragraph(new Run(new Text(attribute.Notes))))
})
);
Expand Down Expand Up @@ -435,6 +437,7 @@ private static IEnumerable<Paragraph> GetParagraphsFromMarkdown(string markdown)

private static Paragraph? FindParagraph(Body body, string text)
{
var p = body.Descendants<Paragraph>();
return body.Descendants<Paragraph>().Where(p => p.Descendants<Run>().Any(r => r.Descendants<Text>().Any(t => t.Text.ToLower() == text.ToLower()))).FirstOrDefault();
}

Expand Down
2 changes: 1 addition & 1 deletion src/Crisp.Core/Services/ThreatModelsService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ private static string GenerateDataflowAttributeSection(ThreatModel threatModel)
var section = new StringBuilder();
foreach (var a in threatModel.DataflowAttributes)
{
section.AppendLine($"| {a.Number.Trim()} | {a.Transport.Trim()} | {a.DataClassification.Trim()} | {a.Authentication.Trim()} | {a.Notes.Trim()} |");
section.AppendLine($"| {a.Number.Trim()} | {a.Transport.Trim()} | {a.DataClassification.Trim()} | {a.Authentication.Trim()} | {a.Authorization.Trim()} | {a.Notes.Trim()} |");
}
return section.ToString().TrimEnd(Environment.NewLine.ToCharArray());
}
Expand Down

0 comments on commit b967b34

Please sign in to comment.