import React, { useContext, useState } from "react";
import { Tab, Tabs, TabList, TabPanel } from "react-tabs";
import { useQuery } from "react-query";
import FileSaver from "file-saver";
import { useDispatch } from "react-redux";
// @ts-ignore
import { renderFlash } from "redux/nodes/notifications/actions";
import configAPI from "services/entities/config";
import { AppContext } from "context/app";
// @ts-ignore
import { stringToClipboard } from "utilities/copy_text";
import { ITeam } from "interfaces/team";
import { IEnrollSecret } from "interfaces/enroll_secret";
import Button from "components/buttons/Button";
// @ts-ignore
import InputField from "components/forms/fields/InputField";
import Checkbox from "components/forms/fields/Checkbox";
import TooltipWrapper from "components/TooltipWrapper";
import TabsWrapper from "components/TabsWrapper";
import { isValidPemCertificate } from "../../../pages/hosts/ManageHostsPage/helpers";
import CopyIcon from "../../../../assets/images/icon-copy-clipboard-fleet-blue-20x20@2x.png";
import DownloadIcon from "../../../../assets/images/icon-download-12x12@2x.png";
interface IPlatformSubNav {
name: string;
type: string;
}
const platformSubNav: IPlatformSubNav[] = [
{
name: "macOS",
type: "pkg",
},
{
name: "Windows",
type: "msi",
},
{
name: "Linux (RPM)",
type: "rpm",
},
{
name: "Linux (deb)",
type: "deb",
},
{
name: "Advanced",
type: "advanced",
},
];
interface IPlatformWrapperProp {
selectedTeam: ITeam | { name: string; secrets: IEnrollSecret[] | null };
onCancel: () => void;
}
const baseClass = "platform-wrapper";
const PlatformWrapper = ({
selectedTeam,
onCancel,
}: IPlatformWrapperProp): JSX.Element => {
const { config, isPreviewMode } = useContext(AppContext);
const [copyMessage, setCopyMessage] = useState
Download your enroll secret:
Osquery uses an enroll secret to authenticate with the Fleet
server.
Download your Fleet certificate:
Loading your certificate
Prove the TLS certificate used by the Fleet server to enable
secure connections from osquery:
Fleet failed to load your certificate.
If you're able to access Fleet at a private or secure
(HTTPS) IP address, please log into Fleet at this address
to load your certificate.
Download your flagfile:
If using the enroll secret and server certificate downloaded
above, us the generated flagfile. In some configurations,
modifications may need to be made.
With{" "}
osquery
{" "}
installed:
Run osquery from the directory containing the above files (may
require sudo or Run as Administrator privileges):
Download
Download
{fetchCertificateError ? (
{fetchCertificateError}
) : (
Download
)}