Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/devguard-scanner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ on:

jobs:
devguard-scanner:
uses: l3montree-dev/devguard-action/.github/workflows/devguard-workflow.yml@main
uses: l3montree-dev/devguard-action/.github/workflows/full.yml@main
with:
asset-name: "l3montree-cybersecurity/projects/devguard/assets/devguard-web"
scan-type: "full"
secrets:
devguard-token: ${{ secrets.DEVGUARD_TOKEN }}
2 changes: 1 addition & 1 deletion src/pages/[organizationSlug]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const Home: FunctionComponent<Props> = ({
<Page
Title={
<Link
href={`/${organization.slug}`}
href={`/${organization.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{organization.name}{" "}
Expand Down
61 changes: 25 additions & 36 deletions src/pages/[organizationSlug]/projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.

import { Button, buttonVariants } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { middleware } from "@/decorators/middleware";
import { GetServerSidePropsContext } from "next";
import { useRouter } from "next/router";
Expand All @@ -33,6 +32,7 @@ import {
import { ProjectDTO } from "../../types/api/api";
import { CreateProjectReq } from "../../types/api/req";

import ListItem from "@/components/common/ListItem";
import Section from "@/components/common/Section";
import {
Dialog,
Expand All @@ -42,33 +42,23 @@ import {
DialogHeader,
DialogTitle,
} from "@/components/ui/dialog";
import {
Form,
FormControl,
FormDescription,
FormField,
FormItem,
FormLabel,
FormMessage,
} from "@/components/ui/form";
import { Form } from "@/components/ui/form";
import { useOrganizationMenu } from "@/hooks/useOrganizationMenu";
import { ZodConvert } from "@/types/common";
import { zodResolver } from "@hookform/resolvers/zod";
import { toast } from "sonner";
import ListItem from "@/components/common/ListItem";

import { EllipsisVerticalIcon } from "@heroicons/react/24/outline";
import Link from "next/link";
import EmptyList from "@/components/common/EmptyList";
import { ProjectForm } from "@/components/project/ProjectForm";
import { Badge } from "@/components/ui/badge";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu";
import EmptyList from "@/components/common/EmptyList";
import { Badge } from "@/components/ui/badge";
import { withOrganization } from "@/decorators/withOrganization";
import { ProjectForm } from "@/components/project/ProjectForm";
import { EllipsisVerticalIcon } from "@heroicons/react/24/outline";
import Link from "next/link";

interface Props {
projects: Array<ProjectDTO>;
Expand Down Expand Up @@ -113,7 +103,7 @@ const Home: FunctionComponent<Props> = ({ projects }) => {
<Page
Title={
<Link
href={`/${activeOrg.slug}`}
href={`/${activeOrg.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{activeOrg.name}{" "}
Expand Down Expand Up @@ -169,21 +159,15 @@ const Home: FunctionComponent<Props> = ({ projects }) => {
>
<div className="flex flex-col gap-2">
{projects.map((project) => (
<ListItem
<Link
key={project.id}
Title={project.name}
description={project.description}
Button={
<>
{" "}
<Link
className={buttonVariants({ variant: "outline" })}
href={
"/" + activeOrg.slug + "/projects/" + project.slug
}
>
View project
</Link>
href={`/${activeOrg.slug}/projects/${project.slug}/assets`}
className="flex flex-col gap-2 hover:no-underline"
>
<ListItem
Title={project.name}
description={project.description}
Button={
<DropdownMenu>
<DropdownMenuTrigger
className={buttonVariants({
Expand All @@ -194,12 +178,17 @@ const Home: FunctionComponent<Props> = ({ projects }) => {
<EllipsisVerticalIcon className="h-5 w-5" />
</DropdownMenuTrigger>
<DropdownMenuContent>
<DropdownMenuItem>Edit</DropdownMenuItem>
<Link
className="!text-foreground hover:no-underline"
href={`/${activeOrg.slug}/projects/${project.slug}/settings`}
>
<DropdownMenuItem>Edit</DropdownMenuItem>
</Link>
</DropdownMenuContent>
</DropdownMenu>
</>
}
/>
}
/>
</Link>
))}
</div>
</Section>
Expand Down
114 changes: 69 additions & 45 deletions src/pages/[organizationSlug]/projects/[projectSlug]/assets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,15 @@ import { zodResolver } from "@hookform/resolvers/zod";
import EmptyList from "@/components/common/EmptyList";
import Section from "@/components/common/Section";
import { Badge } from "@/components/ui/badge";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
} from "@/components/ui/dropdown-menu";
import { withOrganization } from "@/decorators/withOrganization";
import { useProjectMenu } from "@/hooks/useProjectMenu";
import { EllipsisVerticalIcon } from "@heroicons/react/24/outline";
import { DropdownMenuTrigger } from "@radix-ui/react-dropdown-menu";
import Link from "next/link";
import { toast } from "sonner";
import z from "zod";
Expand All @@ -40,8 +48,6 @@ import {
ProjectDTO,
RequirementsLevel,
} from "../../../../types/api/api";
import { withOrganization } from "@/decorators/withOrganization";
import { addToInitialZustandState } from "@/zustand/initialState";

interface Props {
project: ProjectDTO & {
Expand Down Expand Up @@ -110,7 +116,7 @@ const Index: FunctionComponent<Props> = ({ project }) => {
Title={
<span className="flex flex-row gap-2">
<Link
href={`/${activeOrg.slug}`}
href={`/${activeOrg.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{activeOrg.name}{" "}
Expand All @@ -124,7 +130,7 @@ const Index: FunctionComponent<Props> = ({ project }) => {
<span className="opacity-75">/</span>
<Link
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
href={`/${activeOrg.slug}/projects/${project.slug}`}
href={`/${activeOrg.slug}/projects/${project.slug}/assets`}
>
{project.name}
<Badge
Expand Down Expand Up @@ -157,49 +163,67 @@ const Index: FunctionComponent<Props> = ({ project }) => {
title="Assets"
>
{project.assets.map((asset) => (
<ListItem
<Link
key={asset.id}
Title={asset.name}
description={
<div>
{asset.description}{" "}
<div className="mt-2 flex flex-row gap-2">
{asset.lastSecretScan && (
<Badge variant={"outline"}>Secret-Scanning</Badge>
)}
{asset.lastSastScan && (
<Badge variant={"outline"}>
Static-Application-Security-Testing
</Badge>
)}
{asset.lastScaScan && (
<Badge variant={"outline"}>
Software Composition Analysis
</Badge>
)}
{asset.lastIacScan && (
<Badge variant={"outline"}>
Infrastructure-as-Code-Scanning
</Badge>
)}
{asset.lastContainerScan && (
<Badge variant={"outline"}>Container-Scanning</Badge>
)}
{asset.lastDastScan && (
<Badge variant={"outline"}>Dynamic-Analysis</Badge>
)}
href={`/${activeOrg.slug}/projects/${project.slug}/assets/${asset.slug}/risk-handling`}
className="flex flex-col gap-2 hover:no-underline "
>
<ListItem
key={asset.id}
Title={asset.name}
description={
<div>
{asset.description}{" "}
<div className="mt-2 flex flex-row gap-2">
{asset.lastSecretScan && (
<Badge variant={"outline"}>Secret-Scanning</Badge>
)}
{asset.lastSastScan && (
<Badge variant={"outline"}>
Static-Application-Security-Testing
</Badge>
)}
{asset.lastScaScan && (
<Badge variant={"outline"}>
Software Composition Analysis
</Badge>
)}
{asset.lastIacScan && (
<Badge variant={"outline"}>
Infrastructure-as-Code-Scanning
</Badge>
)}
{asset.lastContainerScan && (
<Badge variant={"outline"}>Container-Scanning</Badge>
)}
{asset.lastDastScan && (
<Badge variant={"outline"}>Dynamic-Analysis</Badge>
)}
</div>
</div>
</div>
}
Button={
<Link
href={`/${activeOrg.slug}/projects/${project.slug}/assets/${asset.slug}`}
className={buttonVariants({ variant: "outline" })}
>
View Asset
</Link>
}
/>
}
Button={
<DropdownMenu>
<DropdownMenuTrigger
className={buttonVariants({
variant: "outline",
size: "icon",
})}
>
<EllipsisVerticalIcon className="h-5 w-5" />
</DropdownMenuTrigger>
<DropdownMenuContent>
<Link
className="!text-foreground hover:no-underline"
href={`/${activeOrg.slug}/projects/${project.slug}/assets/${asset.slug}/settings`}
>
<DropdownMenuItem>Edit</DropdownMenuItem>
</Link>
</DropdownMenuContent>
</DropdownMenu>
}
/>
</Link>
))}
</Section>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const DependencyGraphPage: FunctionComponent<{
Title={
<span className="flex flex-row gap-2">
<Link
href={`/${activeOrg.slug}`}
href={`/${activeOrg.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{activeOrg.name}{" "}
Expand All @@ -116,7 +116,7 @@ const DependencyGraphPage: FunctionComponent<{
<span className="opacity-75">/</span>
<Link
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
href={`/${activeOrg.slug}/projects/${project?.slug}`}
href={`/${activeOrg.slug}/projects/${project?.slug}/assets`}
>
{project?.name}
<Badge
Expand All @@ -129,7 +129,7 @@ const DependencyGraphPage: FunctionComponent<{
<span className="opacity-75">/</span>
<Link
className="flex items-center gap-1 text-white hover:no-underline"
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}`}
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}/risk-handling`}
>
{asset?.name}
<Badge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const Index: FunctionComponent<Props> = ({
Title={
<span className="flex flex-row gap-2">
<Link
href={`/${activeOrg.slug}`}
href={`/${activeOrg.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{activeOrg.name}{" "}
Expand All @@ -84,7 +84,7 @@ const Index: FunctionComponent<Props> = ({
<span className="opacity-75">/</span>
<Link
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
href={`/${activeOrg.slug}/projects/${project?.slug}`}
href={`/${activeOrg.slug}/projects/${project?.slug}/assets`}
>
{project?.name}
<Badge
Expand All @@ -97,7 +97,7 @@ const Index: FunctionComponent<Props> = ({
<span className="opacity-75">/</span>
<Link
className="flex items-center gap-1 text-white hover:no-underline"
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}`}
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}/risk-handling`}
>
{asset?.name}
<Badge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ const Index: FunctionComponent<Props> = (props) => {
Title={
<span className="flex flex-row gap-2">
<Link
href={`/${activeOrg.slug}`}
href={`/${activeOrg.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{activeOrg.name}{" "}
Expand All @@ -244,7 +244,7 @@ const Index: FunctionComponent<Props> = (props) => {
<span className="opacity-75">/</span>
<Link
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
href={`/${activeOrg.slug}/projects/${project?.slug}`}
href={`/${activeOrg.slug}/projects/${project?.slug}/assets`}
>
{project?.name}
<Badge
Expand All @@ -257,7 +257,7 @@ const Index: FunctionComponent<Props> = (props) => {
<span className="opacity-75">/</span>
<Link
className="flex items-center gap-1 text-white hover:no-underline"
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}`}
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}/risk-handling`}
>
{asset?.name}
<Badge
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const RiskIdentification: FunctionComponent<Props> = (
Title={
<span className="flex flex-row gap-2">
<Link
href={`/${activeOrg.slug}`}
href={`/${activeOrg.slug}/projects`}
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
>
{activeOrg.name}{" "}
Expand All @@ -57,7 +57,7 @@ const RiskIdentification: FunctionComponent<Props> = (
<span className="opacity-75">/</span>
<Link
className="flex flex-row items-center gap-1 !text-white hover:no-underline"
href={`/${activeOrg.slug}/projects/${project?.slug}`}
href={`/${activeOrg.slug}/projects/${project?.slug}/assets`}
>
{project?.name}
<Badge
Expand All @@ -70,7 +70,7 @@ const RiskIdentification: FunctionComponent<Props> = (
<span className="opacity-75">/</span>
<Link
className="flex items-center gap-1 text-white hover:no-underline"
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}`}
href={`/${activeOrg?.slug}/projects/${project?.slug}/assets/${asset?.slug}/risk-handling`}
>
{asset?.name}
<Badge
Expand Down
Loading
Loading