Is using RSA with SHA-1 considered as secure as HMAC-SHA-1? I know SHA-1 hashing is regarded insecure. HMAC-SHA-1 is still regarded secure as this is an encryption process with symmetric key of the hash produced by SHA-1.

So signing using RSA with a key size of 2048 with a SHA-1 hash over the content should be regarded secure just like HMAC-SHA-1, correct?
No, unfortunately your well meant comparison with HMAC fails and RSA with SHA-1 - as defined for PKCS#1 v1.5 padding and PSS - is considered insecure.

The construction of HMAC makes it near invulnerable to attacks on the collision resistance of the underlying hash. That is because it uses the secret key as input to the hash function to create the additional resistance. Any adversary does not have access to that secret key.

However, if the hash is used in a signature, they hashing of the data is commonly performed before the keyed operation is applied. No shared secret is available to allow for the same construction as HMAC and no randomization of the hash is performed. That means that the (lack of) original collision resistance is preserved, and that the signature generation function is therefore vulnerable as well.



As noted in the comments and explained in this answer an additional random input to the data could strengthen the hash and thus signature function significantly, even if that randomization doesn't rely on a shared secret. It would however change the signature API as provided by many RSA functions libraries significantly to add randomization to the hash function as they often directly accept hash values as input.