Class UserAccount

java.lang.Object
security.whisper.javastix.coo.objects.UserAccount
All Implemented Interfaces:
Serializable, BundleableObject, Stix, StixCustomProperties, CyberObservableObject, CyberObservableObjectCommonProperties, UserAccountCoo, GenericValidation, SdoDefaultValidator

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class UserAccount extends Object implements UserAccountCoo
user-account

The User Account Object represents an instance of any type of user account, including but not limited to operating system, device, messaging service, and social media platform accounts.

See Also:
  • Method Details

    • getUserId

      @JsonPropertyDescription("Specifies the identifier of the account.") public String getUserId()
      Specified by:
      getUserId in interface UserAccountCoo
      Returns:
      The value of the userId attribute
    • getAccountLogin

      @JsonPropertyDescription("Specifies the account login string, used in cases where the user_id property specifies something other than what a user would type when they login.") public Optional<String> getAccountLogin()
      Specified by:
      getAccountLogin in interface UserAccountCoo
      Returns:
      The value of the accountLogin attribute
    • getAccountType

      @JsonPropertyDescription("Specifies the type of the account. This is an open vocabulary and values SHOULD come from the account-type-ov vocabulary.") public Optional<String> getAccountType()
      Specified by:
      getAccountType in interface UserAccountCoo
      Returns:
      The value of the accountType attribute
    • getDisplayName

      @JsonPropertyDescription("Specifies the display name of the account, to be shown in user interfaces, if applicable.") public Optional<String> getDisplayName()
      Specified by:
      getDisplayName in interface UserAccountCoo
      Returns:
      The value of the displayName attribute
    • isServiceAccount

      @JsonPropertyDescription("Indicates that the account is associated with a network service or system process (daemon), not a specific individual.") public Optional<Boolean> isServiceAccount()
      Specified by:
      isServiceAccount in interface UserAccountCoo
      Returns:
      The value of the isServiceAccount attribute
    • isPrivileged

      @JsonPropertyDescription("Specifies that the account has elevated privileges (i.e., in the case of root on Unix or the Windows Administrator account).") public Optional<Boolean> isPrivileged()
      Specified by:
      isPrivileged in interface UserAccountCoo
      Returns:
      The value of the isPrivileged attribute
    • isCanEscalatePrivs

      @JsonPropertyDescription("Specifies that the account has the ability to escalate privileges (i.e., in the case of sudo on Unix or a Windows Domain Admin account).") public Optional<Boolean> isCanEscalatePrivs()
      Specified by:
      isCanEscalatePrivs in interface UserAccountCoo
      Returns:
      The value of the isCanEscalatePrivs attribute
    • isDisabled

      @JsonPropertyDescription("Specifies if the account is disabled.") public Optional<Boolean> isDisabled()
      Specified by:
      isDisabled in interface UserAccountCoo
      Returns:
      The value of the isDisabled attribute
    • getAccountCreated

      @JsonPropertyDescription("Specifies when the account was created.") public Optional<StixInstant> getAccountCreated()
      Specified by:
      getAccountCreated in interface UserAccountCoo
      Returns:
      The value of the accountCreated attribute
    • getAccountExpires

      @JsonPropertyDescription("Specifies the expiration date of the account.") public Optional<StixInstant> getAccountExpires()
      Specified by:
      getAccountExpires in interface UserAccountCoo
      Returns:
      The value of the accountExpires attribute
    • getPasswordLastChanged

      @JsonPropertyDescription("Specifies when the account password was last changed.") public Optional<StixInstant> getPasswordLastChanged()
      Specified by:
      getPasswordLastChanged in interface UserAccountCoo
      Returns:
      The value of the passwordLastChanged attribute
    • getAccountFirstLogin

      @JsonPropertyDescription("Specifies when the account was first accessed.") public Optional<StixInstant> getAccountFirstLogin()
      Specified by:
      getAccountFirstLogin in interface UserAccountCoo
      Returns:
      The value of the accountFirstLogin attribute
    • getAccountLastLogin

      @JsonPropertyDescription("Specifies when the account was last accessed.") public Optional<StixInstant> getAccountLastLogin()
      Specified by:
      getAccountLastLogin in interface UserAccountCoo
      Returns:
      The value of the accountLastLogin attribute
    • getId

      public String getId()
      Deterministically generates the ID for this user account based on its user ID.
      Specified by:
      getId in interface BundleableObject
      Specified by:
      getId in interface CyberObservableObjectCommonProperties
      Specified by:
      getId in interface UserAccountCoo
    • getType

      public String getType()
      Specified by:
      getType in interface BundleableObject
      Specified by:
      getType in interface CyberObservableObjectCommonProperties
      Returns:
      The value of the type attribute
    • getExtensions

      @JsonPropertyDescription("Specifies any extensions of the object, as a dictionary.") public com.google.common.collect.ImmutableSet<CyberObservableExtension> getExtensions()
      Multiple extensions can be added, but only 1 instance of a specific extension can be added.
      Specified by:
      getExtensions in interface CyberObservableObjectCommonProperties
    • getObservableObjectKey

      public String getObservableObjectKey()
      Used for generation of Map Keys by
      invalid reference
      ObservedDataSdo#getObjects()
      Manually set this value if you want to control key names. Otherwise UUIDs will be used.
      Specified by:
      getObservableObjectKey in interface CyberObservableObjectCommonProperties
    • getDefanged

      @JsonPropertyDescription("Indicates whether the data contained in the SCO has been defanged.") public Optional<Boolean> getDefanged()
      Indicates whether the data contained in the SCO has been defanged. Defanging refers to the process of modifying data to make it safe to handle (e.g., changing an IP address from 192.168.1.1 to 192[.]168[.]1[.]1).
      Specified by:
      getDefanged in interface CyberObservableObjectCommonProperties
    • getCustomProperties

      public com.google.common.collect.ImmutableMap<String,Object> getCustomProperties()
      Custom Properties for STIX Objects. Any object that supports custom properties will have a validation of the custom property prefix (typically "x_"). If the additional property in the JSON does not meet the StartsWith condition, then the JSON will be rejected.
      Specified by:
      getCustomProperties in interface StixCustomProperties
      Returns:
      Map of custom properties Map<String, Object>
    • getObjectMarkingRefs

      public com.google.common.collect.ImmutableSet<MarkingDefinitionDm> getObjectMarkingRefs()
      Specified by:
      getObjectMarkingRefs in interface BundleableObject
      Returns:
      The value of the objectMarkingRefs attribute
    • getGranularMarkings

      public com.google.common.collect.ImmutableSet<GranularMarkingDm> getGranularMarkings()
      Specified by:
      getGranularMarkings in interface BundleableObject
      Returns:
      The value of the granularMarkings attribute
    • getHydrated

      public boolean getHydrated()
      Specified by:
      getHydrated in interface BundleableObject
      Returns:
      The value of the hydrated attribute
    • toJsonString

      public String toJsonString()
      Specified by:
      toJsonString in interface BundleableObject
      Returns:
      The value of the toJsonString attribute
    • withUserId

      public final UserAccount withUserId(String value)
      Copy the current immutable object by setting a value for the userId attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for userId (can be null)
      Returns:
      A modified copy of the this object
    • withAccountLogin

      public final UserAccount withAccountLogin(String value)
      Copy the current immutable object by setting a present value for the optional accountLogin attribute.
      Parameters:
      value - The value for accountLogin
      Returns:
      A modified copy of this object
    • withAccountLogin

      public final UserAccount withAccountLogin(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the accountLogin attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for accountLogin
      Returns:
      A modified copy of this object
    • withAccountType

      public final UserAccount withAccountType(String value)
      Copy the current immutable object by setting a present value for the optional accountType attribute.
      Parameters:
      value - The value for accountType
      Returns:
      A modified copy of this object
    • withAccountType

      public final UserAccount withAccountType(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the accountType attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for accountType
      Returns:
      A modified copy of this object
    • withDisplayName

      public final UserAccount withDisplayName(String value)
      Copy the current immutable object by setting a present value for the optional displayName attribute.
      Parameters:
      value - The value for displayName
      Returns:
      A modified copy of this object
    • withDisplayName

      public final UserAccount withDisplayName(Optional<String> optional)
      Copy the current immutable object by setting an optional value for the displayName attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for displayName
      Returns:
      A modified copy of this object
    • withIsServiceAccount

      public final UserAccount withIsServiceAccount(boolean value)
      Copy the current immutable object by setting a present value for the optional isServiceAccount attribute.
      Parameters:
      value - The value for isServiceAccount
      Returns:
      A modified copy of this object
    • withIsServiceAccount

      public final UserAccount withIsServiceAccount(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the isServiceAccount attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for isServiceAccount
      Returns:
      A modified copy of this object
    • withIsPrivileged

      public final UserAccount withIsPrivileged(boolean value)
      Copy the current immutable object by setting a present value for the optional isPrivileged attribute.
      Parameters:
      value - The value for isPrivileged
      Returns:
      A modified copy of this object
    • withIsPrivileged

      public final UserAccount withIsPrivileged(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the isPrivileged attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for isPrivileged
      Returns:
      A modified copy of this object
    • withIsCanEscalatePrivs

      public final UserAccount withIsCanEscalatePrivs(boolean value)
      Copy the current immutable object by setting a present value for the optional isCanEscalatePrivs attribute.
      Parameters:
      value - The value for isCanEscalatePrivs
      Returns:
      A modified copy of this object
    • withIsCanEscalatePrivs

      public final UserAccount withIsCanEscalatePrivs(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the isCanEscalatePrivs attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for isCanEscalatePrivs
      Returns:
      A modified copy of this object
    • withIsDisabled

      public final UserAccount withIsDisabled(boolean value)
      Copy the current immutable object by setting a present value for the optional isDisabled attribute.
      Parameters:
      value - The value for isDisabled
      Returns:
      A modified copy of this object
    • withIsDisabled

      public final UserAccount withIsDisabled(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the isDisabled attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for isDisabled
      Returns:
      A modified copy of this object
    • withAccountCreated

      public final UserAccount withAccountCreated(StixInstant value)
      Copy the current immutable object by setting a present value for the optional accountCreated attribute.
      Parameters:
      value - The value for accountCreated
      Returns:
      A modified copy of this object
    • withAccountCreated

      public final UserAccount withAccountCreated(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the accountCreated attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for accountCreated
      Returns:
      A modified copy of this object
    • withAccountExpires

      public final UserAccount withAccountExpires(StixInstant value)
      Copy the current immutable object by setting a present value for the optional accountExpires attribute.
      Parameters:
      value - The value for accountExpires
      Returns:
      A modified copy of this object
    • withAccountExpires

      public final UserAccount withAccountExpires(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the accountExpires attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for accountExpires
      Returns:
      A modified copy of this object
    • withPasswordLastChanged

      public final UserAccount withPasswordLastChanged(StixInstant value)
      Copy the current immutable object by setting a present value for the optional passwordLastChanged attribute.
      Parameters:
      value - The value for passwordLastChanged
      Returns:
      A modified copy of this object
    • withPasswordLastChanged

      public final UserAccount withPasswordLastChanged(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the passwordLastChanged attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for passwordLastChanged
      Returns:
      A modified copy of this object
    • withAccountFirstLogin

      public final UserAccount withAccountFirstLogin(StixInstant value)
      Copy the current immutable object by setting a present value for the optional accountFirstLogin attribute.
      Parameters:
      value - The value for accountFirstLogin
      Returns:
      A modified copy of this object
    • withAccountFirstLogin

      public final UserAccount withAccountFirstLogin(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the accountFirstLogin attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for accountFirstLogin
      Returns:
      A modified copy of this object
    • withAccountLastLogin

      public final UserAccount withAccountLastLogin(StixInstant value)
      Copy the current immutable object by setting a present value for the optional accountLastLogin attribute.
      Parameters:
      value - The value for accountLastLogin
      Returns:
      A modified copy of this object
    • withAccountLastLogin

      public final UserAccount withAccountLastLogin(Optional<? extends StixInstant> optional)
      Copy the current immutable object by setting an optional value for the accountLastLogin attribute. A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for accountLastLogin
      Returns:
      A modified copy of this object
    • withType

      public final UserAccount withType(String value)
      Copy the current immutable object by setting a value for the type attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for type (can be null)
      Returns:
      A modified copy of the this object
    • withExtensions

      public final UserAccount withExtensions(CyberObservableExtension... elements)
      Copy the current immutable object with elements that replace the content of extensions.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withExtensions

      public final UserAccount withExtensions(Iterable<? extends CyberObservableExtension> elements)
      Copy the current immutable object with elements that replace the content of extensions. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of extensions elements to set
      Returns:
      A modified copy of this object
    • withObservableObjectKey

      public final UserAccount withObservableObjectKey(String value)
      Copy the current immutable object by setting a value for the observableObjectKey attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for observableObjectKey
      Returns:
      A modified copy of the this object
    • withDefanged

      public final UserAccount withDefanged(boolean value)
      Copy the current immutable object by setting a present value for the optional defanged attribute.
      Parameters:
      value - The value for defanged
      Returns:
      A modified copy of this object
    • withDefanged

      public final UserAccount withDefanged(Optional<Boolean> optional)
      Copy the current immutable object by setting an optional value for the defanged attribute. An equality check is used on inner nullable value to prevent copying of the same value by returning this.
      Parameters:
      optional - A value for defanged
      Returns:
      A modified copy of this object
    • withCustomProperties

      public final UserAccount withCustomProperties(Map<String,? extends Object> entries)
      Copy the current immutable object by replacing the customProperties map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      entries - The entries to be added to the customProperties map
      Returns:
      A modified copy of this object
    • withObjectMarkingRefs

      public final UserAccount withObjectMarkingRefs(MarkingDefinitionDm... elements)
      Copy the current immutable object with elements that replace the content of objectMarkingRefs.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withObjectMarkingRefs

      public final UserAccount withObjectMarkingRefs(Iterable<? extends MarkingDefinitionDm> elements)
      Copy the current immutable object with elements that replace the content of objectMarkingRefs. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of objectMarkingRefs elements to set
      Returns:
      A modified copy of this object
    • withGranularMarkings

      public final UserAccount withGranularMarkings(GranularMarkingDm... elements)
      Copy the current immutable object with elements that replace the content of granularMarkings.
      Parameters:
      elements - The elements to set
      Returns:
      A modified copy of this object
    • withGranularMarkings

      public final UserAccount withGranularMarkings(Iterable<? extends GranularMarkingDm> elements)
      Copy the current immutable object with elements that replace the content of granularMarkings. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      elements - An iterable of granularMarkings elements to set
      Returns:
      A modified copy of this object
    • withHydrated

      public final UserAccount withHydrated(boolean value)
      Copy the current immutable object by setting a value for the hydrated attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for hydrated
      Returns:
      A modified copy of the this object
    • withToJsonString

      public final UserAccount withToJsonString(String value)
      Copy the current immutable object by setting a value for the toJsonString attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for toJsonString (can be null)
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of UserAccount that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: userId, accountLogin, accountType, displayName, isServiceAccount, isPrivileged, isCanEscalatePrivs, isDisabled, accountCreated, accountExpires, passwordLastChanged, accountFirstLogin, accountLastLogin, id, type, extensions, observableObjectKey, defanged, customProperties, objectMarkingRefs, granularMarkings, hydrated, toJsonString.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value UserAccount with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • copyOf

      public static UserAccount copyOf(UserAccountCoo instance)
      Creates an immutable copy of a UserAccountCoo value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
      Parameters:
      instance - The instance to copy
      Returns:
      A copied immutable UserAccount instance
    • builder

      public static UserAccount.Builder builder()
      Creates a builder for UserAccount.
      Returns:
      A new UserAccount builder