Documentation ¶
Index ¶
- Constants
- Variables
- func ConvertToRegex(values []string, wildcardAllowed bool) []string
- func ConvertToRfc822Regex(values []string) []string
- func GetApplicationName(zone string) string
- func GetCitName(zone string) string
- func GetFileAndBytes(p string) (*os.File, []byte, error)
- func GetFileType(f string) string
- func GetParent(p string) string
- func IsDefaultEmpty(ps *PolicySpecification) bool
- func IsPolicyEmpty(ps *PolicySpecification) bool
- func IsWildcardAllowed(ps PolicySpecification) bool
- func RemoveRegex(values []string) []string
- func ValidateCloudPolicySpecification(ps *PolicySpecification) error
- func ValidateTppPolicySpecification(ps *PolicySpecification) error
- func VerifyPolicySpec(bytes []byte, fileExt string) error
- type Account
- type AccountDetails
- type Accounts
- type ApplicationCreateRequest
- type CADetails
- type CertificateAuthorityInfo
- type CheckPolicyRequest
- type CheckPolicyResponse
- type ClearTTPAttributesRequest
- type CloudPolicyRequest
- type Default
- type DefaultKeyPair
- type DefaultSubject
- type Key
- type KeyPair
- type KeyPairResponse
- type KeyType
- type LockedArrayAttribute
- type LockedAttribute
- type LockedIntAttribute
- type OwnerIdType
- type Policy
- type PolicyExistPayloadRequest
- type PolicyGetAttributePayloadRequest
- type PolicyGetAttributeResponse
- type PolicyIsValidResponse
- type PolicyObject
- type PolicyPayloadRequest
- type PolicyResponse
- type PolicySetAttributePayloadRequest
- type PolicySetAttributeResponse
- type PolicySpecification
- type Product
- type ProductDetails
- type ProductOption
- type ProductTemplate
- type RecommendedSettings
- type Subject
- type SubjectAltNames
- type SubjectResponse
- type TppPolicy
- type TrackingData
Constants ¶
View Source
const ( JsonExtension = ".json" YamlExtension = ".yaml" RootPath = util.PathSeparator + "VED" + util.PathSeparator + "Policy" PolicyClass = "Policy" PolicyAttributeClass = "X509 Certificate" //tpp policy attributes TppContact = "Contact" TppApprover = "Approver" TppCertificateAuthority = "Certificate Authority" TppProhibitWildcard = "Prohibit Wildcard" TppDomainSuffixWhitelist = "Domain Suffix Whitelist" TppOrganization = "Organization" TppOrganizationalUnit = "Organizational Unit" TppCity = "City" TppState = "State" TppCountry = "Country" TppKeyAlgorithm = "Key Algorithm" TppKeyBitStrength = "Key Bit Strength" TppEllipticCurve = "Elliptic Curve" ServiceGenerated = "Manual Csr" TppProhibitedSANTypes = "Prohibited SAN Types" TppAllowPrivateKeyReuse = "Allow Private Key Reuse" TppWantRenewal = "Want Renewal" TppDnsAllowed = "DNS" TppIpAllowed = "IP" TppEmailAllowed = "Email" TppUriAllowed = "URI" TppUpnAllowed = "UPN" AllowAll = ".*" UserProvided = "UserProvided" DefaultCA = "BUILTIN\\Built-In CA\\Default Product" TppManagementType = "Management Type" TppManagementTypeEnrollment = "Enrollment" TppManagementTypeProvisioning = "Provisioning" CloudEntrustCA = "ENTRUST" CloudDigicertCA = "DIGICERT" CloudRequesterName = "Venafi Cloud Service" CloudRequesterEmail = "no-reply@venafi.cloud" CloudRequesterPhone = "801-555-0123" )
Variables ¶
View Source
var CloudRsaKeySize = []int{1024, 2048, 3072, 4096}
View Source
var TppEllipticCurves = []string{"P256", "P384", "P521"}
View Source
var TppKeyType = []string{"RSA", "ECDSA"}
there is no way for creating an array as constant, so creating a variable this is the nearest to a constant on arrays.
View Source
var TppRsaKeySize = []int{512, 1024, 2048, 3072, 4096}
Functions ¶
func ConvertToRegex ¶
func ConvertToRfc822Regex ¶ added in v4.18.0
func GetApplicationName ¶
func GetCitName ¶
func GetFileType ¶
func IsDefaultEmpty ¶
func IsDefaultEmpty(ps *PolicySpecification) bool
func IsPolicyEmpty ¶
func IsPolicyEmpty(ps *PolicySpecification) bool
func IsWildcardAllowed ¶
func IsWildcardAllowed(ps PolicySpecification) bool
func RemoveRegex ¶ added in v4.15.0
func ValidateCloudPolicySpecification ¶
func ValidateCloudPolicySpecification(ps *PolicySpecification) error
func ValidateTppPolicySpecification ¶
func ValidateTppPolicySpecification(ps *PolicySpecification) error
func VerifyPolicySpec ¶ added in v4.17.1
Types ¶
type AccountDetails ¶
type AccountDetails struct { Account Account `json:"account"` ProductOption []ProductOption `json:"productOptions"` }
type Accounts ¶
type Accounts struct {
Accounts []AccountDetails
}
type ApplicationCreateRequest ¶
type ApplicationCreateRequest struct { OwnerIdsAndTypes []OwnerIdType `json:"ownerIdsAndTypes"` Name string `json:"name"` Description string `json:"description"` Fqdns []string `json:"fqdns"` InternalFqdns []string `json:"internalFqdns"` InternalIpRanges []string `json:"internalIpRanges"` ExternalIpRanges []string `json:"externalIpRanges"` InternalPorts []string `json:"internalPorts"` FullyQualifiedDomainNames []string `json:"fullyQualifiedDomainNames"` IpRanges []string `json:"ipRanges"` Ports []string `json:"ports"` CertificateIssuingTemplateAliasIdMap map[string]string `json:"certificateIssuingTemplateAliasIdMap"` StartTargetedDiscovery bool `json:"startTargetedDiscovery"` OrganizationalUnitId string `json:"organizationalUnitId"` }
type CertificateAuthorityInfo ¶
func GetCertAuthorityInfo ¶
func GetCertAuthorityInfo(certificateAuthority string) (CertificateAuthorityInfo, error)
type CheckPolicyRequest ¶
type CheckPolicyRequest struct {
PolicyDN string `json:"PolicyDN"`
}
type CheckPolicyResponse ¶
type CheckPolicyResponse struct { Error string `json:"Error"` Policy *PolicyResponse `json:"Policy"` }
type CloudPolicyRequest ¶
type CloudPolicyRequest struct { Name string `json:"name"` CertificateAuthority string `json:"certificateAuthority"` CertificateAuthorityProductOptionId string `json:"certificateAuthorityProductOptionId"` Product Product `json:"product"` TrackingData *TrackingData `json:"trackingData"` SubjectCNRegexes []string `json:"subjectCNRegexes"` SubjectORegexes []string `json:"subjectORegexes"` SubjectOURegexes []string `json:"subjectOURegexes"` SubjectLRegexes []string `json:"subjectLRegexes"` SubjectSTRegexes []string `json:"subjectSTRegexes"` SubjectCValues []string `json:"subjectCValues"` SanRegexes []string `json:"sanRegexes"` SanIpAddressRegexes []string `json:"sanIpAddressRegexes"` SanRfc822NameRegexes []string `json:"sanRfc822NameRegexes"` SanUniformResourceIdentifierRegexes []string `json:"sanUniformResourceIdentifierRegexes"` KeyTypes []KeyType `json:"keyTypes"` KeyReuse *bool `json:"keyReuse"` RecommendedSettings *RecommendedSettings `json:"recommendedSettings"` CsrUploadAllowed bool `json:"csrUploadAllowed"` KeyGeneratedByVenafiAllowed bool `json:"keyGeneratedByVenafiAllowed"` }
func BuildCloudCitRequest ¶
func BuildCloudCitRequest(ps *PolicySpecification, ca *CADetails) (*CloudPolicyRequest, error)
type Default ¶
type Default struct { Domain *string `json:"domain,omitempty" yaml:"domain,omitempty"` Subject *DefaultSubject `json:"subject,omitempty" yaml:"subject,omitempty"` KeyPair *DefaultKeyPair `json:"keyPair,omitempty" yaml:"keyPair,omitempty"` AutoInstalled *bool `json:"autoInstalled,omitempty" yaml:"autoInstalled,omitempty"` }
type DefaultKeyPair ¶
type DefaultKeyPair struct { KeyType *string `json:"keyType,omitempty" yaml:"keyType,omitempty"` RsaKeySize *int `json:"rsaKeySize,omitempty" yaml:"rsaKeySize,omitempty"` EllipticCurve *string `json:"ellipticCurve,omitempty" yaml:"ellipticCurve,omitempty"` ServiceGenerated *bool `json:"serviceGenerated,omitempty" yaml:"serviceGenerated,omitempty"` }
type DefaultSubject ¶
type DefaultSubject struct { Org *string `json:"org,omitempty" yaml:"org,omitempty"` OrgUnits []string `json:"orgUnits,omitempty" yaml:"orgUnits,omitempty"` Locality *string `json:"locality,omitempty" yaml:"locality,omitempty"` State *string `json:"state,omitempty" yaml:"state,omitempty"` Country *string `json:"country,omitempty" yaml:"country,omitempty"` }
type KeyPair ¶
type KeyPair struct { KeyTypes []string `json:"keyTypes,omitempty" yaml:"keyTypes,omitempty"` RsaKeySizes []int `json:"rsaKeySizes,omitempty" yaml:"rsaKeySizes,omitempty"` EllipticCurves []string `json:"ellipticCurves,omitempty" yaml:"ellipticCurves,omitempty"` ServiceGenerated *bool `json:"serviceGenerated,omitempty" yaml:"generationType,omitempty"` ReuseAllowed *bool `json:"reuseAllowed,omitempty" yaml:"reuseAllowed,omitempty"` }
type KeyPairResponse ¶
type KeyPairResponse struct { KeyAlgorithm LockedAttribute `json:"KeyAlgorithm"` KeySize LockedIntAttribute `json:"KeySize"` }
type LockedArrayAttribute ¶
type LockedAttribute ¶
type LockedIntAttribute ¶
type OwnerIdType ¶
type Policy ¶
type Policy struct { Domains []string `json:"domains,omitempty" yaml:"domains,omitempty"` WildcardAllowed *bool `json:"wildcardAllowed,omitempty" yaml:"wildcardAllowed,omitempty"` AutoInstalled *bool `json:"autoInstalled,omitempty" yaml:"autoInstalled,omitempty"` MaxValidDays *int `json:"maxValidDays,omitempty" yaml:"maxValidDays,omitempty"` CertificateAuthority *string `json:"certificateAuthority,omitempty" yaml:"certificateAuthority,omitempty"` Subject *Subject `json:"subject,omitempty" yaml:"subject,omitempty"` KeyPair *KeyPair `json:"keyPair,omitempty" yaml:"keyPair,omitempty"` SubjectAltNames *SubjectAltNames `json:"subjectAltNames,omitempty" yaml:"subjectAltNames,omitempty"` }
type PolicyExistPayloadRequest ¶
type PolicyExistPayloadRequest struct {
ObjectDN string `json:"ObjectDN"`
}
type PolicyIsValidResponse ¶
type PolicyIsValidResponse struct { Error string `json:"Error"` Result int `json:"Result"` PolicyObject PolicyObject `json:"Object"` }
type PolicyObject ¶
type PolicyPayloadRequest ¶
type PolicyResponse ¶
type PolicyResponse struct { CertificateAuthority LockedAttribute `json:"CertificateAuthority"` CsrGeneration LockedAttribute `json:"CsrGeneration"` KeyGeneration LockedAttribute `json:"KeyGeneration"` KeyPairResponse KeyPairResponse `json:"KeyPair"` ManagementType LockedAttribute `json:"ManagementType"` PrivateKeyReuseAllowed bool `json:"PrivateKeyReuseAllowed"` SubjAltNameDnsAllowed bool `json:"SubjAltNameDnsAllowed"` SubjAltNameEmailAllowed bool `json:"SubjAltNameEmailAllowed"` SubjAltNameIpAllowed bool `json:"SubjAltNameIpAllowed"` SubjAltNameUpnAllowed bool `json:"SubjAltNameUpnAllowed"` SubjAltNameUriAllowed bool `json:"SubjAltNameUriAllowed"` Subject SubjectResponse `json:"Subject"` UniqueSubjectEnforced bool `json:"UniqueSubjectEnforced"` WhitelistedDomains []string `json:"WhitelistedDomains"` WildcardsAllowed bool `json:"WildcardsAllowed"` }
type PolicySpecification ¶
type PolicySpecification struct { Owners []string `json:"owners,omitempty" yaml:"owners,omitempty"` Users []string `json:"users,omitempty" yaml:"users,omitempty"` UserAccess string `json:"userAccess,omitempty" yaml:"userAccess,omitempty"` Approvers []string `json:"approvers,omitempty" yaml:"approvers,omitempty"` Policy *Policy `json:"policy,omitempty" yaml:"policy,omitempty"` Default *Default `json:"defaults,omitempty" yaml:"defaults,omitempty"` }
func BuildPolicySpecificationForTPP ¶
func BuildPolicySpecificationForTPP(checkPolicyResp CheckPolicyResponse) (*PolicySpecification, error)
func GetPolicySpec ¶ added in v4.17.1
func GetPolicySpec() *PolicySpecification
type Product ¶
type Product struct { CertificateAuthority string `json:"certificateAuthority"` ProductName string `json:"productName"` ValidityPeriod string `json:"validityPeriod"` HashAlgorithm *string `json:"hashAlgorithm,omitempty"` AutoRenew *bool `json:"autoRenew,omitempty"` OrganizationId *int64 `json:"organizationId,omitempty"` }
type ProductDetails ¶
type ProductDetails struct {
ProductTemplate ProductTemplate `json:"productTemplate"`
}
type ProductOption ¶
type ProductOption struct { ProductName string `json:"productName"` Id string `json:"id"` ProductDetails ProductDetails `json:"productDetails"` }
type ProductTemplate ¶
type ProductTemplate struct {
OrganizationId int64 `json:"organizationId"`
}
type RecommendedSettings ¶
type RecommendedSettings struct { SubjectCNRegexes []string `json:"subjectCNRegexes"` SubjectOValue *string `json:"subjectOValue"` SubjectOUValue *string `json:"subjectOUValue"` SubjectLValue *string `json:"subjectLValue"` SubjectSTValue *string `json:"subjectSTValue"` SubjectCValue *string `json:"subjectCValue"` SanRegexes []string `json:"sanRegexes"` Key *Key `json:"key"` }
type Subject ¶
type Subject struct { Orgs []string `json:"orgs,omitempty" yaml:"orgs,omitempty"` OrgUnits []string `json:"orgUnits,omitempty" yaml:"orgUnits,omitempty"` Localities []string `json:"localities,omitempty" yaml:"localities,omitempty"` States []string `json:"states,omitempty" yaml:"states,omitempty"` Countries []string `json:"countries,omitempty" yaml:"countries,omitempty"` }
type SubjectAltNames ¶
type SubjectAltNames struct { DnsAllowed *bool `json:"dnsAllowed,omitempty" yaml:"dnsAllowed,omitempty"` IpAllowed *bool `json:"ipAllowed,omitempty" yaml:"ipAllowed,omitempty"` EmailAllowed *bool `json:"emailAllowed,omitempty" yaml:"emailAllowed,omitempty"` UriAllowed *bool `json:"uriAllowed,omitempty" yaml:"uriAllowed,omitempty"` UpnAllowed *bool `json:"upnAllowed,omitempty" yaml:"uriProtocols,omitempty"` UriProtocols []string `json:"uriProtocols,omitempty" yaml:"uriProtocols,omitempty"` IpConstraints []string `json:"ipConstraints,omitempty" yaml:"uriProtocols,omitempty"` }
type SubjectResponse ¶
type SubjectResponse struct { City LockedAttribute `json:"City"` Country LockedAttribute `json:"Country"` Organization LockedAttribute `json:"Organization"` OrganizationalUnit LockedArrayAttribute `json:"OrganizationalUnit"` State LockedAttribute `json:"State"` }
type TppPolicy ¶
type TppPolicy struct { //general values Name *string //Owners []string "owners": string[],(permissions only) prefixed name/universal Contact []string //Permissions string "userAccess": string, (permissions) prefixed name/universal Approver []string //policy's values ProhibitWildcard *int DomainSuffixWhitelist []string ProhibitedSANType []string CertificateAuthority *string ManagementType *LockedAttribute //subject attributes Organization *LockedAttribute OrganizationalUnit *LockedArrayAttribute City *LockedAttribute State *LockedAttribute Country *LockedAttribute //keypair attributes KeyAlgorithm *LockedAttribute KeyBitStrength *LockedAttribute EllipticCurve *LockedAttribute ManualCsr *LockedAttribute AllowPrivateKeyReuse *int WantRenewal *int }
func BuildTppPolicy ¶
func BuildTppPolicy(ps *PolicySpecification) TppPolicy
Click to show internal directories.
Click to hide internal directories.