diff --git a/lib/usagereporter/teleport/types_discover.go b/lib/usagereporter/teleport/types_discover.go index 5e617378c282c..3e170ef7c257d 100644 --- a/lib/usagereporter/teleport/types_discover.go +++ b/lib/usagereporter/teleport/types_discover.go @@ -181,8 +181,8 @@ func (u *UIDiscoverIntegrationAWSOIDCConnectEvent) Anonymize(a utils.Anonymizer) type UIDiscoverDatabaseRDSEnrollEvent prehogv1a.UIDiscoverDatabaseRDSEnrollEvent func (u *UIDiscoverDatabaseRDSEnrollEvent) CheckAndSetDefaults() error { - if u.SelectedResourcesCount <= 0 { - return trace.BadParameter("selected resources count must be 1 or more") + if u.SelectedResourcesCount < 0 { + return trace.BadParameter("selected resources count must be 0 or more") } return trace.Wrap(validateDiscoverBaseEventFields(u.Metadata, u.Resource, u.Status)) } diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx index 785b15c9dbc11..e1d9a7a639fc4 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/CommonElements.tsx @@ -56,7 +56,7 @@ export const PathInput = forwardRef< const StyledFieldInput = styled(FieldInput)` input { - border: 1px solid rgba(255, 255, 255, 0.1); + border: 1px solid ${props => props.theme.colors.text.muted}; background: transparent; color: white; box-shadow: none; diff --git a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx index 01bca24b78246..7fb52471c8def 100644 --- a/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx +++ b/web/packages/shared/components/FileTransfer/FileTransferStateless/FileList/FileListItem.tsx @@ -110,7 +110,7 @@ const Li = styled.li` const ProgressBackground = styled.div` border-radius: 50px; - background: rgba(255, 255, 255, 0.05); + background: ${props => props.theme.colors.spotBackground[0]}; width: 100%; `; diff --git a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx index c468e0e3460cd..9057c01c60451 100644 --- a/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx +++ b/web/packages/teleport/src/Discover/Database/CreateDatabase/CreateDatabase.tsx @@ -160,7 +160,7 @@ export function CreateDatabaseView({ Labels make this new database discoverable by the database service.
- Not defining labels is equivalent to asteriks (any + Not defining labels is equivalent to asterisks (any database service can discover this database).
) : ( - + {attempt.status === 'processing' && ( @@ -73,24 +73,9 @@ export function IamPolicyView({ {attempt.status === 'success' && ( - Run this AWS CLI command to create a IAM policy.
- Then attach this policy to appropriate AWS resources (eg.{' '} - - IAM users - - ,{' '} - - ec2 instance - - ). + Run this AWS CLI command to create an IAM policy:
- + + + Then attach this policy to your AWS EC2 instance role. + + + See{' '} + + Attach policy to an IAM role + {' '} + and{' '} + + Attach an IAM role to an instance + + )}
diff --git a/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx b/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx index 595f05612dc8f..31ee345a103bb 100644 --- a/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx +++ b/web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx @@ -376,7 +376,7 @@ function DbEngineInstructions({ const StyledBox = styled(Box)` max-width: 800px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; border-radius: 8px; padding: 20px; `; diff --git a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx index 17ae07ea8cbf4..bc2faa02957e9 100644 --- a/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/Database/TestConnection/TestConnection.tsx @@ -168,7 +168,7 @@ export function TestConnectionView({ const StyledBox = styled(Box)` max-width: 800px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; border-radius: 8px; padding: 20px; `; diff --git a/web/packages/teleport/src/Discover/Database/index.tsx b/web/packages/teleport/src/Discover/Database/index.tsx index fc8b494ddf463..0cd1b163dc2d3 100644 --- a/web/packages/teleport/src/Discover/Database/index.tsx +++ b/web/packages/teleport/src/Discover/Database/index.tsx @@ -32,6 +32,7 @@ import { TestConnection } from 'teleport/Discover/Database/TestConnection'; import { DiscoverEvent } from 'teleport/services/userEvent'; import { ConnectAwsAccount } from 'teleport/Discover/Database/ConnectAwsAccount'; import { EnrollRdsDatabase } from 'teleport/Discover/Database/EnrollRdsDatabase'; +import { IamPolicy } from 'teleport/Discover/Database/IamPolicy'; export const DatabaseResource: ResourceViewConfig = { kind: ResourceKind.Database, @@ -70,6 +71,11 @@ export const DatabaseResource: ResourceViewConfig = { component: DownloadScript, eventName: DiscoverEvent.DeployService, }, + { + title: 'Configure IAM Policy', + component: IamPolicy, + eventName: DiscoverEvent.DatabaseConfigureIAMPolicy, + }, ]; break; diff --git a/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx b/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx index 2d95a4c66a8dc..051bc2cffeb13 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/HelmChart/HelmChart.tsx @@ -453,7 +453,7 @@ const InstallHelmChart = ({ const StyledBox = styled(Box)` max-width: 1000px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; padding: ${props => `${props.theme.space[3]}px`}; border-radius: ${props => `${props.theme.space[2]}px`}; border: 2px solid #2f3659; diff --git a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx index 62252d8f6fcd6..7a21b92268d27 100644 --- a/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/Kubernetes/TestConnection/TestConnection.tsx @@ -205,7 +205,7 @@ export function TestConnection({ const StyledBox = styled(Box)` max-width: 800px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; border-radius: 8px; padding: 20px; `; diff --git a/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx b/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx index 0c3e3b7e9b509..633cb950ae543 100644 --- a/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx +++ b/web/packages/teleport/src/Discover/Server/TestConnection/TestConnection.tsx @@ -113,7 +113,7 @@ export function TestConnection({ const StyledBox = styled(Box)` max-width: 800px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; border-radius: 8px; padding: 20px; `; diff --git a/web/packages/teleport/src/Discover/Shared/CommandBox.tsx b/web/packages/teleport/src/Discover/Shared/CommandBox.tsx index 579c027400abc..ccb486d46bd71 100644 --- a/web/packages/teleport/src/Discover/Shared/CommandBox.tsx +++ b/web/packages/teleport/src/Discover/Shared/CommandBox.tsx @@ -21,10 +21,9 @@ import { Box, Text } from 'design'; const Container = styled(Box)` max-width: 1000px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; padding: ${props => `${props.theme.space[3]}px`}; border-radius: ${props => `${props.theme.space[2]}px`}; - border: 2px solid #2f3659; `; interface CommandBoxProps { diff --git a/web/packages/teleport/src/Discover/Shared/HintBox.tsx b/web/packages/teleport/src/Discover/Shared/HintBox.tsx index b47db658a3478..8a92e2eb2cd88 100644 --- a/web/packages/teleport/src/Discover/Shared/HintBox.tsx +++ b/web/packages/teleport/src/Discover/Shared/HintBox.tsx @@ -25,7 +25,7 @@ import { TextIcon } from 'teleport/Discover/Shared/Text'; const HintBoxContainer = styled(Box)` max-width: 1000px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; padding: ${props => `${props.theme.space[3]}px`}; border-radius: ${props => `${props.theme.space[2]}px`}; border: 2px solid ${props => props.theme.colors.warning}; ; @@ -33,17 +33,17 @@ const HintBoxContainer = styled(Box)` export const WaitingInfo = styled(Box)` max-width: 1000px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; padding: ${props => `${props.theme.space[3]}px`}; border-radius: ${props => `${props.theme.space[2]}px`}; - border: 2px solid #2f3659; + border: 2px solid ${props => props.theme.colors.text.muted}; display: flex; align-items: center; `; export const SuccessInfo = styled(Box)` max-width: 1000px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; padding: ${props => `${props.theme.space[3]}px`}; border-radius: ${props => `${props.theme.space[2]}px`}; border: 2px solid ${props => props.theme.colors.success}; diff --git a/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx b/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx index a8ac35d2b426f..44f7729cd96c7 100644 --- a/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx +++ b/web/packages/teleport/src/Discover/Shared/SetupAccess/SetupAccessWrapper.tsx @@ -146,7 +146,7 @@ export function SetupAccessWrapper({ const StyledBox = styled(Box)` max-width: 700px; - background-color: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; border-radius: 8px; padding: 20px; `; diff --git a/web/packages/teleport/src/Discover/Shared/Step.tsx b/web/packages/teleport/src/Discover/Shared/Step.tsx index 0eec69bfc882e..a7abd157784c0 100644 --- a/web/packages/teleport/src/Discover/Shared/Step.tsx +++ b/web/packages/teleport/src/Discover/Shared/Step.tsx @@ -47,7 +47,7 @@ export function Step(props: StepProps) { } export const StepContainer = styled.div` - background: rgba(255, 255, 255, 0.05); + background: ${props => props.theme.colors.spotBackground[0]}; border-radius: 8px; padding: 16px; margin-bottom: 12px; diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx index ae33d0a6ddcc2..72c5461057379 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/AwsOidc.tsx @@ -105,7 +105,9 @@ enum InstructionStep { export function AwsOidc() { const ctx = useTeleport(); - let clusterPublicUri = ctx.storeUser.state.cluster.publicURL; + let clusterPublicUri = getClusterPublicUri( + ctx.storeUser.state.cluster.publicURL + ); const [stage, setStage] = useState(Stage.Initial); const [showRestartAnimation, setShowRestartAnimation] = useState(false); @@ -359,3 +361,15 @@ function getStageConfig(stage: Stage) { }; } } + +function getClusterPublicUri(uri: string) { + const uriParts = uri.split(':'); + const port = uriParts.length > 1 ? uriParts[1] : ''; + + // Strip 443 ports from uri. + if (port === '443') { + return uriParts[0]; + } + + return uri; +} diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/IAM/IAMCreateNewPolicy.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/IAM/IAMCreateNewPolicy.tsx index a5f30b90e3838..c30c05e64ecad 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/IAM/IAMCreateNewPolicy.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/IAM/IAMCreateNewPolicy.tsx @@ -108,10 +108,13 @@ export function IAMCreateNewPolicy(props: CommonIAMProps) { "Version": "2012-10-17", "Statement": [ { - "Effect": "Allow", - "Action": "rds:DescribeDBInstances", - "Resource": "*" - } + "Effect": "Allow", + "Action": [ + "rds:DescribeDBInstances", + "rds:DescribeDBClusters" + ], + "Resource": "*" + } ] }`; } diff --git a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/instructions/SecondStageInstructions.tsx b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/instructions/SecondStageInstructions.tsx index df09c181d307a..1e0b4b08dba22 100644 --- a/web/packages/teleport/src/Integrations/Enroll/AwsOidc/instructions/SecondStageInstructions.tsx +++ b/web/packages/teleport/src/Integrations/Enroll/AwsOidc/instructions/SecondStageInstructions.tsx @@ -60,7 +60,7 @@ export function SecondStageInstructions(props: CommonInstructionsProps) { bash={false} lines={[ { - text: `https://${getClusterPublicUri(props.clusterPublicUri)}`, + text: `https://${props.clusterPublicUri}`, }, ]} /> @@ -111,15 +111,3 @@ export function SecondStageInstructions(props: CommonInstructionsProps) { ); } - -function getClusterPublicUri(uri: string) { - const uriParts = uri.split(':'); - const port = uriParts.length > 1 ? uriParts[1] : ''; - - // Strip 443 ports from uri. - if (port === '443') { - return uriParts[0]; - } - - return uri; -} diff --git a/web/packages/teleport/src/Navigation/NavigationSwitcher.tsx b/web/packages/teleport/src/Navigation/NavigationSwitcher.tsx index 71bb0fe21a7ba..d8c6962a9eeff 100644 --- a/web/packages/teleport/src/Navigation/NavigationSwitcher.tsx +++ b/web/packages/teleport/src/Navigation/NavigationSwitcher.tsx @@ -51,7 +51,7 @@ const ActiveValue = styled.div` cursor: pointer; &:focus { - background: rgba(255, 255, 255, 0.05); + background: ${props => props.theme.colors.spotBackground[0]}; } `; diff --git a/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx b/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx index 700d4ee47da55..60936ca49d02e 100644 --- a/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx +++ b/web/packages/teleport/src/components/ToolTipNoPermBadge/ToolTipNoPermBadge.story.tsx @@ -47,5 +47,5 @@ const SomeBox = styled.div` display: flex; position: relative; align-items: center; - background: rgba(255, 255, 255, 0.05); + background-color: ${props => props.theme.colors.spotBackground[0]}; `;